dbTalk Databases Forums  

What could "break" java in Oracle 11g..?

comp.databases.oracle.server comp.databases.oracle.server


Discuss What could "break" java in Oracle 11g..? in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeremy
 
Posts: n/a

Default What could "break" java in Oracle 11g..? - 02-07-2011 , 12:32 PM






Hi

[11g 11.2.0.1.0 on Windows Server 2007]


I figured that you need people like me to ask questions in cdos to keep
it going


I am trying to help a colleague work out why something "isn't working".

The something in question is simple java compilation:

CREATE OR REPLACE and compile JAVA SOURCE NAMED "jjo_java" AS
import java.lang.*;
import java.io.*;
public class jjo_java
{

};
/

This compiles fine in account A but in account B fails with

Warning: Java created with compilation errors.

Elapsed: 00:00:00.40
18:18:59 SQL> show errors java source "jjo_java"
No errors.
18:20:04 SQL>

If we remove the line

import java.io.*;

then it compiles OK.

[odd that there no errors shown despite it reporting errors and if we
look into the table USER_ERRORS I see simply
"ORA-29535: source requires recompilation"]



Account B is a long-established "application owner" account with lots of
tables , plsql, types etc. and is where we perform core code development
and in which we are trying to utilise some java APIs from within PL/SQL.
So what has happened is that "loadjava" has been used to put stuff into
the account and then various things have been removed and now from a
java perspective, this account is "broken".

Account A was created freshly this afternoon by:

create user a identified by a;
grant connect, resource to a;


So to assist my colleague I wanted to see if anyone out there could shed
some light on the possible cause.

Given that the java is all centrally-held, I don't see how A could
access it all correctly and yet B cannot. I did wonder further if there
might be some kind of name conflict but we have looked long and hard at
user_objects and cannot see anything that might be responsible.

Can anyone suggest a path to find just what is wrong with account B?
Sledgehammers to crack this nut are acceptable within reason

--
jeremy

Reply With Quote
  #2  
Old   
kuassi.mensah@gmail.com
 
Posts: n/a

Default Re: What could "break" java in Oracle 11g..? - 02-08-2011 , 06:40 PM






On Feb 7, 10:32*am, Jeremy <jeremy0... (AT) gmail (DOT) com> wrote:
Quote:
Hi

[11g *11.2.0.1.0 on Windows Server 2007]

I figured that you need people like me to ask questions in cdos to keep
it going

I am trying to help a colleague work out why something "isn't working".

The something in question is simple java compilation:

CREATE OR REPLACE and compile JAVA SOURCE NAMED "jjo_java" AS
* * * * import java.lang.*;
* * * * import java.io.*;
* * * * public class jjo_java
* * * * {

* * * * };
/

This compiles fine in account A but in account B fails with

Warning: Java created with compilation errors.

Elapsed: 00:00:00.40
18:18:59 SQL> show errors java source "jjo_java"
No errors.
18:20:04 SQL

If we remove the line *

*import java.io.*;

then it compiles OK.

[odd that there no errors shown despite it reporting errors and if we
look into the table USER_ERRORS I see simply
"ORA-29535: source requires recompilation"]

Account B is a long-established "application owner" account with lots of
tables , plsql, types etc. and is where we perform core code development
and in which we are trying to utilise some java APIs from within PL/SQL.
So what has happened is that "loadjava" has been used to put stuff into
the account and then various things have been removed and now from a
java perspective, this account is "broken".

Account A was created freshly this afternoon by:

* create user a identified by a;
* grant connect, resource to a;

So to assist my colleague I wanted to see if anyone out there could shed
some light on the possible cause.

Given that the java is all centrally-held, I don't see how A could
access it all correctly and yet B cannot. I did wonder further if there
might be some kind of name conflict but we have looked long and hard at
user_objects and cannot see anything that might be responsible.

Can anyone suggest a path to find just what is wrong with account B?
Sledgehammers to crack this nut are acceptable within reason

--
jeremy
Hi,

Quote:
Given that the java is all centrally-help

This is not true, the Java code will be created within the schema
(user) you are connected with; however if you use loadjava, you may
specify the destination schema using -u option.
I suggest to check which Java source is being compiled by retrieving
the source, using the following query
Select text from user_source where name = 'jjo_java';

Kuassi

Reply With Quote
  #3  
Old   
bdbafh
 
Posts: n/a

Default Re: What could "break" java in Oracle 11g..? - 02-10-2011 , 07:24 AM



On Feb 7, 1:32*pm, Jeremy <jeremy0... (AT) gmail (DOT) com> wrote:
Quote:
Hi

[11g *11.2.0.1.0 on Windows Server 2007]

I figured that you need people like me to ask questions in cdos to keep
it going

I am trying to help a colleague work out why something "isn't working".

The something in question is simple java compilation:

CREATE OR REPLACE and compile JAVA SOURCE NAMED "jjo_java" AS
* * * * import java.lang.*;
* * * * import java.io.*;
* * * * public class jjo_java
* * * * {

* * * * };
/

This compiles fine in account A but in account B fails with

Warning: Java created with compilation errors.

Elapsed: 00:00:00.40
18:18:59 SQL> show errors java source "jjo_java"
No errors.
18:20:04 SQL

If we remove the line *

*import java.io.*;

then it compiles OK.

[odd that there no errors shown despite it reporting errors and if we
look into the table USER_ERRORS I see simply
"ORA-29535: source requires recompilation"]

Account B is a long-established "application owner" account with lots of
tables , plsql, types etc. and is where we perform core code development
and in which we are trying to utilise some java APIs from within PL/SQL.
So what has happened is that "loadjava" has been used to put stuff into
the account and then various things have been removed and now from a
java perspective, this account is "broken".

Account A was created freshly this afternoon by:

* create user a identified by a;
* grant connect, resource to a;

So to assist my colleague I wanted to see if anyone out there could shed
some light on the possible cause.

Given that the java is all centrally-held, I don't see how A could
access it all correctly and yet B cannot. I did wonder further if there
might be some kind of name conflict but we have looked long and hard at
user_objects and cannot see anything that might be responsible.

Can anyone suggest a path to find just what is wrong with account B?
Sledgehammers to crack this nut are acceptable within reason

--
jeremy
connect and resource have gone bye bye.
this was mentioned in the upgrade docs.
grant the app schemas some real roles with real privileges ... and in
the case of app owner schemas that leverage stored code, grant real
sys privs directly, not via roles.

-bdbafh

Reply With Quote
  #4  
Old   
Jeremy
 
Posts: n/a

Default Re: What could "break" java in Oracle 11g..? - 02-10-2011 , 09:21 AM



In article <dffb7358-1189-46bf-b160-
f7b28f003a1d (AT) n16g2000prc (DOT) googlegroups.com>, bdbafh (AT) gmail (DOT) com says...
Quote:
connect and resource have gone bye bye.
this was mentioned in the upgrade docs.
grant the app schemas some real roles with real privileges ... and in
the case of app owner schemas that leverage stored code, grant real
sys privs directly, not via roles.

As I said, user A which was created as described functions perfectly -
i.e. able to execute the java.

It is user B we have the problem with....

--
jeremy

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.