Java Class Loading.

I know that the primordial, default java class loader may be re-written and replaced for the java runtime environment,
so that it uses the new one.
However, I have also heard the replacement is not entire; the replacement loader is always saught out by the original,
"primordial" class loader.
-Is this true?
The java language and runtime does furnish the developer to program their own class loader and tell
the runtime to use that.
-Within the java language, is it possible to recreate the .class file bytecode read by java to load
user defined classes from the Class reference on an object? Does serialization allow this?
-If so, is there a secure way, within one's own program, to specify an option forbidding the user to replace
the default class loader within the runtime instance of a program, which may not be further
abragated within the java language in another runtime instance?

-Is this true?It doesn't even make sense. If the 'primordial class loader' has been replaced how can it do anything at all? Either it isn't replaced or it is. What do your sources actually say?
-Within the java language, is it possible to recreate the .class file bytecode read by java to load
user defined classes from the Class reference on an object?No, you ultimately have to call one of the defineClass() methods, which are final.
Does serialization allow this?No.
-If so, is there a secure way, within one's own program, to specify an option forbidding the user to replace
the default class loader within the runtime instance of a program, which may not be further
abragated within the java language in another runtime instance?The Security Manager can prevent the application from creating class loaders.

Similar Messages

  • Java Class loaded in Database.

    hi
    I have loaded a Java class into Oracle 8.1.6 database. I have created a procedure (call spec) for calling a method in that class.
    It takes 3 parameters (Server ip address, From,To). Actually the purpose of the program is to take parameters and send mails
    The Java program uses JavaMail. I have loaded all classes required and the class shows status as valid. When I try to execute the method through a pl/sql procedure it gives the following error.
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.security.AccessControlException: the Permission
    (java.util.PropertyPermission * read,write) has not been granted by
    dbms_java.grant_permission to
    SchemaProtectionDomain(SANTOSH|PolicyTableProxy(SANTOSH))
    ORA-06512: at "SANTOSH.SENDMAIL", line 0
    ORA-06512: at line 2
    In Dbms_java package there is nothing called grant_permission .
    What may have gone wrong ???
    Thanks

    Maybe you should grant JAVASYSPRIV and JAVAUSERPRIV privilege to your db user
    first.
    Good luck!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Santosh Nair ([email protected]):
    hi
    I have loaded a Java class into Oracle 8.1.6 database. I have created a procedure (call spec) for calling a method in that class.
    It takes 3 parameters (Server ip address, From,To). Actually the purpose of the program is to take parameters and send mails
    The Java program uses JavaMail. I have loaded all classes required and the class shows status as valid. When I try to execute the method through a pl/sql procedure it gives the following error.
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.security.AccessControlException: the Permission
    (java.util.PropertyPermission * read,write) has not been granted by
    dbms_java.grant_permission to
    SchemaProtectionDomain(SANTOSH|PolicyTableProxy(SANTOSH))
    ORA-06512: at "SANTOSH.SENDMAIL", line 0
    ORA-06512: at line 2
    In Dbms_java package there is nothing called grant_permission .
    What may have gone wrong ???
    Thanks<HR></BLOCKQUOTE>
    null

  • Site Studio Content in a Java Class

    Hi Gurus,
    I would like to know if there's some Webcenter Content Service ou some Webcenter Portal interface, service, class ou data control to consume the content from a Site Studio Contributor Data File in my custom Java class.
    Obviously I can request the XML from some URL and consume as any XML in Java, but if there's some way to abstract this implementation I think that would be a best practice,      
    eventually Oracle can do some change in XML patterns and if I use some service I don't need to worry about this.
    There's in a Site Studio service called WCM_EDIT_DATA_FILE that I thought that can help, but this works in browser request, but no in my custom java service.
    It's possible test this service in this way:
    http://<host>:<port>/cs/idcplg?IdcService=WCM_EDIT_DATA_FILE&dDocName=<dDocName>&IsSoap=1
    I know that this thread are related with Webcenter Content, but I think that is more possible that someone from Portal already did this.
    Thanks for help

    Never mind. I resolved this using a ResourceBundle, thanks to another posting on this forum. I must say, the oracle documentation for this feature is scant and erroneous.
    How does one go about accessing a java resource object from a java class loaded into the database?
    I created a.properties file and loaded it using loadjava.
    Next I wrote a class in which I try to load the resource:
    import java.io.*;
    import java.util.*;
    public class C {
    public static void load() throws Exception {
    Properties p = new Properties();
    p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("a.properties"));
    I then published method load as procedure p.
    When I execute p, I get the following error:
    SQL> exec p
    java.lang.NullPointerException
    at C.load(C.java:5)
    BEGIN p; END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException
    ORA-06512: at "QSI.P", line 0
    ORA-06512: at line 1
    Thanks
    Suresh

  • Accessing Java Resource in a Java class

    How does one go about accessing a java resource object from a java class loaded into the database?
    I created a.properties file and loaded it using loadjava.
    Next I wrote a class in which I try to load the resource:
    import java.io.*;
    import java.util.*;
    public class C {
    public static void load() throws Exception {
    Properties p = new Properties();
    p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("a.properties"));
    I then published method load as procedure p.
    When I execute p, I get the following error:
    SQL> exec p
    java.lang.NullPointerException
    at C.load(C.java:5)
    BEGIN p; END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException
    ORA-06512: at "QSI.P", line 0
    ORA-06512: at line 1
    Thanks
    Suresh

    Never mind. I resolved this using a ResourceBundle, thanks to another posting on this forum. I must say, the oracle documentation for this feature is scant and erroneous.
    How does one go about accessing a java resource object from a java class loaded into the database?
    I created a.properties file and loaded it using loadjava.
    Next I wrote a class in which I try to load the resource:
    import java.io.*;
    import java.util.*;
    public class C {
    public static void load() throws Exception {
    Properties p = new Properties();
    p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("a.properties"));
    I then published method load as procedure p.
    When I execute p, I get the following error:
    SQL> exec p
    java.lang.NullPointerException
    at C.load(C.java:5)
    BEGIN p; END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointerException
    ORA-06512: at "QSI.P", line 0
    ORA-06512: at line 1
    Thanks
    Suresh

  • Error 'Inconsistent datatypes' with Java classes

    Hi,
    I have some Java classes loaded in Oracle 8.1.6, mapped as Object Types, so when I create one object from PL/SQL, JVM ought to create the matching Java object, communicating via the SQLData interface.
    Unfortunately, after the code:
    pippo:=OraMailer('mail.server.com','mymail');
    that creates the PL/SQL object, any code that use member procedures or function wrapping instance methods of the Java class fails with the error 932: Inconsistent datatypes.
    I looked for a mistake in my PL/SQL and Java code, but no error was found.
    It is very important: help me!!!
    Thx

    So here is what you are doing:
    ArrayList results = //get employees from database
    ListIterator langIt = results.listIterator();
    while (langIt.hasNext()) {
      Employee emp = langIt.next();
      String name2 = emp.getName();
      String SSNo = emp.getSSNum();
      results.add(name2);
      results.add(SSNo);
    }So you get a list or Employee objects, then you get an iterator over the list. For each Employee in the list you add the name and SSNo as Strings back to the same list. From the API for ConcurrentModificationException the exception can be thrown when you modify a collection while iterating over the collection - which is precisely what you are doing.
    The ListIterator interface allows you to modify the list through its own methods. Try using:
      langIt.add(name2);
      langIt.add(SSNo);instead.
    Why are you taking the name and SSNo out of the Employee object and placing them back in the same List anyway? That makes no sense to me.

  • Seemingly random errors (Class Loading)

    Hi,
    I wonder if anyone out there could help me or point me in the right direction to solve this problem im having.
    For a Uni project I am writing a Java application that takes three components stored in seperate Jar files (GUI, AI, and Model) dynamically from user defined locations by a central loading class.
    eg GUIAddress = "c:/java/guis/gui.jar"
    Each has a loading class defined in a MANIFEST.MF file within each Jar file and these are in turn defined by interfaces within my central loading program.
    I have set it out like this to allow me to quickly test out different components without changing the main structure of the program.
    The problem im having is that I keep getting different ClassFormatErrors depending on what I have changed. Errors include:
    Local variable name has bad constant pool index
    Extra bytes at the end of the class file
    Code segment has wrong length
    Illegal constant pool index
    Code of a method has length 0All these errors are produced with the same compiler (JRE1.4.2) and with minimal changes to the source code.
    For example I get the program to a stage where it works then add the un-used constant to a classprivate int foobar = 10; recompile and reload and i get the error Extra bytes at the end of the class file if I take it out again recompile and rerun and alls better.
    Now to me that one line shouldnt make a differene to the program in any significant way. But anyway thats just a small example to show you what my problem is.
    These problems started when i made a class Span (http://rex.homeip.net/~matt/java/gui/src/gui/graphs/Span.java) which as you can see does nothing special, but when i use it from another class (http://rex.homeip.net/~matt/java/gui/src/gui/GraphViewer.java) all hell breaks loose. Now i know the class is being loaded and methods can be called from it (line 84) but if i try to call setSpan() then i get the error Local variable name has bad constant pool indexIf anyone has any clues please let me know, im getting sick of going round in circles.
    Cheers in advance.
    Matt
    links
    Main loading class: http://rex.homeip.net/~matt/java/loader/src/loader/Loader.java
    Class Loader: http://rex.homeip.net/~matt/java/loader/src/loader/setup/SetupManager.java
    GUI: http://rex.homeip.net/~matt/java/gui/src/gui/Gui.java
    GraphViewer: http://rex.homeip.net/~matt/java/gui/src/gui/GraphViewer.java
    Span: http://rex.homeip.net/~matt/java/gui/src/gui/graphs/Span.java

    I think I have the solution....
    I had the same exact (seemingly random) ClassFormatExceptions being thrown from my custom Class-Loader as well. I would get the same variety of debug prints as you (Invalid constant pool, Code segment has wrong length, etc). At times it seemed to happen randomly to different classes that I loaded, depending on small changes I made to the code.
    Here is the background and how I solved it.
    I dervied from ClassLoader to make my custom class-loader. I overrode the findClass() method, and NOT the loadClass() method. This is the Java 2 method of making class-loaders, which is simplier than implementing your own loadClass() as in the older Java 1.1way of doing things.
    My custom class-loader (called JarFileClassLoader, BTW) already had a list of JAR files that it searched when its findClass() method was called from its parent. I was using a JarFile object to examine the contents of a particular JAR file. Once it found the JarEntry that represented the class I wanted to load, it asked for the InputStream by calling:
    JarEntry desiredEntry = // assigned to the JarEntry that represents the class you want to load
    InputStream myStream = myJar.getInputStream( desiredEntry );
    Then I asked how many bytes were available for reading, I created a byte array that could hold that many bytes, and I read the bytes from the InputStream:
    int totalBytes = myStream.available();
    byte[] classBytes = new byte[totalBytes];
    myStream.read( classBytes );
    Finally, I would define and resolve my class by:
    Class loadedClass = super.defineClass( className, classBytes, 0, classBytes.length );
    resolveClass( loadedClass );
    Sometimes, on the call to defineClass(), I would get all the weird ClassFormatExeptions.
    After the searching around these forums for a while, I found a lot of discussion about this problem, but I didn't find any concrete explanations or solutions. But I did see some cursory discussion about the InputStream class. This lead me to investigate how this class works exactly.
    As it turns out, when you call:
    myStream.read( classBytes );
    it is NOT guaranteed to read all the available bytes and completely fill the byte array you made for it. It could very easily read LESS than the total available bytes. I don't know why it would do this...maybe something to do with internal buffering of the stream. This happens more often on bigger sized class files that you are trying to read.
    The read() call will return an integer that represents the actual number of bytes read during that attempt to read. So, the solution is to check if you got all your bytes during the first call to read(), if not, then read some more.
    There is another version of the read() method that takes an 'offset' value into your array and a max bytes to read value. I used this method to modify my code to look like:
    int total = myStream.available();
    int numNeeded = total;
    int numRead = 0;
    int offset = 0;
    byte[] classBytes = new byte[total];
    do
    numNeeded -= numRead;
    offset = numRead;
    numRead += inStream.read( classBytes, offset, numNeeded );
    } while( numRead < total );
    This will continue looping until all the bytes are read. Then I never got those funky ClassFormatExceptions again. Before my fix, I was getting partial class definitions from calls to read() that didn't return all the bytes. Depending on which part of the class was omitted, I got the varied error prints that you got. Now, after this fix, it seems to work just fine.
    Hope this helps!
    -Mark

  • Download jar / java class from database

    Hello,
    I have database 10.2.0.3 with one procedure that calls some java class loaded in database. Unfortunately I don't have source code of that java class or whole jar that was loaded into database.
    I would like to download it from database and try to decompile it.
    Can you tell me how can I download some java classes from database?
    Everything I know is only the name of some java class that is used in one PL/SQL procedure (CREATE OR REPLACE PROCEDURE ..... AS LANGUAGE JAVA)
    Thanks for some tips

    Can you tell me how can I download some java classes from database?You can use dbms_java.export_class procedure to export class as blob, then just save the blob to file.

  • LOADJAVA이용시 JAVA CLASS OBJECT의 권한 문제

    제품 : SQL*NET
    작성날짜 : 2004-01-14
    LOADJAVA이용시 JAVA CLASS OBJECT의 권한 문제
    ====================================
    PURPOSE
    Java Stored Procedure를 이용하기 위해 java class를 DB로 load할 때 loadjava를
    이용할 수 있다. 이때 loadjava 수행시 권한 오류나, java stored procedure(JSP)의
    owner와 다른 owner로 java class를 load하고 JSP에서 사용하는 경우의 권한
    부여 방법 등을 확인해 본다.
    Explanation & Example
    1. loadjava와 dropjava의 간단한 실행 방법 및 관계된 objects들
    loadjava command는 가장 간단하게 다음과 같이 지정할 수 있다.
    -r option은 db에 load하고서 load된 java object를 compile하는 것이다.
    os> loadjava -user scott/tiger -r LJTeset.class
    이 문장을 수행하고 나면 다음과 같은 object가 생성된다.
    즉, load되는 java class외에도 2개의 테이블과 2개의 index, 그리고 한개의
    table이 생성된다.
    loadjava를 수행하는 user는 이러한 object를 생성할 수 있는 권한이 있어야한다.
    SQL> select object_name, object_type from user_objects;
    OBJECT_NAME OBJECT_TYPE
    CREATE$JAVA$LOB$TABLE TABLE
    LJTest JAVA CLASS
    JAVA$CLASS$MD5$TABLE TABLE
    SYS_C002172 INDEX
    SYS_C002173 INDEX
    SYS_LOB0000029869C00002$$ LOB
    loadjava후, 다시 dropjava문장을 다음과 같이 수행하는 경우, 이렇게 생성된
    6개의 object가 모두 사라지는 것이 아니고 LJTest만 지워지고 나머지는
    모두 그래도 남는다.
    os>dropjava -user scott/tiger LJTest.class
    즉, 일단 한번 loadjava를 수행하면 위에서 LJTest를 제외한 나머지 object는
    항상 존재하게 된다.
    2. loadjava시 다른 user가 java class이용할 수 있도록 하는 방법
    loadjava시 load된 java class를 이용하여 JSP를 생성한 owner에게 다음과 같은
    방법으로 권한을 부여할 수 있다.
    os>loadjava -user scott/tiger -g public -s -r LJTest.class
    os>loadjava -user scott/tiger -g eykim -s -r LJTest.class
    이때 -g option이 권한을 부여하기 위한 option이며, -s를 지정하면 동일한
    이름의 public synonym이 만들어져서 이 java class를 다른 schema에서도
    이용가능하게 된다.
    (NOTE) 이때, named PL/SQL에서 role을 통해 부여 받은 권한은 인식하지
    못하는 제약사항이 loadjava시에도 그대로 적용된다.
    즉, -g다음에 role명을 주는 경우 그 role을 가지고 있는 다른 user가
    해당 java class를 이용하여 JSP를 만드는 경우 해당 java class를
    인식하지 못하게 된다.
    loadjava외에 직접적으로 SQL문장을 통해 권한을 부여하여도 된다.
    SQL>grant execute on "LJTest" to scott;
    여기서 주의할 점은 반드시 LJTest java class를 지정할 때 큰 따옴표(" ")를
    표시하여야만 인식이 된다.
    이것은 grant뿐 아니고 sql문장에서 java class를 reference할 때 항상 적용된다.
    예를 들어 resolve시에 다음과 같이 하여야 한다.
    SQL>alter java class "DBTrigger" resolve;
    위의 loadjava 문장에서 -s option을 통해 public synonym을 생성하였는데,
    이것은 sql문장을 통해 synonym을 생성하여도 같은 결과이다.
    이때, user는 create public synonym권한을 가지고 있어야 한다.
    이후 dropjava 수행이 필요한 경우, dropjava시 -s option없이 public synonym도
    함께 drop되므로 drop public synonym도 필요하다.
    Reference Documents
    <Note:106753.1> ORA-29521 in Java Stored Procedure referencing Loaded Javax Classes
    Java Stored Procedures Developer's Guide Release 2 (8.1.6)", (A81358-01)

  • Unable to load mySql Driver in Java class invoked using bpelx:exec

    Hi ,
    I am trying to connect to mysql database in my java class.when i run this class in Jdeveloper it loads the driver without any problem.I can chk the log in the Jdev messages area.Now I am invoking this class from the BPEL process through <bpelx activity.But when i run my BPEL process it throws runtime exception "classNotFoundException:unable to load com.mysql.jdbc.Driver".I have set the project properties ->libraries to the class path of the mysql jar file as well.
    Now if i try to connect with the Oracle driver then it is working fine.
    I know this is a classpath issue.Can anyone tell me if there are some other settings to make it work fine.
    the java code :
    System.out.println("in getConnection method");
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    System.out.println("loaded Driver :");
    String url="jdbc:mysql://ntlv014:3306/wx";
    _jdbcConnection = DriverManager.getConnection(url,"development","ber1nger");
    System.out.println("Got Connection :"+_jdbcConnection.isClosed());                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I think you have 2 options..
    either put the jar for the mysql in the classpath on the server...or try something like this :
    http://forum.java.sun.com/thread.jspa?forumID=17&threadID=633158
    try to put the jar of the mysql into the suitecase of the bpel.
    never seen this coming around...so..it's just a wild guess.
    ORABPEL-11622 Could not create/access the TopLink Session
    spendem got the same situation...the puts the libraries in the applib-dir
    Message was edited by:
    Eric Elzinga (IT-Eye)

  • Unable to load Java classes from byte arrays.

    I have an application started through JWS. It works fine except for one problem. The application allows the user to load an external class, typically received over a socket. These are not (and cannot) be signed. My application complains about not being able to load these when starting through JWS. When starting the application locally (i.e., run the jar file using 'java -jar APP.jar') it works fine.
    I guess I have to grant som additional permissions in my policy-file. But since these classes are user-defined, there is no way for me to define a static codebase. `
    Any ideas?

    Java Web Start installs a SecurityManager, and after that is responsible for assigning permission collections to any code loaded by the JNLPCLassLoader.
    If you have all-permissions for your jnlp loaded code, then use another ClassLoader to load some other code, That other class loader will assign the permissions to that code. If that ClassLoader dosn't extend SecureClassLoader, the code will get only the default permissions.
    You can fix this by
    1.) Use a ClassLoader that extends SecureClassLoader, and override getPermissions(), or
    2.) just call System.setSecurityManager(null), from the trusted code loaded by the JNLPCLassLoader.
    /Dietz

  • OAAM 11g R2: Unable to load java class for custom configurable action

    Need to configure a Configurable Action to get triggered for a particular action at a given checkpoint.
    Steps Followed:
    1. Created a java class implementing com.bharosa.vcrypt.tracker.dynamicactions.intf.DynamicAction, getParameters() and execute() methods were implemented in that java class.
    2. Added necessary jars from $ORACLE_IDM_HOME\oaam\cli\lib to the build classpath.
    3. Compiled and created a jar with it.
    4. Extracted the oracle.oaam.extensions.war file into a working folder.
    5. Added the Custom Jar created in step 3 into <working folder>/WEB-INF/lib/
    6. Changed the following in MANIFEST.MF in <working folder>/META-INF/:
    Specification-Version:11.1.2.0.1
    Implementation-Version:11.1.2.0.1
    7. Rejar-ed the oracle.oaam.extensions.war from the working folder using following command:
    jar -cvfm oracle.oaam.extensions.war <working folder>\META-INF\MANIFEST.MF -C <working folder>/ .
    8. Stopped the oaam_admin_server1, oaam_offline_server1 and oaam_server_server1.
    9. Deleted the oracle.oaam.extensions deployment from the weblogic.
    10. Deployed the newly created oracle.oaam.extensions as a shared library for oaam_admin_server1 and oaam_server_server1.
    11. Started all managed servers.
    But when I tried to create an action template with the java class I just created, it was throwing following error
    +java.lang.ClassNotFoundException: *+
    Unable to load configurable action class *. Ensure the class is made available in the class path.
    Referred following documents:
    1.      http://docs.oracle.com/cd/E27559_01/admin.1112/e27207/cfgactions.htm
    2.     http://docs.oracle.com/cd/E27559_01/dev.1112/e27206/cfg-action.htm
    3.     http://docs.oracle.com/cd/E27559_01/dev.1112/e27206/extend.htm
    Kindly help me. Thanks in advance.
    Edited by: 917717 on Dec 12, 2012 7:16 PM

    This thread is a bit stale but I thought it might help to clarify one point about custom jar files on UCCX.
    To properly load a custom jar:
    Upload it into the classpath directory in the document repository. 
    Select it under System | Custom Classes Configuration
    Finally you need to restart the CCX Engine and the CCX Administration services.  If you have HA you need to restart them on both servers. 
    Other notes:
    When referencing your class in the CCX Editor, use the fully qualified name of the class.  Lots of other classes use things like Element or Document so you need to be explicit. The editor only knows about the 20 native classes by their object names.  If you create a Document object in the editor you are really creating a com.cisco.doc.Document object.  If you loaded jdom.jar and you wanted a jdom document then you need to create an object of type org.jdom.Document.
    When compiling your custom jar files, be sure to compile for the version of Java that the CCX Engine runs.  In general UCCX 7.X and older use Java 1.4.  UCCX 8.X and higher use Java 1.6.  Several of the core Java classes had significant changes between 1.4 and 1.6. If you ran your code on UCCX 7 or earlier and now it fails in UCCX 8.X or higher, recomplile for Java 1.6 and you classes will likely work again.
    Finally, check for security violations in UCCX 8.X or higher.  Cisco has restricted some of the things you can do.  These URL's have more information:
    http://docwiki.cisco.com/wiki/Engine
    http://docwiki.cisco.com/wiki/Troubleshooting_Tips_for_Unified_CCX_8.0
    -Steven
    Please help us make the communities better.  Rate helpful posts!

  • How to load a java class at server start-up

    Hi,
    I have one custome java class that is being referenced by all the applications deployed in OC4J container. How can I load that class automatically and be evailable in the path at server start-up time. Is there an option available to give the class name that also gets loaded automatically.
    Thanks

    To me, you have two mixed issues.
    1. OC4J supports a startup/shutdown model where a named class will be invoked when the container is started (or stopped).
    This is described in the doc here:
    http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28952/startclas.htm#CIHECEIB
    Note that this specifically calls the methods that are implemented from the respective OC4JShutdown and OC4JStartup interfaces -- the class that is instantiated and called here is not available to all other applications by default. This is more to suit the need where something needs to be done when the container is started/stopped.
    2 The next option is where you just want to make a class available to all applications deployed to the container. For this we provide the shared-library mechanism. Using this you can either make use of the implicit global.libraries shared-lib in which you simply drop JAR files into the j2ee/home/applib directory whereupon the classes will become available by default to all applications. Or you can choose to install a shared-library that contains your specific classes (in a JAR file) and then import that into the default application whereupon the configuration will be inherited by all deployed applications.
    cheers
    -steve-

  • How to load a java class when application is at first time browsed.

    Hi
    How can i load a simple java class on application startup.
    For servlet it could be done using "load on startup" tag in web.xml
    but how could the same be achieved for a simple java class.
    Thanks

    Hi
    Code is given below....
    package com;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class Test {
    Test()
         HttpServletRequest request=null;
         HttpServletResponse response=null;
         RequestDispatcher requestDispatcher = request.getRequestDispatcher("a.jsp");
         try {
              requestDispatcher.forward(request,response);
         } catch (ServletException e) {
              System.out.println("success");
              e.printStackTrace();
         } catch (IOException e) {
              System.out.println("success 1");
              e.printStackTrace();
         finally
              System.out.println("success 2");
         System.out.println("success 3");
    }Web.xml :
    <servlet>
            <servlet-name>simple</servlet-name>
            <servlet-class>com.Test</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
      <servlet-mapping>
          <servlet-name>simple</servlet-name>
          <url-pattern>/init.do</url-pattern>
        </servlet-mapping>Error Trace :
    org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /DispatcherTest threw load() exception
    java.lang.IllegalAccessException: Class org.apache.catalina.core.StandardWrapper can not access a member of class com.Test with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
         at java.lang.Class.newInstance0(Class.java:344)
         at java.lang.Class.newInstance(Class.java:303)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:925)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3857)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4118)
         at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1069)
         at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1162)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
         at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
         at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
         at java.lang.Thread.run(Thread.java:595)

  • Issue with class loading -  Java concurrent Program

    Hi ,
    We are facing a strange issue for one of our customer.
    Scenario :
    We have a Java Concurrent Program (A.java ) which refers another Java class (B.java) , we modified the file B.java for a fix and created a patch. after applying the patch and bouncing the apache ,we found that B.java is loaded the old version of the class file.
    We asked them to restart the concurrent manager and related services, still we see that old version of B.java is loaded. (confirmed by adding code throwing exception - throw new Exception from a specific line and found that its not getting thrown at run-time)
    Any clue on this?.
    Thanks
    Joseph George

    Deployed this file both tier - Database server tier and Application server tier.
    I have face same issue, Concurrent program not picking file application server tier. its picking file from database server tier.
    Thanks, Avaneesh

  • Error loading java class.

    I'm tryng to use a simple java class in internal jvm.
    When I try to load it I get a lot of error like :
    0/0 MailHandler:7: cannot resolve symbol
    0/0 symbol : class Folder
    0/0 location: package mail
    0/0 import javax.mail.Folder;
    What did I forget ?
    I'm using Oracle 10.2.0.3 and the required classes seems to be into correctly loaded.
    Tks
    Tullio

    Hi,
    Check whether the class is available in the schema or in the sys schema with a public synonym
    select dbms_java.longname(object_name) from user_objects;
    select dbms_java.longname(object_name) from all_objects;

Maybe you are looking for

  • How can I use a generic indifferently in one of the generic's member functions?

    I'm curious about the following situation: I'd like to access another generic's private member in a constructor. How can I do that irrespective of the generic's actual type? Here's a sample of what I'm trying to accomplish: public class C<T> private

  • CONFIGURE RETENTION POLICY TO REDUNDANCY 0

    Our database is 11g R2, below is our RMAN script Presently our retention policy is 1, so 1 backup is retained along with the current backup. I Just want to have 1 backup, i.e RMAN should take the backup and delete the old bacup. Will it work if i cha

  • Print reports directly in a local printer

    Hello buddies, Well, i wanna know if exists some way to print a reports directly in a local printer when using forms 9i ... the procedure built-in "PRINT", open a dialog box to choose the printer to send the printscreen... maybe exists a way to make

  • Viewing selected focus points from RAW file in Lr5 ?

    Why doesn't Lightroom have a plugin or option available to view the focus points that were used in the original photo? The info is stored in the metadata and shows up for in-camera photo review but it does not show up after  .nef file is converted to

  • Desinstalar un antivirus norton

    como desinstalar un antivirus norton mac edition dual protection