Thread: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3


Permlink Replies: 25 - Pages: 2 [ 1 2 | Next ] - Last Post: Jul 11, 2008 7:55 AM Last Post By: Stijn Haus
Farbod

Posts: 252
Registered: 09/03/06
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Nov 30, 2007 10:42 PM   in response to: Steven Davelaar in response to: Steven Davelaar
Click to report abuse...   Click to reply to this thread Reply
I had the same problem and had to do several things to get fixed. These are the steps I took:

1. Launch OC4J 10.1.3.x
2. Install ADF Installer 10.1.3.3 by extracting files, changing adfinstaller.properties, and running java -jar runinstaller.jar adfinstaller.properties
3. Copy files from
$Jdeveloper Home\jakarta-taglibs
to
$OC4J Home\BC4J\lib
the files are:
commons-digester.jar
commons-logging.jar
commons-collections.jar

4. Download and copy apache-log4j-1.2.15 (log4j-1.2.15.jar) to $OC4J Home\BC4J\lib
5. Make sure you have these tags in orion-application.xml:
<imported-shared-libraries>
<remove-inherited name="apache.commons.logging"></remove-inherited>
</imported-shared-libraries>
It is already there if you are generating by Jheadstart.

6. Create a new project, and make deployment files through a process similar to the document:
Deploying a Web Application
http://www.oracle.com/technology/obe/obe1013jdev/10131/deployment/deployment.htm
making WAR for view-controller, JAR for model, and EAR in a new project

7. Deploy the application.

Hope it will do the trick.
Regards,
Farbod
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 24, 2007 11:42 PM   in response to: Steven Davelaar in response to: Steven Davelaar
Click to report abuse...   Click to reply to this thread Reply
Hi, Steven Davelaar and All

How can I do it in a embedded oc4j
Farbod

Posts: 252
Registered: 09/03/06
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 25, 2007 3:20 AM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
Doing what? The thread is about deploying to OC4J. To my knowledge, For embedded OC4J if you are using JDeveloper 10.1.3.3 or so, you can just run the application and it serves the purpose, though you can replace the libraries if you have really encountered a problem, but I don't think it is necessary.
Kind Regards,
Farbod
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 25, 2007 11:23 PM   in response to: Farbod in response to: Farbod
Click to report abuse...   Click to reply to this thread Reply
thank Farbod for your reply
Remove the shared library, is it the subject you are talking above?

In fact, I want to remove toplink from embedded oc4j when I was using Hibernate!
But hibernate cannot use antlr2.7.6rc1.jar when the file name is not the same with the antlr used by toplink!
My colleague has resolved this problem by renaming the jar file antlr2.7.6rc1.jar to antlr.jar, and copy it into the directory of /toplink/jlib.
This works pretty well. But I was supprised when I did the the same thing like this except changing the name of antlr2.7.6.rc1 to antlr, it dosent work.
And I still think this method isn't gracefully enough and I was searching for the same method like adding remove-inherited element in the orion-application.xml file.But I failed to get one.

Message was edited by:
wangfeng
Farbod

Posts: 252
Registered: 09/03/06
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 26, 2007 12:33 AM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
You may have already tried this but if not, add these elements to orion-application.xml:
<orion-application>
<imported-shared-libraries>
<remove-inherited name="oracle.toplink"/>
</imported-shared-libraries>
</orion-application>
Kind Regards,
Farbod

P.S. These two links may be useful, I haven't tried such a thing myself:
http://forums.oracle.com/forums/thread.jspa?threadID=420071
http://download-west.oracle.com/docs/cd/B25221_04/web.1013/b14433/opensrc.htm#BABCIEAF
Farbod

Posts: 252
Registered: 09/03/06
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 26, 2007 12:41 AM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
Oops. Double Posted. I don't know how to delete this.

Message was edited by:
Farbod
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 29, 2007 10:27 AM   in response to: Farbod in response to: Farbod
Click to report abuse...   Click to reply to this thread Reply
Oops!
I think you didn't understand my last post! Maybe my English is too poor to express what I meant!
We have done both the removing the shared library in orion-application.xml and
update the jar file in "%JDEV_HOME%/toplink/jlib/" which is also posted in the first link you kindly offered.

I thought the first method is more gracefullly for it won't hurt OC4J and keeps OC4J's original appearance.
But We only can choose the second way when we want to run OC4J in embedded mode.

I found something strange in using the same method.
First When I update antlr.jar to another version, I have to keep the file name unchanging. You see many jar file has version number in their filename. I was supprised to found that
. And I have a question is whether the filename is hard-coded into the classloader of oc4j. In tomcat, the classloader will find the jar files automatically. I only needed to put the jar file in the direcory predefined by the classloader.
Second, when I setup an orion-application.xml in META-INF, it doesnt take any effect to embeded oc4j

Best Regards
wf
Jan Vervecken (...

Posts: 1,636
Registered: 10/29/98
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 29, 2007 11:52 AM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
hi wf

About "And I have a question is whether the filename is hard-coded into the classloader of oc4j.".

You might be looking for this file:
jdevstudio10133\j2ee\home\oc4j.jar!\meta-inf\boot.xml

That says ...

<!-- ... -->
 
<!-- This file defines the arrangement of class-loaders, shared-libraries -->
<!-- and the code-sources within them required to boot OC4J.  Think of it -->
<!-- as a glorified manifest Class-Path.                                  -->
 
<!-- ... -->
 
    <shared-library name="oracle.toplink" parent="api" version="10.1.3">
        <!-- ... -->
        <code-source path="${oracle.home}/toplink/jlib/toplink.jar"/>
        <code-source path="${oracle.home}/toplink/jlib/antlr.jar"/>
        <!-- ... -->
    </shared-library>
 
<!-- ... -->

regards
Jan Vervecken
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 30, 2007 3:57 AM   in response to: Jan Vervecken (... in response to: Jan Vervecken (...
Click to report abuse...   Click to reply to this thread Reply
Hi,Jan Vervecken
Thank you for your expertise to prove my thought, it seems oracle do not want developers easily to remove or modify the libraries used by oc4j itself to keep the correctness of oc4j.
Thus we have new way beyond updating the jar file keeping filename same as older ones is to extract oc4j.jar, modify boot.xml and produce a new oc4j.jar.

Then my second question is when I add a orion-application.xml in meta-inf in my application but it has no effect on embedded oc4j.
Did orion-appliaction.xml only affect applications in stand-alone oc4j?
And from the experiment until now the answer seems to be yes.
If anybody else dont agree with my shallow opinion, please dont hesitate to figure it out.

Kindly Regards and Happy new year to everyone.
wf
Jan Vervecken (...

Posts: 1,636
Registered: 10/29/98
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Dec 30, 2007 4:46 AM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
hi wf

It was not my intention to suggest to "... modify boot.xml and produce a new oc4j.jar".
If you really want to do this, you should probably first discuss this approach with Oracle support in a service request on Metalink.

regards
Jan
Farbod

Posts: 252
Registered: 09/03/06
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Jan 1, 2008 9:56 PM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
Hi Wangfeng and Happy new year to you and all.
Yes you are right I hadn't got your point.
- I am wondering how you understand that the elements in your orion-application have not affected the embedded OC4J? To my knowledge they should do the same to emb-OC4J as they do to the standalone. Also there are some orion-application.xml files in the emb-OC4J folders. You can change them and they define default behavior of the emb-OC4j. If it doesn't work it should a bug. I had a similar problem with associating an application with LDAP when running on emb-OC4J so I moved to standalone OC4J.

- As for the JAR files, the version for example log4j-1.2.15.jar is not important when oc4j tries to find the file. I think it has to do with the manifest file and implementation title. I am wondering how the container searches for the libraries, from the filename or from a pre-defined xml file (as Jan described for boot.xml), or from the manifest.
Regards,
Farbod
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Jan 3, 2008 7:42 PM   in response to: Jan Vervecken (... in response to: Jan Vervecken (...
Click to report abuse...   Click to reply to this thread Reply
Hi, Jan Vervecken

I just talked about the possibility and I am not intending to do it too.
It's more easy to replace the jar file than to modify the boot.xml and produce a new oc4j.jar.
I dont want to make life tough.

Best Regards
wf
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Jan 3, 2008 8:15 PM   in response to: Farbod in response to: Farbod
Click to report abuse...   Click to reply to this thread Reply
hi, farbod

I was focusing on the orion-application.xml in meta-inf folder of J2EE application,not the libraries loaded by through JAR-class-path in mf file . I think you can refer to "How the Java Launcher Finds JAR-class-path Classes" in JavaDoc for more detail about he Jar-class-path. And I guess containers didnt need to care loading these libraries in manifest file, it's Java VM's work.

Hence, go back to your first section of your reply, maybe you are right, I am new to the structure of J2EE application (especially a web application)in JDeveloper.
I set up a folder META-INF, and add the orion-application.xml in it, and the content of the xml file is
<?xml version="1.0"?>

<orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd" deployment-version="10.1.3.3.0" default-data-source="jdbc/OracleDS" see-parent-data-sources="false" component-classification="external"
schema-major-version="10" schema-minor-version="0" >
<imported-shared-libraries>
<remove-inherited name="oracle.toplink"/>
</imported-shared-libraries>
</orion-application>

I have try to put the folder in Application Resource or WebContent, in the latter try, I found META-INF is in the same folder with WEB-INF.But it doesnt work in both ways.

Best Regards!
wf

Jan Vervecken (...

Posts: 1,636
Registered: 10/29/98
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Jan 3, 2008 11:03 PM   in response to: wangfeng in response to: wangfeng
Click to report abuse...   Click to reply to this thread Reply
hi wangfeng

When trying to use elements like "remove-inherited" in orion-application.xml, you might also want to consider using a deployment plan.
see "8 Working with Deployment Plans" in the "Oracle® Containers for J2EE Deployment Guide 10g (10.1.3.1.0) Part Number B28951-01"
at http://download.oracle.com/docs/cd/B32110_01/web.1013/b28951/deployplan.htm#CHDFEFAE

success
Jan
wangfeng

Posts: 10
Registered: 12/24/07
Re: Error in deploying from jdeveloper 10.1.3.3 to oc4j 10.1.3.3
Posted: Jan 3, 2008 11:40 PM   in response to: Jan Vervecken (... in response to: Jan Vervecken (...
Click to report abuse...   Click to reply to this thread Reply
Much thanks!
A wonderful material, I'll read it first, discuss later.
Best Regards!
wf
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums