Control classpath in OC4J

I am building a JHeadstart application with ant instead of deployment profiles. The reason for this is to be independent on JDeveloper in the deployment process and to automate the build process. The application is to be deployed to an OC4J v10.1.3.3.0.
My ear structure something like this:
EAR
->     lib1.jar
->     lib2.jar
->     application_module.jar
->     web.war
->     webservice.war
With this we can easily switch the content of some utility classes in the lib jar files without redeploying the whole application.
In this process I have mimicked the jar/war/ear files produced by the deployment profiles in JDeveloper.
When deploying I have tried to use the Class-Path entry in the manifest.mf and changing orion-web-xml to use this path entry with no effect at all. I have tried to add the jar files to the classpath element of orion-web-xml with no success. Adding them to the web module of the application instance on the server with is the only thing that worked. But this is not an optimal solution as one must login to the enterprise manager every time there is a change in the classpath, thus having a manual routine on deployment.
On every other servlet or application container I have worked with this far, Weblogic, WebSphere, Jboss and Tomcat, I have been able to control the classpath in the manifest file. How can I achieve this on OC4J?
Regards
Atle

We are trying something similar. Followed this link http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-servlet-warmanifest.html. We tried several ways i.e adding <web-app-class-loader> entry at global-web-application.xml and orion-web.xml at module level but nothing worked.
Did anyone get any success in this?
Thanks,
Nitin

Similar Messages

  • Manifest Classpath Question oc4j.jar

    I need some clarification on how the MANIFEST.MF in the oc4j.jar library is influencing classlading. Below are my specific questions:
    My group is using a configuration management tool which stores all java libraries in a central repository. During builds the tool downloads all dependent libraries in basically a flat directory format and specifies a classpath to java when it runs its builds (and starts up OC4J via java com.evermind.server.OC4JServer). Is there anyway to override the Manifest.MF with the classpath constructed by our configuration management tool?
    In many cases libraries are entered in twice but are from different locations. i.e.
    ../../lib/xmlparserv2.jar
    ../../oracle/lib/xmlparserv2.jar
    Is there a difference between these two libraries?
    In the classloading sequence when does the classloader refer to the Manifest.MF for locations of libraries?
    Thanks in advance!
    -Mark

    Hi Mark,
    I'm sure I haven't understood your question, so the following may be useless to you (please excuse me if it is).
    I feel there is probably a better way to do what you are trying to do, but without more details, I can only guess.
    Do you know about the java extension mechanism?
    The tooldocs Web page has details of how the JVM locates classes.
    There are also some whitepapers and other documents that you can access from the OC4J home page at Oracle's Technet Web site.
    Good Luck,
    Avi.

  • ADF data control classpath issue

    Hi,
    when I am trying to create a jmx connection as part of adf jmx data control using jdeveloper 11.1.2.2.0.
    As part of jmx connection I am providing websphere server 9.7 fp25 connection (installed in the same machine) details and when I click on test connection in the data control wizard getting the following error
    Connection failed:
    java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]
    I guess it is a classpath issue. If it is, where can I provide the class path for data control? or something else I have to do?
    I found the above missing class is available in  /scratch/was/IBM/Websphere/AppServer/runtimes/com.ibm.ws.admin.client_7.0.0.jar
    Please suggest.
    thanks in advance,
    cdhar

    repost. Any pointers to documentation would be great!

  • OC4J - Adding jars to classpath

    Hi,
    Ive tried adding a new jar to oc4js classpath. Our application depends on this jar.
    I couldnt.
    Ive tried adding the jar as a 'library-path' tag within the server.xml. Then added it to the command line running oc4j ( -cp = .... ). It didnt do the trick.
    Ive only made some progress when putting it straight into oc4js lib directory.
    Im confused.
    1. What does the 'library-path' tab enable?
    2. Whats the difference between using it and supplying jars to the oc4js runtime classpath ( -cp ).
    3. What is the recommended way, to simply add a jar upon my application depends of?
    Any help would be apreceated,
    Yuval.

    HI Yuval,
    To include any Jar file in App server class path, you only have to copy the file in J2EE home\Lib\ folder. I also tried passing classpath to OC4J bUt to no use.
    But its working fine.
    Amit

  • OC4J "classpath+properties" issue

    Hi,
    Is any fix available for the OC4J classpath+properties issue?
    It can't find *.properties files even if it is in the classpath.
    It's not convenient to jar properties files and edit the manifest.mf file in orion.jar every time you want to add new file
    Thanks

    The classpath for the Oc4j is entirely different than what is normal classpath. If you start your oc4j with -jar option the system classpath will never get effected. If you want your properties files to be recognized keep under the possible classpaths. Oc4j takes every thing from lib directory so you can keep there.
    If you have an application you can add <library path=""/> tags to your application.xml and keep the properties files in that directory.
    If you have webapplication usually web-inf\lib added in classpath.

  • Problem with behavior of the Thread Context ClassLoader on OC4J 10.1.3.2.0

    Hi,
    We run into different behavior of the Thread Context ClassLoader on OC4J 10.1.3.1.0 (which is OK) and OC4J 10.1.3.2.0 (here we have problems). It appeared in the Threads directly and indirectly (e.g. through Timer) created by our application. Threads, created by OC4j (e.g. the Thread, where our start-up servlet are running) are OK.
    Thread Context ClassLoader (could be received from Thread.currentThread().getContextClassLoader()) on OC4J 10.1.3.1.0 in all threads is the same ClassLoader instance as the current ClassLoader (could be received from getClass().getClassLoader()). Actually the same is true for JBoss, WebLogic and WebSphere.
    Thread Context ClassLoader on OC4J 10.1.3.2.0 is NOT the same ClassLoader instance as the current ClassLoader, it is even the instance of the different Class. This ClassLoader does not see classes, available at application level, which causes multiple problems.
    Is it possible to configure OC4J 10.1.3.2.0 to behave similar to OC4J 10.1.3.1.0?
    We tried to use “–userThreads”, but it did not help.
    To investigate this problem we created a simple Web Application, which has Start-up Servlet, creates one thread and one Timer Task. From each point it is checking if Thread Context ClassLoader is the same ClassLoader instance as the current ClassLoader and printing Class Loaders if they are different. In addition it checks if correct parser accessed (should be xerces, which is in the Web App classpath and for which we added a shared library). Below you could see what we received on OC4J 10.1.3.1.0 (which is OK) and OC4J 10.1.3.2.0:
    E:\OracleAS_1\j2ee\home>java -Xms128m -Xmx1024m -jar oc4j.jar -userThreads
    07/04/30 10:33:00 Oracle Containers for J2EE 10g (10.1.3.1.0) initialized
    07/04/30 10:39:31 ------In StartupServlet Init-----
    07/04/30 10:39:31 +++++++ ++++++++++++++++++++++++++++++++++++ ++++++++
    07/04/30 10:39:31 +++++++ Executing Code in the StrtServlet... ++++++++
    07/04/30 10:39:31 +++++++ (this Thread created by App Server) +++++++++
    07/04/30 10:39:31 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/04/30 10:39:31 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/04/30 10:39:31 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/04/30 10:39:31 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@1908ba7>*******
    07/04/30 10:39:31 C O R R E C T !!!
    07/04/30 10:39:31 -CWD- =E:\OracleAS_1\j2ee\home; uer directory = E:\OracleAS_1\
    j2ee\home
    07/04/30 10:39:31 Constructing the Timer Task...
    07/04/30 10:39:31 Starting some Timer...
    07/04/30 10:39:31 Some Timer is started ...
    07/04/30 10:39:31 ------All actions done Successfully--------
    07/04/30 10:39:41 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/04/30 10:39:41 +++++++ Executing Code in the new Thread... ++++++++
    07/04/30 10:39:41 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/04/30 10:39:41 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/04/30 10:39:41 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/04/30 10:39:41 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@17e5e56>*******
    07/04/30 10:39:41 C O R R E C T !!!
    07/04/30 10:40:31 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/04/30 10:40:31 +++++++ Executing the Session Timer Task... ++++++++
    07/04/30 10:40:31 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/04/30 10:40:31 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/04/30 10:40:31 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/04/30 10:40:31 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@1c6988d>*******
    07/04/30 10:40:31 C O R R E C T !!!
    07/04/30 10:44:01 Shutting down OC4J...
    07/04/30 10:44:01
    E:\OracleAS_1\j2ee\home>
    C:\oc4j\j2ee\home>java -Xms128m -Xmx1024m -classpath .;oc4j.jar;C:\oc4j\j2ee\hom
    e\properties -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socke
    t,address=3999,server=y,suspend=n -jar oc4j.jar -userThreads
    07/05/01 21:14:33 ------In StartupServlet Init-----
    07/05/01 21:14:33 +++++++ ++++++++++++++++++++++++++++++++++++ ++++++++
    07/05/01 21:14:33 +++++++ Executing Code in the StrtServlet... ++++++++
    07/05/01 21:14:33 +++++++ (this Thread created by App Server) +++++++++
    07/05/01 21:14:33 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:33 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <TestLoaders.web.TestLoaders:0.0.0>*******<class oracle.classloader
    .PolicyClassLoader
    07/05/01 21:14:33 ******* THE SAME CLASSLOADER USED IN BOTH PLACES!!! *******
    07/05/01 21:14:33 DocumentBuilderFactory = <org.apache.xerces.jaxp.DocumentBuild
    erFactoryImpl@723c42>*******
    07/05/01 21:14:33 C O R R E C T !!!
    07/05/01 21:14:33 -CWD- =C:\oc4j\j2ee\home; uer directory = C:\oc4j\j2ee\home
    07/05/01 21:14:33 Constructing the Timer Task...
    07/05/01 21:14:33 Starting some Timer...
    07/05/01 21:14:33 Some Timer is started ...
    07/05/01 21:14:33 ------All actions done Successfully--------
    07/05/01 21:14:33 Oracle Containers for J2EE 10g (10.1.3.2.0) initialized
    07/05/01 21:14:43 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/05/01 21:14:43 +++++++ Executing Code in the new Thread... ++++++++
    07/05/01 21:14:43 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:43 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <[ThreadContextLoader, current context: TestLoaders.web.TestLoaders
    :0.0.0]>*******<class com.evermind.server.ApplicationContextClassLoader
    07/05/01 21:14:43 ******************************************************
    07/05/01 21:14:43 Chain of ClassLoaders from Class
    07/05/01 21:14:43 --- TestLoaders.root:0.0.0 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:14:43 --- default.root:0.0.0 --- class oracle.classloader.PolicyCla
    ssLoader
    07/05/01 21:14:43 --- system.root:0.0.0 --- class oracle.classloader.PolicyClas
    sLoader
    07/05/01 21:14:43 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:14:43 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:43 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:14:43 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:14:43 --- null ---
    07/05/01 21:14:43 ********** End of Chain of ClassLoaders **************
    07/05/01 21:14:43 ******************************************************
    07/05/01 21:14:43 Chain of ClassLoaders from Thread
    07/05/01 21:14:43 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:14:43 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:14:43 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:14:43 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:14:43 --- null ---
    07/05/01 21:14:43 ********** End of Chain of ClassLoaders **************
    07/05/01 21:14:43 DocumentBuilderFactory = <oracle.xml.jaxp.JXDocumentBuilderFac
    tory@74a138>*******
    07/05/01 21:14:43 WRONG !!! Should be org.apache.xerces.jaxp.DocumentBuilderFact
    oryImpl
    07/05/01 21:15:33 +++++++ +++++++++++++++++++++++++++++++++++ ++++++++
    07/05/01 21:15:33 +++++++ Executing the Session Timer Task... ++++++++
    07/05/01 21:15:33 ClassLoaders: fromClass = getClass().getClassLoader() = <TestL
    oaders.web.TestLoaders:0.0.0>*******<class oracle.classloader.PolicyClassLoader
    07/05/01 21:15:33 fromThread =Thread.currentThread().getContextCla
    ssLoader() = <[ThreadContextLoader, current context: TestLoaders.web.TestLoaders
    :0.0.0]>*******<class com.evermind.server.ApplicationContextClassLoader
    07/05/01 21:15:33 **************************************************
    07/05/01 21:15:33 Chain of ClassLoaders from Class
    07/05/01 21:15:33 --- TestLoaders.root:0.0.0 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:15:33 --- default.root:0.0.0 --- class oracle.classloader.PolicyCla
    ssLoader
    07/05/01 21:15:33 --- system.root:0.0.0 --- class oracle.classloader.PolicyClas
    sLoader
    07/05/01 21:15:33 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:15:33 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:15:33 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:15:33 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:15:33 --- null ---
    07/05/01 21:15:33 ********** End of Chain of ClassLoaders **********
    07/05/01 21:15:33 **************************************************
    07/05/01 21:15:33 Chain of ClassLoaders from Thread
    07/05/01 21:15:33 --- oc4j:10.1.3 --- class oracle.classloader.PolicyClassLoade
    r
    07/05/01 21:15:33 --- api:1.4.0 --- class oracle.classloader.PolicyClassLoader
    07/05/01 21:15:33 --- jre.extension:0.0.0 --- class oracle.classloader.PolicyCl
    assLoader
    07/05/01 21:15:33 --- jre.bootstrap:1.4.2_08 --- class oracle.classloader.Polic
    yClassLoader
    07/05/01 21:15:33 --- null ---
    07/05/01 21:15:33 ********** End of Chain of ClassLoaders **********
    07/05/01 21:15:33 DocumentBuilderFactory = <oracle.xml.jaxp.JXDocumentBuilderFac
    tory@1d12d43>*******
    07/05/01 21:15:33 WRONG !!! Should be org.apache.xerces.jaxp.DocumentBuilderFact
    oryImpl
    Any help will be greatly appreciated.
    Thanks

    Sorry for confusion, version of OC4J does not really meter, but jdk does. It happened that in the case where everything OK (OC4J 10.1.3.1.0) I accidentally used jdk 1.5. Now I tried both (OC4J 10.1.3.1.0 and OC4J 10.1.3.2.0) with j2sdk1.4.2_14 (besides I tried j2sdk1.4.2_09 and _08) and j2sdk1.5.0_06.
    With JDK 1.5 everything is OK and with JDK 1.4 we have a problem, described in the previous posting. I believe now I should reformulate my initial question:
    Is it possible to configure OC4J 10.1.3 running under j2sdk1.4.2_14 to force Thread Context ClassLoader to behave similar to OC4J 10.1.3 under j2sdk1.5.0_06? If yes, how we could do it?
    Thanks

  • How to Starting and Stopping OC4J Server using Ant

    How to Starting and Stopping OC4J Server using Ant
    In the ant task definitions for ant-oracle-classes.jar (see antlib.xml) there are two tasks called
         name="restartServer" classname="oracle.ant.taskdefs.deploy.JSR88StartServer"
         name="shutdownServer" classname="oracle.ant.taskdefs.deploy.JSR88ShutdownServer"
    I thought that these would shutdown and start the OC4J server. I guessed the parameters as – (Does anyone know where 50 ant targets are documented?)
    <oracle:restartServer
    userid="${oc4j.admin.user}"
         password="${oc4j.admin.password}"
         deployeruri="${deployer.uri}"
    />
    <oracle:shutdownServer
         userid="${oc4j.admin.user}"
         password="${oc4j.admin.password}"
         deployeruri="${deployer.uri}"
    />
    This, however does not start and stop the SOA suite. To do that I've hacked this solution together -
    <path id="oc4j.console">
         <pathelement location="${oracle.home}/config"/>
         <pathelement location="${oracle.home}/jlib/startupconsole.jar"/>
         <pathelement location="${oracle.home}/opmn/lib/optic.jar"/>
         <pathelement location="${oracle.home}/lib/xmlparserv2.jar"/>
    </path>
    <target name="stop" description="stop oc4j server" depends="init">
         <java classname="oracle.appserver.startupconsole.view.Runner">
              <classpath refid="oc4j.console"/>
              <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
              <arg value="stop"/>
         </java>
    </target>
    <target name="start" description="restart oc4j server" depends="init">
         <java classname="oracle.appserver.startupconsole.view.Runner">
              <classpath refid="oc4j.console"/>
              <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
              <arg value="start"/>
         </java>
    </target>
    This sort of works – except when the SOA suite doesn't stop cleanly – and needs user interaction to press a Close button. This isn't very useful when doing a continous integration build and deploy.
    So, does anyone have any suggestions or alternative methods to do this?
    - frank

    Actually if the server throws exceptions when it stops (which it always has since we applied patch 10.1.3.3) this technique will pause until a user responds to pop-up ... So a better way (I think) is -
    <target name="start" description="start oc4j server" depends="init">
    <java classname="oracle.appserver.startupconsole.view.Runner">
    <classpath refid="oc4j.console"/>
    <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
    <arg value="start"/>
    </java>
    </target>
    <target name="stop" description="stop oc4j server" depends="init">
    <echo message="We expect OC4J *NOT* to stop cleanly, so we will timeout after 3 minutes ..."/>
    <java classname="oracle.appserver.startupconsole.view.Runner" fork="true" timeout="180000">
    <classpath refid="oc4j.console"/>
    <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
    <arg value="stop"/>
    </java>
    </target>
    <target name="restart" description="restart oc4j server">
    <antcall target="stop"/>
    <!-- wait for server to quieten down -->
    <waitfor maxwait="2" maxwaitunit="minute">
    <not><http url="http://${oc4j.http.hostname}:${oc4j.http.port}"/></not>
    </waitfor>
    <antcall target="start"/>
    </target>

  • How to set boot classpath

    Hi Team,
    How do I set the java environment variable boot classpath (not classpath) in oc4j??
    Any pointers will be greatly appreciated.
    Thanks.

    Try this:
    java -Xbootclasspath/YOUR_PATH -jar oc4j.jar

  • Classpath for JMS standalone client

    Hi,
    I observed some problem, when I try to start my JMS client application. If in classpath is oc4j.jar it works, but when I replace oc4j.jar with oc4jclient.jar doesn't
    I notice the message:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/evermind/server/jms/EvermindXAConnectionFactory
    at com.evermind.server.jms.ConnectInfo.getPass(ConnectInfo.java:98)
    at com.evermind.server.jms.EvermindTopicConnectionFactory.createTopicCon
    nection(EvermindTopicConnectionFactory.java:83)
    at sapconnector.MaterialMoverClient.main(MaterialMoverClient.java:52)
    the line no. 52 exactly means:
    TopicConnection connection = factory.createTopicConnection();
    What the OC4J client jar (oc4jclient.jar) is not enough for starting JMS standalone client?
    regards
    Krzysztof

    Hi, thanks for the reply.
    Well, I figured out that problem. It was my jar file. One of the jar file, which is imqjmsra.jar wasn't really the right one and that was giving me the problem. Well, at least that is working not, but I am having new problems.
    Right, I have been trying to make this work for about three days now. The truth is that my standalone JMS does work, when it is running on the same machine where the J2EE Server is located, but I am trying to make my JMS standalone client to connect to J2EE server from different location. Now I am getting connection refused error. Well, I guess I will be keep trying util I get this working.

  • OPMN Controlling Multiple Oracle Home Processes

    OK,
    Have OC4J,HTTP in a 10.1.3 Oracle Home.
    Have Webcache in a 10.1.2 Oracle Home.
    GOAL: opmnctl <start|stop> controls all processes (OC4J, HTTP Server, 10.1.2 Webcache).
    Is it possible to have 10.1.3 OPMN control the webcache process in the 10.1.2 Oracle Home? Would this be implemented via OPMN's custom process fuctionality or some ONS/OPMN discovery mechanism?
    Thanks,
    KB

    Interesting how OPMN claims to support Grid computing but it can't (in a supported manner) support processes in multiple OHs ON THE SAME BOX! I guess I'll build a shell script.
    And yes, opmnctl is working in both the OHs.
    KB

  • IBFBS Example on OC4J

    This I have installed on OC4j. While doing transation it is giving that transaction is done. But on portfolio or transaction listing it is not reflecting any transaction.
    Anybody may help me.
    Chittaranjan Mohapatra

    Are you running on a Windows OS? I had the same problem recently and it was fixed by changing the build.xml in the demo to be more Windows friendly. At you need to change the classpath to use semicolons instead of colons as seperators:
    <target name="run-demo" depends="init">
    <exec executable="java" >
         <arg line=" -classpath
         ${J2EE_HOME}/oc4j.jar;${J2EE_HOME}/lib/jndi.jar;build;build/META-INF ${demo.name}
         ${PQINFO} ${nmsg}" />
    </exec>
    </target>
    I think that's it.
    Now good luck trying to figure out how to write your own JMS client and server applications, especially using point-to-point queues. Oracle docs can certainly be lacking at times...

  • Trouble running adf/jsp application in jdev 11G

    Hello ,
    I have just installed Jdev 11g on Win XP SP 2.
    Everything looks good, but when I try to run *.jspx file I am getting following error message:
    I appreciate any help.
    Thanks
    C:\JDev1111\jdk\bin\javaw.exe -client -classpath O:\OC4J\j2ee\home\oc4j.jar;C:\JDev1111\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -XX:MaxPermSize=256m -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config "\\win.desy.de\home\martir\Application Data\JDeveloper\system11.1.1.0.17.45.24\o.j2ee\embedded-oc4j\config\server.xml"
    [waiting for the server to complete its initialization...]
    Could not canonicalize 'ðˆúwPõwÿÿÿÿ' (The filename, directory name, or volume label syntax is incorrect). From system property java.library.path.
    Could not canonicalize 'ðˆúwPõwÿÿÿÿ' (The filename, directory name, or volume label syntax is incorrect). From system property java.library.path.
    07/08/31 10:26:12 java.io.IOException: The system cannot find the path specified
    07/08/31 10:26:12      at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    07/08/31 10:26:12      at java.io.File.createNewFile(File.java:850)
    07/08/31 10:26:12      at oracle.security.jazn.spi.xml.XMLJAZNProvider.getJAZNDataXMLDoc(XMLJAZNProvider.java:250)
    07/08/31 10:26:12      at oracle.security.jazn.spi.xml.XMLJAZNProvider.parseDataFile(XMLJAZNProvider.java:377)
    07/08/31 10:26:12      at oracle.security.jazn.spi.xml.XMLJAZNProvider.getRealmManager(XMLJAZNProvider.java:480)
    07/08/31 10:26:12      at oracle.security.jazn.spi.GenericProvider.getRealmManager(GenericProvider.java:143)
    07/08/31 10:26:12      at oracle.security.jazn.JAZNConfig.getRealmManager(JAZNConfig.java:997)
    07/08/31 10:26:12      at oracle.security.jazn.oc4j.JAZNUserManager.getUMType(JAZNUserManager.java:5156)
    07/08/31 10:26:12      at oracle.security.jazn.oc4j.JAZNUserManager.getUM(JAZNUserManager.java:5208)
    07/08/31 10:26:12      at oracle.security.jazn.oc4j.JAZNUserManager.<init>(JAZNUserManager.java:5245)
    07/08/31 10:26:12      at com.evermind.server.deployment.UserManagerConfig$JAZN.construct(UserManagerConfig.java:626)
    07/08/31 10:26:12      at com.evermind.server.deployment.UserManagerConfig.delegatee(UserManagerConfig.java:289)
    07/08/31 10:26:12      at com.evermind.server.deployment.UserManagerConfig.ultimate(UserManagerConfig.java:329)
    07/08/31 10:26:12      at com.evermind.server.deployment.EnterpriseArchive.generateDefaultUserManagerSettings(EnterpriseArchive.java:1189)
    07/08/31 10:26:12      at com.evermind.server.deployment.EnterpriseArchive.initDefaultSettings(EnterpriseArchive.java:1284)
    07/08/31 10:26:12      at com.evermind.server.deployment.EnterpriseArchive.<init>(EnterpriseArchive.java:294)
    07/08/31 10:26:12      at com.evermind.server.XMLApplicationServerConfig.parseApplicationConfigReference(XMLApplicationServerConfig.java:2125)
    07/08/31 10:26:12      at com.evermind.server.XMLApplicationServerConfig.sortApplicationConfigReferences(XMLApplicationServerConfig.java:2859)
    07/08/31 10:26:12      at com.evermind.server.XMLApplicationServerConfig.postInitApplications(XMLApplicationServerConfig.java:2877)
    07/08/31 10:26:12      at com.evermind.server.XMLApplicationServerConfig.postInit(XMLApplicationServerConfig.java:290)
    07/08/31 10:26:12      at com.evermind.xml.XMLConfig.init(XMLConfig.java:206)
    07/08/31 10:26:12      at com.evermind.xml.XMLConfig.init(XMLConfig.java:113)
    07/08/31 10:26:12      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:89)
    07/08/31 10:26:12      at java.lang.Thread.run(Thread.java:595)
    Aug 31, 2007 10:26:12 AM com.evermind.server.XMLDataSourcesConfig parseRootNode
    INFO: Legacy datasource detected...attempting to convert to new syntax.
    07/08/31 10:26:12 Error parsing application-server config file: Invalid usermanager configuration.
    07/08/31 10:26:12 oracle.security.jazn.JAZNRuntimeException: Invalid usermanager configuration.
    07/08/31 10:26:12      at oracle.security.jazn.oc4j.DelegateUserManager.checkForParent(JAZNUserManager.java:3255)
    07/08/31 10:26:12      at oracle.security.jazn.oc4j.DelegateUserManager.getAdminUser(JAZNUserManager.java:3279)
    07/08/31 10:26:12      at oracle.security.jazn.oc4j.FilterUserManager.getAdminUser(JAZNUserManager.java:4899)
    07/08/31 10:26:12      at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    07/08/31 10:26:12      at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    07/08/31 10:26:12      at com.evermind.server.XMLApplicationServerConfig.setPassword(XMLApplicationServerConfig.java:2981)
    07/08/31 10:26:12      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:95)
    07/08/31 10:26:12      at java.lang.Thread.run(Thread.java:595)
    07/08/31 10:26:12 Fatal error: server exiting
    Process exited with exit code 1.

    Hello Ric,
    Thanks for the response,
    I have tried to set environment vars, but it was unsuccessful.
    I have the old version of Jdev 10.1.3 and it's working with the message "Could not canonicalize ...."
    I have found the following thread in forum:
    Unable to start any application
    The system11.1.1.0.17.45.24 directory is on the network drive:
    H:\Application Data\JDeveloper\system11.1.1.0.17.45.24\o.j2ee\embedded-oc4j\applications\dms.war
    and not on the:
    H:\Application Data\JDeveloper\system11.1.1.0.17.45.24\o.j2ee\home\applications\dms.war
    I am not sure, but it seems to be the same problem with the embedded OC4J and dms.war, as discussed in the thread
    mentioned above.
    Thanks.

  • [b]EJB Hotel RA Client Error - HELP[/b]

    1. Travel schema installed fine
    2. Web Client can successfully be run and all the buttons
    work fine
    3. The only file I modified was in config properties.
    Provider_Url = ormi://localhost:8888/OneEJBHotel
    4. in oc4j directory: principals file:
    user id is "admin", and password was given as
    "admin"
    4. deployment from jdeveloper is fine as follows:
    ---- Deployment started. ---- Jan 24, 2003 6:24:08 PM
    Wrote EJB JAR file to C:\oc4j\samples\ejb\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel.jar
    Wrote WAR file to C:\oc4j\samples\ejb\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel-Web.war
    Wrote EAR file to C:\oc4j\samples\ejb\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel-Web.ear
    Invoking OC4J admin tool...
    C:\jdeveloper\jdk\jre\bin\javaw.exe -jar C:\jdeveloper\j2ee\home\admin.jar ormi://DLEE/ admin **** -deploy -file C:\oc4j\samples\ejb\OneEJBHotel\src\oracle\otnsamples\OneEJBHotel\OneEJBHotel-Web.ear -deploymentName OneEJBHotel
    Auto-unpacking C:\oc4j\j2ee\home\applications\OneEJBHotel-Web.ear... done.
    Auto-unpacking C:\oc4j\j2ee\home\applications\OneEJBHotel-Web\OneEJBHotel-Web.war... done.
    Copying default deployment descriptor from archive at C:\oc4j\j2ee\home\applications\OneEJBHotel-Web/META-INF/orion-application.xml to deployment directory C:\oc4j\j2ee\home\application-deployments\OneEJBHotel...
    Auto-deploying OneEJBHotel (New server version detected)...
    Exit status of OC4J admin tool (-deploy): 0
    C:\jdeveloper\jdk\jre\bin\javaw.exe -jar C:\jdeveloper\j2ee\home\admin.jar ormi://DLEE/ admin **** -bindWebApp OneEJBHotel OneEJBHotel-Web http-web-site /OneEJBHotel
    Exit status of OC4J admin tool (-bindWebApp): 0
    Use the following context root(s) to test your web application(s):
    http://DLEE:8888/OneEJBHotel
    Elapsed time for deployment: 14 seconds
    ---- Deployment finished. ---- Jan 24, 2003 6:24:22 PM
    5. System Configuation
    jdeveloper: 9.0.3.1035
    DB: oracle 92010
    oc4j: 9.0.3.0.0
    6. When run from jdeveloper client: run Client.jpr
    the following errors were generated:
    Process exited with exit code 0.
    C:\jdeveloper\jdk\bin\javaw.exe -ojvm -classpath C:\oc4j\samples\ejb\OneEJBHotel\src\classes;C:\oc4j\samples\ejb\OneEJBHotel\config;C:\oc4j\samples\ejb\OneEJBHotel;C:\oc4j\samples\ejb\OneEJBHotel\src\web;C:\jdeveloper\jdev\lib\jdev-rt.jar;C:\jdeveloper\j2ee\home\lib\activation.jar;C:\jdeveloper\j2ee\home\lib\ejb.jar;C:\jdeveloper\j2ee\home\lib\jaas.jar;C:\jdeveloper\j2ee\home\lib\jaxp.jar;C:\jdeveloper\j2ee\home\lib\jcert.jar;C:\jdeveloper\j2ee\home\lib\jdbc.jar;C:\jdeveloper\j2ee\home\lib\jms.jar;C:\jdeveloper\j2ee\home\lib\jndi.jar;C:\jdeveloper\j2ee\home\lib\jnet.jar;C:\jdeveloper\j2ee\home\lib\jsse.jar;C:\jdeveloper\j2ee\home\lib\jta.jar;C:\jdeveloper\j2ee\home\lib\mail.jar;C:\jdeveloper\j2ee\home\oc4j.jar oracle.otnsamples.OneEJBHotel.client.EJBHotelSample
    javax.naming.NamingException: Lookup error: java.io.IOException: Server protocol was not ORMI, if uncertain about the port your server uses for ORMI then use the default, 23791; nested exception is:
         java.io.IOException: Server protocol was not ORMI, if uncertain about the port your server uses for ORMI then use the default, 23791
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void oracle.otnsamples.OneEJBHotel.client.EJBHotelSample.getHotelSystemBean()
              EJBHotelSample.java:132
         void oracle.otnsamples.OneEJBHotel.client.EJBHotelSample.main(java.lang.String[])
              EJBHotelSample.java:147
    Process exited with exit code 0.
    Thanks for help!
    David

    David,
    config.properties is used only by the client.jpr. Not by the Web.jpr
    config.properties file has been provided for looking up resources[EJB, Datasources] from JNDI tree of OC4J.
    Since servlet and other resources are in the same container[Single JVM] there is no need to specify the username, password, Provdier_URL at the time of lookup.
    Look at the init method of EJBHotelServlet.java :
    Context ctx = new InitialContext();
    // Acquire the home interface handle and call the create
    //method on it
    homeInterface = (HotelSystemHome)ctx.lookup("OneEJBHotel");
    Here servlet looks up EJB without any authentication information, as servlet and EJB are in the same container.
    Whereas Stand alone client is running outside the OC4J.
    So the stand alone client need to authentcate itself for looking up the resources from JNDI tree.
    Look at the getHotelSystemBean method of EJBHotelSample.java :
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, prop.getProperty("Initial_Context_Factory"));
    env.put(Context.SECURITY_PRINCIPAL, prop.getProperty("Principal"));
    env.put(Context.SECURITY_CREDENTIALS, prop.getProperty("Credential"));
    env.put(Context.PROVIDER_URL, prop.getProperty("Provider_Url") );
    // Associate the properties with the context
    Context ctx = new InitialContext(env);
    // Acquire the home interface handle and call the create
    //method on it
    homeInterface = (HotelSystemHome)ctx.lookup("OneEJBHotel");
    Here stand alone client looks up EJB by specifying the authentication information, as stand alone client and EJB are running in different JVM's.
    Hope this helps...
    Cheers
    --Venky                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Do I have to use opmn:ormi in the JNDI Service Provider URL?

    Trying to create a new Enterprise Message Source (JMS) and it's not updating the Data Object. Tested the OC4J queue using a Java POJO listener ... sending and receiving text message seems okay. I created a basic Plan (there's only one data element for now) and it is running.
    Any suggestions would be appreciated!

    Here is a document from Ranga on how to connect BAM to OJMS (hope it helps):
    Database Trigger - OJMS - BAM Integration Sample
    Last updated 07/27/05 Ranga
    OJMS setup
    Step 1 - Oc4j setup
    •     Install Standalone/Developer 10g OC4J or production version Application server.
    Developer version download -http://www.oracle.com/technology/software/htdocs/devlic.html?/technology/software/products/ias/htdocs/utilsoft.html#1012 or from http://bamqa.us.oracle.com/bamqaWiki/attach?page=Downloads%2Foc4j1012_extended.zip
    •     Modify following configuration files
    o     Add entry in <OC4J_Install_location>\j2ee\home\config\data-sources.xml for your database, use below sample replacing HOST, PORT and SERVICE_NAME in url tag
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="TTTDS"
    location="jdbc/OracleTTTDS"
    xa-location="jdbc/xa/OracleXaBamDS"
    ejb-location="jdbc/OracleEjbBamDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=tcp)(HOST=stank04)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=db10g)))"
    inactivity-timeout="30"
    />
    o     Add a resource provider entry in <OC4J_Install_location>\j2ee\home\config\application.xml
    <resource-provider name="BAMTTT" class="oracle.jms.OjmsContext">
    <description>BAM for Generic</description>
    <property name="datasource" value="jdbc/OracleTTTDS"/>
    </resource-provider>
    Step 2 - Database setup
    •     Install 10g or 9i database, below steps will setup AQ in sample schema scott.
    •     Connect to database as sys and grant AQ permissions to scott user
    connect sys/welcome1@db10g as sysdba
    grant SELECT_CATALOG_ROLE to scott;
    GRANT EXECUTE ON DBMS_APPLY_ADM TO scott;
    GRANT EXECUTE ON DBMS_AQ TO scott;
    GRANT EXECUTE ON DBMS_AQADM TO scott;
    GRANT EXECUTE ON DBMS_CAPTURE_ADM TO scott;
    GRANT EXECUTE ON DBMS_FLASHBACK TO scott;
    GRANT EXECUTE ON DBMS_STREAMS_ADM TO scott;
    execute dbms_aqadm.grant_system_privilege('ENQUEUE_ANY', 'scott', TRUE);
    grant aq_administrator_role to scott;
    grant execute on dbms_lock to scott;
    grant execute on sys.dbms_aqin to scott;
    grant execute on sys.dbms_aqjms to scott;
    •     Connect to database as scott user and create AQ
    connect scott/tiger@db10g
    execute dbms_aqadm.stop_queue( queue_name => 'bam_ttq' );
    execute dbms_aqadm.drop_queue( queue_name => 'bam_ttq');
    execute DBMS_AQADM.DROP_QUEUE_TABLE (queue_table => 'bam_ttq_tab');
    execute dbms_aqadm.create_queue_table( queue_table => 'bam_ttq_tab', queue_payload_type => 'sys.aq$_jms_text_message', multiple_consumers => true );
    execute dbms_aqadm.create_queue( queue_name => 'bam_ttq', queue_table => 'bam_ttq_tab' );
    execute dbms_aqadm.start_queue( queue_name => 'bam_ttq' );
    Database Trigger setup
    Run the following sql connected to database as scott user, it creates a trigger on EMP table.
    create or replace trigger send_recs_Employee AFTER INSERT OR Update ON EMP
    FOR each row
    declare
    xml_complete varchar2(8000);
    v_enqueue_options dbms_aq.enqueue_options_t;
    v_message_properties dbms_aq.message_properties_t;
    v_msgid raw(16);
    temp sys.aq$_jms_text_message;
    v_recipients dbms_aq.aq$_recipient_list_t;
    Begin
    temp:=sys.aq$_jms_text_message.construct;
    v_recipients(1) := sys.aq$_agent('istante',null,0);
    v_recipients(2) := sys.aq$_agent('test',null,0);
         v_message_properties.recipient_list := v_recipients;
    xml_complete :=
              '<?xml version="1.0"?><row>' ||
              '<EMPNO>' || :new.EMPNO || '</EMPNO>' ||
              '<ENAME>' || :new.ENAME || '</ENAME>' ||
              '<JOB>' || :new.JOB || '</JOB>' ||
              '<MGR>' || :new.MGR || '</MGR>' ||
              '<HIREDATE>' || :new.HIREDATE || '</HIREDATE>' ||
              '<SAL>' || :new.SAL || '</SAL>' ||
              '<COMM>' || :new.COMM || '</COMM>' ||
              '<DEPTNO>' || :new.DEPTNO || '</DEPTNO>' ||
              '</row>' ;
              temp.set_text(xml_complete);
    dbms_aq.enqueue(queue_name => 'bam_ttq',
              enqueue_options => v_enqueue_options,
              message_properties => v_message_properties,
              payload => temp,
              msgid => v_msgid );
    End ;
    BAM Setup
    •     Administrator - Fix the classpaths for oc4j jar files for Oracle (AS JMS and OJMS) Message source type using the OC4J_Install_location. If you are using production App Server you need to add extra classpath entry <App Server Location>\opmn\lib\optic.jar
    •     Architect - Create a new Enterprise message source of type Oracle (AS JMS and OJMS)
    Initial Context Factory:      com.evermind.server.rmi.RMIInitialContextFactory
    JNDI Service Provider URL:      o     For Standalone oc4j: ormi://machine name/
    Where machine name is OC4J installed host
    o     For Production App Server: opmn:ormi://<machine name>:<opmn request port>:home
    Where machine name is App server installed host, opmn request port could be found from looking at opmn.xml in <App server install location>/opmn/conf
    TopicConnectionFactory Name:      java:comp/resource/BAMTTT/TopicConnectionFactories/bam_ttq_tab
    Topic Name:      java:comp/resource/BAMTTT/Topics/bam_ttq
    JMS Message Type:      TextMessage
    Durable Subscriber Name (Optional):      Istante
    Message Selector (Optional):      
    Client ID (Optional):      ClientID
    Name     Flow name     Type     Max size     Formatting
    row.     row.     String     4000     (none).
    •     Enterprise Link Design Studio – create a basic plan with
    o     Oracle BAM Enterprise Message Receiver, selecting the message source you created in above step.
    o     Display sink Grid
    •     Create file jndi.properties in C:\Program Files\Oracle BAM\j2re1.4.1_01\lib with entries
    java.naming.security.principal=admin
    java.naming.security.credentials=welcome1 (App server/Oc4j password)
    Running
    •     Start OC4J
    •     To enqueue messages update or insert records in EMP table connected to database as scott user
    Insert into emp values (&empno,'FORD','ANALYST',7566,sysdate,60000,3000,20);
    •     Run update on the enterprise plan
    In above sample no parsing of the data is done, its got as one single string.
    OJMS setup
    Configuring JMS
    http://www.oracle.com/technology/books/pdfs/2352_Ch06_FINAL.pdf
    Oracle® Application Server Containers for J2EE Services Guide 10g Release 2 (10.1.2) for Windows or UNIX
    http://iasdocs/iasdl/101200doc/web.1012/b14012/toc.htm

  • Javax.mail.message.recipienttype not found

    Hi,
    I use jdev10g and i want to send a mail message.
    Here's a little snip of my class for sending a mail.
    Jdeveloper gives me a error about Message.RecipientType.TO.
    "Member 'RecipientType' not found in javax.mail.Message"
    import javax.mail.Message;
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    I've installed the javamail-1.1.3 API.
    In my project properties -> libraries, i've added this library with the correct path to the jar file.
    I'm sure that this API have this Message class.
    What is going wrong, have i missed something ???
    Greetings,
    Peter

    Hi! Srikanth,
    1. I checked MailerEJB.deploy under "Dependency Analyzer",
    I checked activation.jar and mail.jar under the J2EE node.
    I did the same for the MailerJSP.deploy.
    2. I used same jdeveloper version and jdk 1.3.1_06.
    3. I did a clean deploy for the ejb and mailerjsp.deploy
    4. I recompiled and run the jpr,
    from the message window, I got:
    C:\jdeveloper\jdk\bin\javaw.exe -ojvm -classpath C:\oc4j\samples\ejb\EJBCallsJSP\classes;C:\oc4j\samples\ejb\EJBCallsJSP;C:\jdeveloper\jdev\lib\jdev-rt.jar;C:\jdeveloper\j2ee\home\lib\activation.jar;C:\jdeveloper\j2ee\home\lib\ejb.jar;C:\jdeveloper\j2ee\home\lib\jaas.jar;C:\jdeveloper\j2ee\home\lib\jaxp.jar;C:\jdeveloper\j2ee\home\lib\jcert.jar;C:\jdeveloper\j2ee\home\lib\jdbc.jar;C:\jdeveloper\j2ee\home\lib\jms.jar;C:\jdeveloper\j2ee\home\lib\jndi.jar;C:\jdeveloper\j2ee\home\lib\jnet.jar;C:\jdeveloper\j2ee\home\lib\jsse.jar;C:\jdeveloper\j2ee\home\lib\jta.jar;C:\jdeveloper\j2ee\home\lib\mail.jar;C:\jdeveloper\j2ee\home\oc4j.jar;C:\jdeveloper\jdbc\lib\classes12.jar;C:\jdeveloper\jdbc\lib\nls_charset12.jar oracle.otnsamples.ejbcallsjsp.mailclient.MailClientSample
    I didn't see any error from this message window.
    5. The no provider for smtp error is prompted from the mail client.
    From above settings and running the application, I couldn't figure out where the error was coming from ?
    Thanks
    David

Maybe you are looking for