How to load .jar files of subfolder in web-inf/lib folder?
Hi All,
In 'webapps\myappliction\WEB-INF\lib\myfolder' and in myfolder have some .jar files. How to load subfolder jar files in weblogic server 10.0?
Do I need to configure subfolder jar path in web.xml? Please help me.
Thanks & Regards,
Gangadhar
Class loaders associated with a Web application can be configured to locate local classes first. To enable this we have to set the <prefer-web-inf-classes> to true in the deployment override weblogic.xml, for example
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
http://blog.transfer-solutions.com/2010/12/weblogic-class-loading/
Similar Messages
-
JAR Files not found from /WEB-INF/lib
It appears that weblogic server (6.1 SP2 I believe) is not finding all
the jar files in the /WEB-INF/lib directory. Some, but not all. I am
not using a WAR file, the dirctories are right on the disk. I start
out with the following jar files in my WEB-INF/lib directory:
Volume in drive C has no label.
Volume Serial Number is 641F-B7A0
Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\li
b
02/13/2002 11:34a <DIR> .
02/13/2002 11:34a <DIR> ..
01/25/2002 09:44a 45,386 activation-1.0.1.jar
01/07/2002 04:49p 1,124,276 classes12.jar
01/25/2002 09:44a 379,658 ecs-1.4.1.jar
01/25/2002 09:44a 175,666 hsql.jar
01/25/2002 09:44a 76,964 httpunit.jar
01/25/2002 09:44a 236,041 idb.jar
01/25/2002 09:44a 29,937 jakarta-regexp-1.3-dev.jar
01/25/2002 09:44a 84,854 jdbc-se2.0.jar
01/25/2002 09:44a 6,727 jdbc2_0-stdext.jar
01/25/2002 09:44a 98,496 jndi-1.2.1.jar
01/25/2002 09:44a 17,619 jta1.0.1.jar
01/25/2002 09:44a 97,382 junit-3.2.jar
01/25/2002 09:44a 152,037 log4j-1.1.jar
01/25/2002 09:44a 280,984 mail-1.2.jar
01/25/2002 09:44a 109,927 mm.mysql-2.0.4.jar
01/25/2002 09:44a 76,734 oro.jar
01/25/2002 09:44a 194,500 postgresql.jar
01/25/2002 09:44a 4,041 README.txt
01/25/2002 09:44a 208,635 sapdbc.jar
02/13/2002 11:21a 216,879 STT.jar
02/08/2002 12:15p 707,897 turbine-2.2b1.jar
01/25/2002 09:44a 369,494 velocity-1.2-dev.jar
01/25/2002 09:44a 31,326 village-1.5.1.jar
01/25/2002 09:44a 436,094 xalan-1.2.1.jar
01/25/2002 09:44a 840,704 xerces-1.3.0.jar
01/25/2002 09:44a 47,926 xmlrpc.jar
26 File(s) 6,050,184 bytes
2 Dir(s) 29,539,246,080 bytes free
When I run the server, only these files are put in the tmp_war
directory:
Volume in drive C has no label.
Volume Serial Number is 641F-B7A0
Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\_t
mp_war_myserver_myserver_garyapp\WEB-INF\lib
02/15/2002 12:31p <DIR> .
02/15/2002 12:31p <DIR> ..
02/15/2002 12:31p 1,124,276 classes1263855.jar
02/15/2002 12:31p 175,666 hsql63856.jar
02/15/2002 12:31p 76,964 httpunit63857.jar
02/15/2002 12:31p 236,041 idb63858.jar
02/15/2002 12:31p 6,727 jdbc2_0-stdext63859.jar
02/15/2002 12:31p 76,734 oro63860.jar
02/15/2002 12:31p 194,500 postgresql63861.jar
02/15/2002 12:31p 208,635 sapdbc63862.jar
02/15/2002 12:31p 216,879 STT63863.jar
02/15/2002 12:31p 47,926 xmlrpc63864.jar
10 File(s) 2,364,348 bytes
2 Dir(s) 29,539,078,144 bytes free
It's not only that the files don't show up, of course: if I run the
system and it makes references to the files, I get a
ClassNotFoundException:
<Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
<[WebAppServletContext(7243997,gar
yapp,/garyapp)] Error loading servlet: "garyapp"
java.lang.ClassNotFoundException: org.apache.turbine.Turbine
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
areClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
areClassLoader.java:43)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:583)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:368)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
<Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
<[WebAppServletContext(7243997,gar
yapp,/garyapp)] Servlet failed with ServletException
javax.servlet.ServletException: Servlet class:
'org.apache.turbine.Turbine' coul
d not be loaded - the requested class wasn't found in the classpath:
'C:\bea\wl
server6.1\config\mydomain\applications\garyapp;C:\bea\wlserver6.1\.\config\mydom
ain\applications\garyapp\WEB-INF\classes;C:\bea\wlserver6.1\.\config\mydomain\ap
plications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\classe
s1263855.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_
tmp_war_myserver_myserver_garyapp\WEB-INF\lib\hsql63856.jar;C:\bea\wlserver6.1\.
\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp
\WEB-INF\lib\httpunit63857.jar;C:\bea\wlserver6.1\.\config\mydomain\applications
\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\idb63858.jar;C:\
bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver
myservergaryapp\WEB-INF\lib\jdbc2_0-stdext63859.jar;C:\bea\wlserver6.1\.\confi
g\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-I
NF\lib\oro63860.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WE
B-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\postgresql63861.jar;C:\bea\
wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_mys
erver_garyapp\WEB-INF\lib\sapdbc63862.jar;C:\bea\wlserver6.1\.\config\mydomain\a
pplications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\STT63
863.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_w
ar_myserver_myserver_garyapp\WEB-INF\lib\xmlrpc63864.jar'
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:594)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:368)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>Please open a case with support on this issue.
Thanks,
Michael
Gary Bisaga wrote:
It appears that weblogic server (6.1 SP2 I believe) is not finding all
the jar files in the /WEB-INF/lib directory. Some, but not all. I am
not using a WAR file, the dirctories are right on the disk. I start
out with the following jar files in my WEB-INF/lib directory:
Volume in drive C has no label.
Volume Serial Number is 641F-B7A0
Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\li
b
02/13/2002 11:34a <DIR> .
02/13/2002 11:34a <DIR> ..
01/25/2002 09:44a 45,386 activation-1.0.1.jar
01/07/2002 04:49p 1,124,276 classes12.jar
01/25/2002 09:44a 379,658 ecs-1.4.1.jar
01/25/2002 09:44a 175,666 hsql.jar
01/25/2002 09:44a 76,964 httpunit.jar
01/25/2002 09:44a 236,041 idb.jar
01/25/2002 09:44a 29,937 jakarta-regexp-1.3-dev.jar
01/25/2002 09:44a 84,854 jdbc-se2.0.jar
01/25/2002 09:44a 6,727 jdbc2_0-stdext.jar
01/25/2002 09:44a 98,496 jndi-1.2.1.jar
01/25/2002 09:44a 17,619 jta1.0.1.jar
01/25/2002 09:44a 97,382 junit-3.2.jar
01/25/2002 09:44a 152,037 log4j-1.1.jar
01/25/2002 09:44a 280,984 mail-1.2.jar
01/25/2002 09:44a 109,927 mm.mysql-2.0.4.jar
01/25/2002 09:44a 76,734 oro.jar
01/25/2002 09:44a 194,500 postgresql.jar
01/25/2002 09:44a 4,041 README.txt
01/25/2002 09:44a 208,635 sapdbc.jar
02/13/2002 11:21a 216,879 STT.jar
02/08/2002 12:15p 707,897 turbine-2.2b1.jar
01/25/2002 09:44a 369,494 velocity-1.2-dev.jar
01/25/2002 09:44a 31,326 village-1.5.1.jar
01/25/2002 09:44a 436,094 xalan-1.2.1.jar
01/25/2002 09:44a 840,704 xerces-1.3.0.jar
01/25/2002 09:44a 47,926 xmlrpc.jar
26 File(s) 6,050,184 bytes
2 Dir(s) 29,539,246,080 bytes free
When I run the server, only these files are put in the tmp_war
directory:
Volume in drive C has no label.
Volume Serial Number is 641F-B7A0
Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\_t
mp_war_myserver_myserver_garyapp\WEB-INF\lib
02/15/2002 12:31p <DIR> .
02/15/2002 12:31p <DIR> ..
02/15/2002 12:31p 1,124,276 classes1263855.jar
02/15/2002 12:31p 175,666 hsql63856.jar
02/15/2002 12:31p 76,964 httpunit63857.jar
02/15/2002 12:31p 236,041 idb63858.jar
02/15/2002 12:31p 6,727 jdbc2_0-stdext63859.jar
02/15/2002 12:31p 76,734 oro63860.jar
02/15/2002 12:31p 194,500 postgresql63861.jar
02/15/2002 12:31p 208,635 sapdbc63862.jar
02/15/2002 12:31p 216,879 STT63863.jar
02/15/2002 12:31p 47,926 xmlrpc63864.jar
10 File(s) 2,364,348 bytes
2 Dir(s) 29,539,078,144 bytes free
It's not only that the files don't show up, of course: if I run the
system and it makes references to the files, I get a
ClassNotFoundException:
<Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
<[WebAppServletContext(7243997,gar
yapp,/garyapp)] Error loading servlet: "garyapp"
java.lang.ClassNotFoundException: org.apache.turbine.Turbine
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
areClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
areClassLoader.java:43)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:583)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:368)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
<Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
<[WebAppServletContext(7243997,gar
yapp,/garyapp)] Servlet failed with ServletException
javax.servlet.ServletException: Servlet class:
'org.apache.turbine.Turbine' coul
d not be loaded - the requested class wasn't found in the classpath:
'C:\bea\wl
server6.1\config\mydomain\applications\garyapp;C:\bea\wlserver6.1\.\config\mydom
ain\applications\garyapp\WEB-INF\classes;C:\bea\wlserver6.1\.\config\mydomain\ap
plications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\classe
s1263855.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_
tmp_war_myserver_myserver_garyapp\WEB-INF\lib\hsql63856.jar;C:\bea\wlserver6.1\.
\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp
\WEB-INF\lib\httpunit63857.jar;C:\bea\wlserver6.1\.\config\mydomain\applications
\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\idb63858.jar;C:\
bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver
myservergaryapp\WEB-INF\lib\jdbc2_0-stdext63859.jar;C:\bea\wlserver6.1\.\confi
g\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-I
NF\lib\oro63860.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WE
B-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\postgresql63861.jar;C:\bea\
wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_mys
erver_garyapp\WEB-INF\lib\sapdbc63862.jar;C:\bea\wlserver6.1\.\config\mydomain\a
pplications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\STT63
863.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_w
ar_myserver_myserver_garyapp\WEB-INF\lib\xmlrpc63864.jar'
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:594)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
java:368)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:242)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>--
Michael Young
Developer Relations Engineer
BEA Support -
Weblogic Server not picking the jar files in WEB-INF/lib folder
we are facing a strange problem where Weblogic App Server is not picking the jar files present inside the WEB-INF/lib folder if we update the jar file path in the classpath of the start script then the classes get loaded properly.
Is there any specific setting which I need to do in weblogic to pick these jars ?Class loaders associated with a Web application can be configured to locate local classes first. To enable this we have to set the <prefer-web-inf-classes> to true in the deployment override weblogic.xml, for example
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
http://blog.transfer-solutions.com/2010/12/weblogic-class-loading/ -
How to load jar file in oracle 9i???
Hi Friends,
Can you help me, how to load jar file oracle 9i? I have to tried to load in 10g using loadjava command but it's not working in oracle 9i because the loadjava batch file itself is not there in oralce 9i.
Is there any other way then pls let me know.
- Hiren ModiHi,
I have oracle version : Release 2 (9.2.0.1.0) for Windows. I have tried to execute the loadjava command from SQL prompt but its giving as below.
H:\>loadjava
The system cannot find the path specified.
Do you know why its giving error like this. I have checked in dir : C:\oracle\ora92\bin but loadjava executable file is not there in it.
- Hiren Modi -
How to load flat file in BPS through Web-debugging
Hi,
We are working on flat file upload in BPS thru guide 'How to load flat file in BPS through Web'. Can some one guide on how to debug the function modules used while uploading the data.
We have set up the break point in the function modules and also in the BSP page. But when trying to debug while uploading, it is not going to the break point which was set.
Could you assist in setting up the break point.
Regards,
Sreenath
Message was edited by:
sreenath reddyHi,
I have put an external break-point.
I have hard coded it in the coding of the function module itself.
The code is perfectly working. But, when I want to check for the values of the variables in the F.M during runtime, the break-point is not triggering. Any ideas??
Regards, -
Can TLD jar can access through EAR / APP-INF/lib folder
Hi All,
If I have a TLD files into jar file and their specific classes are also into jar file .
Now can access those jar through EAR file APP-INF/lib folder or else its must to access through WEB-INF/lib folder.
any pointer will be great.
Regards,
Kal.I suggest you assume that's how it's supposed to work, and get that to work most efficiently. I have no idea what you were trying to achieve by putting the taglib jar in APP-INF/lib. Perhaps you have multiple webapps and you wanted to avoid multiple instances of the taglib jar? If that's the case, I believe you could use WebLogic "shared application libraries" (I don't think that's the correct term), where you deploy a jar file as an application library, and the weblogic.xml file in each webapp that uses it would specify the name of the application library it uses.
-
Revision: 1494
Author: [email protected]
Date: 2008-04-30 12:29:37 -0700 (Wed, 30 Apr 2008)
Log Message:
+ Copy jgroups.jar to qa-regress/WEB-INF/lib folder
+ Add a clustered destination to remoting-config.mods.xml for codecoverage
+ Add url-load-balancing,class and default attributes to cluster definition in services-config.mods.xml for codecoverage
checkintests: passed
Modified Paths:
blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/remoting-config.mods.xml
blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/services-config.mods.xml
blazeds/trunk/qa/apps/qa-regress/build.xmlPlease see following Sun Alert.
http://sunsolve.sun.com/search/document.do?assetkey=1-26-101905-1
The document contains links to the patches that fix this problem. -
How to load jar files from remote location
Hi all,
I am trying to load jar files from remote server, from a servlet which is running on OC4j.
For doing this,First I am getting ClassLoader by using ClassLoader.getSystemClassLoader() and then type casting it to URLClassLoader.
But by doing it I am getting ClassCastException,because oc4j returns oracle.classloader.PolicyClassLoader instead of java.net.ClassLoader.
Appreciate if anyone can tell me how to load remote jar files using oracle.classloader.PolicyClassLoader .
Thanks
HarishHi,
I suppose you know about this, but just in case.
I have used jnpl to load jar files from remote location.
Rowan -
How to load jar file using SQL Developer
Dear All,
I need urgent help to load mytest.jar to the database using SQL Developer. I am able to load individual java classes to the database using SQL developers, but i could not load JAR files. Please help me any one know how to do this using SQL Developer.
Thanks and Regards
John pI don't think that's possible, so load it through the OS with the loadjava utility.
Have fun,
K. -
How to load jar file in one shot?
I have a Java app refers some jar files on remote location. Loading class by class is very time consuming.
Is it possible to load the jar files as a whole? like what applet does?
Tried URLClass loading, even run java -jar, still those load class on demand.
I want the jar file loaded only one time into JVM.I don't really understand. When you load a jar file using URLClassLoader it brings over the jar file and extracts the class files from the jar file. It does not bring over the class files as individual class files. If you mean you want to only ever bring over the jar file once then why not just copy the jar file using URLConnection and save it to disk. You can then load the jar file from disk each time the program starts.
-
How to load .jar files when not specified in the .jnlp file
Hello,
We are deploying an application with JWS but due to the nature of this app, we need to download additional jar file only when the user has been authenticated. The jar file(s) we need to download can hardly be predicted (in term of name) and thus cannot be all listed as lazzy resource in the .jnlp file.
However, we would like to take advantage of the various JWS features relateed to .jar download and cache and would prefer not to reinvent the wheel by implementing our on stuff (i.e. URLClassLoader with caching etc.).
Any idea, suggestion?
Thanks in advance.
Fred.How about writing a second jnlp file with the optional jar listed in it and running it only if your user is authenticated?
-
How to load Jar Files on demand
Hi all.
As must of you probably know, JAR files are downloaded on the initial phase when the first form is requested from the URL. This is done through the archive parameter.
Although i recognized the advantage of such technique, there may be times, when one would wish to download certain JAR files when really needed.
For example, the FormsGraph.jar may be needed only with certain form modules, but probably not for most. So my question is, apart from doing a web.show_document and calling the desired form with the appropiate config section, is it possible to download specific JAR files on demand???
Thanks in advance ...!This is not really an "Oracle Forms" question. This is more of a java applet question that can be discussed in the Java forums.
https://forums.oracle.com/forums/category.jspa?categoryID=285
However, as far as I know, jar files are pulled on demand. You can easily test this with a simple form. For example, add any jar file to the ARCHIVE parameter in formsweb.cfg. Then open the JRE Control Panel and clear the cache. Now run the provided test form (test.fmx):
http://server/forms/frmservlet?form=test
Once the form has successfully started, open the JRE Control Panel again and open the Cache Viewer (General tab > View). Notice that the only files downloaded and cached are frmall.jar and Registry.dat. You may see a reference to your additional jar in the console, but the file was not brought down to the client. If you are seeing that a jar is being brought to the client with your own form, this is likely because your form is coded such that some code in that jar is being called and therefore is needed. -
Accessing Files in Jar File as part of Web App
I have put a number of NON-CLASS files in a jar file that resides in WEB-INF/lib in my webapp (running tomcat). These include xml files, xml schemas, images, etc. I would like to give my webapp programmatic access to these non-class files, such as providing the user with a list of all of the xml files in the jar file. I have seen a number of posts on this topic, but no answers.
I have tried everything that I can think of, to no avail. ServletContext.getResource() with just about any path fails. If I do: ServletContext.getResourcePaths(), I get a list of all of the jar files in WEB-INF/lib (as well as other resources). The jar files are listed as: "jndi:/localhost/WEB-INF/lib/XXXXX.jar". If I use that value in ServletContext.getResource(), it does not work. It appears that I need to set up a JNDI context if I want to get the jar file, using: File f = (File)context.lookup(...). this may or may not work, but I can't figure out how to set up the JNDI context for purposes of tomcat. Right now, this is the only thing that I can think of.
It would also be great if there was some way to take a path in the jar file, treat it as a directory, and list all of the files in that "directory".Thanks. That got me started. You need to put the full path to the file you want. here is the full code, either for getting an individual file or for getting the entire jar file, so that you can enumerate through it and read any file you want (this is for a non-binary file):
URL url = this.getClass().getResource("/path/path/path/file.xml"); // need full path
if(url != null)
JarURLConnection conn = (JarURLConnection)url.openConnection();
JarFile jarfile = conn.getJarFile();
JarEntry jarEntry = conn.getJarEntry();
BufferedReader br = new BufferedReader(new InputStreamReader(jarfile.getInputStream(jarEntry)));
StringBuffer sb = new StringBuffer();
String line = null;
while((line = br.readLine()) != null)
sb.append(line);
sb.append(System.getProperty("line.separator"));
br.close();
String fileContents = sb.toString(); -
Bug:WEB-INF/lib JARs not added to runtime classpath of WebLogic Server
The JAR files packaged in the WEB-INF/lib directory of an application do not get installed to the runtime classpath of the Weblogic server.
Edited by: dvohra16 on Feb 28, 2013 9:24 AMSome posts in which an external jar, usually a JDBC jar, had to be added to the startWebLogic script to be added to the runtime classpath of WebLogic server.
Re: jdbc problem on MS SQL Server
Re: MySQL JDBC driver w/11.1.2 where too now?
Re: ADF Parameter form - java.lang.NoClassDefFoundError: sqlj/runtime/ref/Defa
Re: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
Re: deploy a shared library
Re: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
Re: Help need in Adding External jar files.
Re: NoClassDefFoundError while Testing a JAX-WS Web Service
Re: Unable to connect to SQL server 2008 from a deployed Weblogic application
Re: Howo to add external jar - quick question
Re: MySql connection with JDev 11.1.2.2 issues
Re: Integration of MySQL with ADF application -
Please help.! Problem with locating classes within Jars under WEB-INF/lib.
Hi All,
I have a problem which you guys would have faced already...Here it goes..
I'm using OC4J 10.1.3.0 and use ADF for my web page. I have a controller class which refers to JSF/ADF APIs and this class is archived as a jar file and put under WEB-INF/lib, Also, all the classes related to JSF/ADF are available under the same WEB-INF/lib folder.
When I invoke my page, the controller class is getting called but it throws NoClassDefFound Error for the ADF based class. i mean, these ADF/JSF classes are not getting found when my jar class is placed within WEB-INF/lib. However, when i extract my jar into WEB-INF/classes, it works.
I'm sure, i miss some entry for classpath somewhere. Can any one please point me to right direction...?
Thanks
RajasekaranHello,
I do not have a direct answer to your question, but could you try the ClassLoader query tools to see if your classes/jar are loaded by the applications:
- Using Queries to Troubleshoot Class Loading Issues
Regards
Tugdual Grall
Maybe you are looking for
-
How can I play multiple episodes of a podcast in iTunes 11?
Hi there - I'm subscribing to a number of podcasts in iTunes 11. I would like to play multiple episodes of a podcast one after the other without having to start each one separately, and preferably without having to create a playlist each time. Any id
-
I purchased an annual subscription to Acrobat Pro XI and installed on my Mac two days ago. I cannot open PDFs. I keep getting a dialogue box saying my trial has ended and asking if I want to buy the software. Was using Acrobat Pro 9 previously. It ap
-
E51 - how to sync calendar using WIFI ?
Hello Is it possible to sync the calendar of the phone using a WIFI connexion ? My E51 is up to date (firmware updated today), and my mailbox contains a calendar which is compatible CalDav or iCal. Thanks for any information about it.
-
Output AVCHD to DVD disc in high def format?
I know this can be done using Toast on a Mac so it can be played back on a Blue-ray machine, but how would I do it on a Windows machine?
-
CS5 Master Suite Stop Working Error 131:4
Okay, THis morning I turned on DW, PS, and AI with no problem. I turned all but DW off. When I tried to launch PS after lunch, I get this error message "A problem occured with the licensing of this product. Restart your computer and re-launch th e