Error loading a java class to oracle db

hi,
my oracle server: 8i Enterprise Edition Release 8.1.7.0.0
i want to load a simple java class into my oracle server.
java source:
public class Ping
     java.lang.String server;
     public static void main(java.lang.String[] args)
          System.out.println(new Ping().runCmd(args[0]));
     public static java.lang.String runCmd(String cmd)
boolean result=false;
int timeout=5000;
try {            
java.net.InetAddress byName=java.net.InetAddress.getByName(cmd);
               result=byName.isReachable(timeout);
catch(java.io.IOException e)
e.printStackTrace();
     java.lang.String retVal=java.lang.Boolean.toString(result);
          return retVal;
after compiling the java file. i'm using loadjava at dos prompt.
loadjava -user uname/pwd@db -resolve Ping.class
this command results in
ORA-29545: badly formed class:
loadjava: 1 errors
alternatively i had used a command
loadjava -user uname/pwd@db -noverify -resolve Ping.class
this command results in
Error while turning off verifier
ORA-29532: Java call terminated by uncaught Java exception: java.security.Ac
cessControlException: the Permission (oracle.aurora.security.JServerPermission V
erifier ) has not been granted by dbms_java.grant_permission to SchemaProtection
Domain(SMSPGS|PolicyTableProxy(SMSPGS))
ORA-29545: badly formed class:
loadjava: 2 errors
but user is having sufficient rights (javasyspriv)
what is wrong above, please help me.
regards,
s.mohamed asif

hi,
thanks for your response
Ping.class just checks whether the specified node is reachable or not.
result=byName.isReachable(timeout);
the jdk loaded in oracle DB is older one and the method above java.net.InetAddress.isReachable(java.lang.int) is available since
jdk 1.5
source:
public class Ping
java.lang.String server;
public static void main(java.lang.String[] args)
System.out.println(new Ping().runCmd(args[0]));
public static java.lang.String runCmd(String cmd)
boolean result=false;
int timeout=5000;
try {
java.net.InetAddress byName=java.net.InetAddress.getByName(cmd);
result=byName.isReachable(timeout);
catch(java.io.IOException e)
e.printStackTrace();
java.lang.String retVal=java.lang.Boolean.toString(result);
return retVal;
}how to load the new jdk set into existing oracle db server and replace the existing jdk.
what can be done to achieve this ?
regards,
s.mohamed asif

Similar Messages

  • Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.

    Hi!!!
    I�m trying to execute a example program included in http://archive.coreservlets.com/, the file is FruitTest.java....this compile very well...but....when i tried to execute it i have the following error:
    Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    Could somebody tell me what i have to add to my classpath?...and how to know if i have to download something and in what link is it?......
    Thanks in advance...
    Mary

    Hi mary,
    Please try following code, but before that please include classes12.zip in ur classpath. This file contains the oracle thin driver.
    Connection connection = null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String url = "jdbc:oracle:thin:@dbUrl"
    connection = DriverManager.getConnection(url, "dbName", "password");
    }catch (Exception e){
    e.printStackTrace();
    good luck ...san :-)

  • Problem when loading simple java class in Oracle

    Hi,
    I am using loadjava to load the java class in the oracle database. But it is failing. Can some one please help me out with this.
    Command.
    loadjava -thin -user username/password@zrtph0ja:1521:database -resolve firstProcedure.class
    Errors:
    Error while computing shortname of firstProcedure
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error while computing shortname of firstProcedure
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-29521: referenced name java/io/PrintStream could not be found
    ORA-29521: referenced name java/lang/Object could not be found
    ORA-29521: referenced name java/lang/String could not be found
    ORA-29521: referenced name java/lang/StringBuffer could not be found
    ORA-29521: referenced name java/lang/System could not be found
    loadjava: 7 errors
    Please help.
    Regards
    Sudhir
    null

    U havent installed JServer in ur DBMS.
    Read the Oracle 8i JServer Manual for
    manually installing the Oracle JVM.

  • Error while importing java class into oracle forms 10g

    Hi
    I have generated a web service client using jdeveloper 10g. It consists of complex type methods. I am trying to import the class files using java importer in oracle form 10g. I am able import all of them successfully except one. That one is the main method. Please see the error and suggest me how to overcome this error.
    Exception occurred: java.lang.NoClassDefFoundError: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    Thanks in advance

    Do you see oracle/jdeveloper listed in "Import Java Classes" when you try to import?
    If not, make sure you add C:\DevSuiteHome_1\jdev\lib\jdev.jar to FORMS_BUILDER_CLASSPATH in registry
    Also excetion indicates: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    If you typing it - type: oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub

  • How to load a java file into Oracle?

    Hello,
    I have some problem in loading a java file into Oracle 8i. I used "loadjava -user <userName/Password> -resolve <javaClassName>" command.
    JAVA Version used JDK 1.5
    When calling this class file from a trigger gives this error
    ORA-29541: class ANTONY1.DBTrigger could not be resolved.
    Can anyone help me to resolve this problem?

    Hello,
    Which username did you use to load the class, and which user is running the trigger?
    The default resolver searches only the current user's schema and PUBLIC so the java class needs to be loaded into one of these.
    cheers,
    Anthony

  • Java class in oracle apps forms

    java class in oracle apps forms
    We developed a java class and its running perfectly on local machine (Over the web through java applet ) But when we deployed it in apps and run with the client machine its not running .so please suggest where we put our java class files and how to run it in apps? Is there any API's .
    regards,
    krishna

    Hi user;
    What is your Client Operayting system, what is your browser?
    This error happens for one client or for all? Did you try to login from one other machine(for instance XP) and dif. browser version?
    Please check below which could be helpful for your issue:
    FRM-92101:
    Recommended Browsers for Oracle E-Business Suite Release 12 [ID 389422.1]
    FRM-92101: There Was a Failure in the Forms Server During Startup After Fresh R12 Installation [ID 429627.1]
    R12 fresh install FORMS DO NOT LAUNCH - FRM-92101/500 [ID 427714.1]
    FRM-92101: Forms Server oracle.forms.net.ConnectionException: Forms session <1> failed during startup: no response from runtime process [ID 880088.1]
    Also check:
    http://onlineappsdba.com/index.php/2009/06/15/frm-92101-with-internet-explorer-8-how-to-uninstall-ie8/
    Re: R12 database and JRE Issue
    Regard
    Helios

  • Error loading win32com: java.lang.UnsatisfiedLinkError: no win32com in java

    Hi all
    I am getting this error
    "Error loading win32com: java.lang.UnsatisfiedLinkError: no win32com in java.library.path"
    while running my program.
    Please suggest me any solution for this
    Thanks
    Balasubramaniam

    OK...here's what I did.
    Assumptions: The javacomm20-win32.zip extracted into c:\work\commapi. JDeveloper was extracted into c:\jdev902.
    Step 1: copy c:\work\commapi\win32com.dll c:\jdev902\jdk\bin\win32com.dll
    Step 2: copy c:\work\commapi\comm.jar c:\jdev902\jdk\lib\comm.jar
    Step 3: copy c:\work\commapi\javax.comm.properties c:\jdev902\jdk\lib\javax.comm.properties
    Result: Compilition in JDeveloper is OK but at runtime "Error loading win32com: java.lang.UnsatisfiedLinkError: no win32com in java.library.path"
    Maybe the JRE is running the show...
    Step 4: copy c:\work\commapi\win32com.dll c:\jdev902\jdk\jre\bin\win32com.dll
    Step 5: copy c:\work\commapi\comm.jar c:\jdev902\jdk\jre\lib\ext\comm.jar
    Step 6: copy c:\work\commapi\javax.comm.properties c:\jdev902\jdk\jre\lib\javax.comm.properties
    This both compiles and works at runtime but I'm confused. The Messages buffer in JDeveloper suggests that the JDK alone is running the show:
    C:\jdev902\jdk\bin\javaw.exe -ojvm -XXdebug,quiet,port1381 -classpath C:\work\WorkspaceApplet\JavaXCommTest\classes;C:\jdev902\jdev\lib\jdev-rt.jar;C:\jdev902\jdk\lib\comm.jar gov.seattle.scl.cams.serial.RekPortTest
    Debugger attempting to connect to local process.
    but when you get down to it somehow jdk\jre is playing the game too.
    Any explanations?

  • How to load a java script in oracle database

    Is it possible to load d java script in Oracle database. while the object type is
    java resource ..

    RENUJP wrote:
    I meant to load a javascript to oracle database not to oracle appliocation.
    like loadjava....
    I can load a javascript to oracle database.. but i can't call it...Please re-read the comments above, especially the part about this not being a javascript nor oracle forum. Exactly what part about this information don't you understand?

  • Run a java class in Oracle db to connect to Sybase

    Hi All, I'm looking for a way to connect to Sybase database at no-license-cost (meaning Oracle Gateway or similar 3rd party products), first coming idea was JDBC, I know I can run a java class in Oracle, the simple idea is to write a java class which connects to Sybase via JDBC thin driver and return the resultset of given query in a java class, the resultset will be presented in Oracle Apex framework.  Does anyone know if this can be done or not, and how?  Any howto articles are welcomed.
    Henry

    Henry:
    To connect to Sysbase or MsSQL Server you could use jTDS open source driver.
    http://sourceforge.net/projects/jtds/
    upload above driver (jar file) using loadjava, and grants the port connection using dbms_java.grant_permission procedure.
    Because jTDS is pure java driver (mode 4) is possible to use directly inside the RDBMS.
    Best regards, Marcelo.
    PD: Latest jtds driver is compiled against 1.6 sources, but oldest version will work with 1.5 for 11g.

  • Error loading LinuxSerialParallel: java.lang.UnsatisfiedLinkError: no Linux

    Trying to start demo from Sun commapi:
    $ java SimpleRead
    Error loading LinuxSerialParallel: java.lang.UnsatisfiedLinkError: no LinuxSerialParallel in java.library.path
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at SimpleRead.main(SimpleRead.java:67)
    Caused by: java.lang.NullPointerException
    at javax.comm.CommPortIdentifier.findConfFile(CommPortIdentifier.java:199)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:117)
    ... 1 more
    What does it need?
    java version "1.5.0_04" on Linux 2.6.10-1.770_FC2smp

    hey i have the exact same problem, this is the error:
    # java BlackBox
    Error loading LinuxSerialParallel: java.lang.UnsatisfiedLinkError: no LinuxSerialParallel in java.library.path
    Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink
    at com.sun.comm.Unix.isDevLink(Native Method)
    at com.sun.comm.PathBundle.add(PathBundle.java:108)
    at com.sun.comm.PlatformPortBundle.<init>(PlatformPortBundle.java:44)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
    at BlackBox.main(BlackBox.java:223)
    what can i do?
    P.D: i also hate this fvasldkfmnlds API, but i need it

  • Servlet error: Renderer failed: java.lang.NoClassDefFoundError: oracle/um/w

    Hi,
    since a few days, I'm getting this error message Servlet error: Renderer failed: java.lang.NoClassDefFoundError: oracle/um/webmail/util/OESAccess
    if I click on the Administration TAB. When i use /um/admin/UMAdminLogin.uix I'm getting a "Resource Bundle not found error".
    In the webclient, I do have everything except the send buttons.
    Have absolutly no Idea where this comes from and how to fix it. Please help

    I think would be better to post this topic in Development Forums. There are forums for this kind of topic.
    Joel P�rez

  • Error loading SolarisSerial: java.lang.UnsatisfiedLinkError:

    Hello All, i am having problems installin the java comm api in Eclipse. I added the comm.jar file from the comm api folder in the build path. and i added the javax.comm.properties file in:
    C:\Program Files\Java\jre1.6.0_01\lib
    but when i compile it and run, i get the following error:
    Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path
    Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
         at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
         at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
         at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
         at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
         at ListOpenPorts.<init>(ListOpenPorts.java:17)
         at ListOpenPorts.main(ListOpenPorts.java:49)
    where did i go wrong? :/

    jschell wrote:
    Is it becuz i m using DELL laptop?Running solaris and not windows? The exception would certainly seem to suggest that you are running solaris.
    Thanx alot jschell :D Tht Solaris and Windows prob clicked! I revised all the installation procedure again, and installed Generic windows comm.jar file [for back end]and then the RxTxcomm.jar [for front end] and then in the configure build path [m Using Eclipse for my code] , i expanded the RxTxcomm.jar node, and added the path in the Native Library to:
    C:\Users\Urooj\Desktop\rxtx-2.2pre2-bins\win32\rxtxSerial.dll
    and instead of
    import javax.comm.CommPort;
    import javax.comm.CommPortIdentifier;
    import javax.comm.PortInUseException:D
    i replaced this with:
    import java.util.Enumeration;
    import gnu.io.CommPortIdentifier;
    import gnu.io.CommPort;
    import gnu.io.PortInUseException;Edited by: java-ized on Jan 5, 2010 3:49 PM

  • Oracle Java Environment Error - Not enough java classes defined ?

    I'm using 11gR1, and recently ran into a problem with Java Stored Procedures.
    It was working fine last week, and then this week at runtime I started getting an error:
    Error in Oracle java environment: ops1 - java.lang.Exception: Not enough java classes defined in the database.  Java Stored Procedures are not installed properly.
    I checked both the SYS schema and my user schema's Java classes. Neither had any invalid classes. For my user schema, the number of java classes seems right. For the SYS schema, I haven't figured out how to get past the 2000 rows fetch limit, so it will max out at 2000 - none of which are invalid.
    I cleared out my user schema and re-loaded its classes, and they all compiled/validated fine.
    A google search found no help...
    TIA
    Update (results of class count query):
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count (*) from dba_objects where object_type like '%JAVA%';
    COUNT(*)
    28895
    Edited by: GDub on Aug 18, 2010 2:37 PM

    I'm using 11gR1, and recently ran into a problem with Java Stored Procedures.
    It was working fine last week, and then this week at runtime I started getting an error:
    Error in Oracle java environment: ops1 - java.lang.Exception: Not enough java classes defined in the database.  Java Stored Procedures are not installed properly.
    I checked both the SYS schema and my user schema's Java classes. Neither had any invalid classes. For my user schema, the number of java classes seems right. For the SYS schema, I haven't figured out how to get past the 2000 rows fetch limit, so it will max out at 2000 - none of which are invalid.
    I cleared out my user schema and re-loaded its classes, and they all compiled/validated fine.
    A google search found no help...
    TIA
    Update (results of class count query):
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count (*) from dba_objects where object_type like '%JAVA%';
    COUNT(*)
    28895
    Edited by: GDub on Aug 18, 2010 2:37 PM

  • Unable to get database connection  from loaded java class in oracle

    Hi all,
    I am trying to call java class method from oracle function, but getting below exception, while creating connection.
    SQL> select charge_calculation(1,'2011-06-01', 'E') from dual;
    select charge_calculation(1,'2011-06-01', 'E') from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    inside main method
    inside main method1
    inside main method2
    inside main method3
    inside main method3
    Exception in thread "Root Thread" java.lang.ExceptionInInitializerError
    at javax.crypto.Cipher.getInstance(DashoA12275)
    at oracle.security.o5logon.O5LoginClientHelper.decryptAES(Unknown Source
    at oracle.security.o5logon.O5LoginClientHelper.generateOAuthResponse(Unk
    nown
    Source)
    at
    oracle.jdbc.driver.T4CTTIoauthenticate.marshalOauth(T4CTTIoauthenticate.java)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:367)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    501)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
    at
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java:187)
    at SPEodPricing.spEodPricing(SPEODPRICING:98)
    at SPEodPricing.main1(SPEODPRICING:47)
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
    at javax.crypto.SunJCE_b.<clinit>(DashoA12275)
    ... 13 more
    Caused by: java.security.PrivilegedActionException: java.io.IOException
    at java.security.AccessController.doPrivileged(Native Method)
    ... 14 more
    Caused by: java.io.IOException
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java)
    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:165)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:43)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:70)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.ja
    va:102)
    at
    sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:1
    24)
    at javax.crypto.SunJCE_d.a(DashoA12275)
    at javax.crypto.SunJCE_b.g(DashoA12275)
    at javax.crypto.SunJCE_b.e(DashoA12275)
    at javax.crypto.SunJCE_q.run(DashoA12275)
    ... 15 more
    SQL> select charge_calculation(1,'2011-06-01', 'E') from dual;
    select charge_calculation(1,'2011-06-01', 'E') from dual
    ERROR at line 1:
    ORA-29549: class BBVA_MERGED.SPEodPricing has changed, Java session state
    cleared
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64
    bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    JAVA Sample code:-
    public String method1(int pi_ctry_id,String pi_cur_busi_date ,String pi_eod_bod_flag)
    System.out.println("inside main method1");
    CachedRowSet tmplcrs                = null;
    HashMap resMap                              = new HashMap();
              Double ln_candidate_extra           = 0.0;
              Double ln_calculate_on_val          = 0.0;
              int lv_calculate_on                = 0;
              int lv_cand_attribute                = 0;
    // int pi_ctry_id                          = 0;
    // String pi_cur_busi_date           = null;
    int pi_bch_id                          = 0;
    // String pi_eod_bod_flag               = null;
    Date ldt_cur_busi_date          = null;
    Date lstr_next_calc_date     = null;
    int li_bch_id                         = 0;
    int li_chg_ac_branch               = 0;
    int calFrequency                     = 0;
    DbUtils dbObj = new DbUtils();
    Map reqMap = new HashMap();
    CachedRowSet updtcrs                = null;
    Connection conn = null;
              try
    System.out.println("inside main method2");
                   reqMap.put("pi_ctry_id", ""+pi_ctry_id);
                   reqMap.put("pi_cur_busi_date", ""+pi_cur_busi_date);
                   reqMap.put("pi_eod_bod_flag", ""+pi_eod_bod_flag);
    System.out.println("inside main method3");
                   Class.forName("oracle.jdbc.driver.OracleDriver");
    // Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.1.56.85:1521:orcl", "bbva_merged", "bbva_merged");
    // conn = DriverManager.getConnection("jdbc:oracle:thin:@10.1.50.104:1521:cmsdb6", "bbva_base", "bbva_base");
    System.out.println("inside main method3");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.50.129)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.50.130)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = BBVASIT)))", "BBVA_MERGED", "BBVA_MERGED");
    conn.setAutoCommit(false);
    System.out.println("inside main method4");
    }

    29532, 00000, "Java call terminated by uncaught Java exception: %s"
    // *Cause: A Java exception or error was signaled and could not be
    //          resolved by the Java code.
    // *Action: Modify Java code, if this behavior is not intended.

  • Avoid compilationof java class  in oracle using load java

    we are trying to load dom4j.jar file into oracle jvm using loadjava.
    command:
    loadjava -verbose -user un/pwd:host:port:sid dom4j.jar
    the loadjava utility unzip the jar and loads class files one by one.
    most of the classes are marked as invlid.
    if i use -resolve option in loadjava
    dependency classes are required.
    how to make class are valid without using the resolve option or without loading dependent jars.

    Try with -genmissing option.

Maybe you are looking for