Re: Including jar files in my web app ?

2001-04-06 Thread Court Demas

I was able to do this by simply printing out the current classloader.  Write a
simple servlet/JSP page that does this:

response.getOutputStream().println( "classloader: " + 
this.getClass().getClassLoader().toString() );



Unfortunately, I had troubles getting the above code loaded in certain
situations - a circular problem!


I've been looking into my classloading issues more..  it seems there's something
more subtle going on that I haven't nailed down yet.  I think it may be some
sort of class version conflict.  I should have more to report soon.

court



Ed Bras wrote:

 Thanks for the feedback guys.

 Apearantly some people have problems including jar files.
 To me it's not clear what the problem is, but to solve it I need to know
 where Orion looks for jar files.
 Can someone please tell me that or tell me how to enable Orion to output his
 search locations/paths ?? Plaaase?

 Resume:
 If I just put my jar file in the lib, my web-app can't find it.
 If I include the jar file in a tablib entry, neither does it find it (but I
 think this isn't the way as the jar is not for JSP usage).

 I have tried about everyting, but ...nothing... and it's hard searching the
 problem if Orion doesn't tell me where he searches.

 Eddie.

 From: "Carter, Shane" [EMAIL PROTECTED]
 Reply-To: Orion-Interest [EMAIL PROTECTED]
 To: Orion-Interest [EMAIL PROTECTED]
 Subject: RE: Including jar files in my web app ?
 Date: Thu, 5 Apr 2001 08:04:51 -0500
 
 I'm having the same problem with Orion.  I'm getting NoSuchMethodError when
 I run this class in Orion.  It works fine outside of Orion.  I think Orion
 is picking up another package elsewhere.  Below is the error message I'm
 getting.
 
 java.lang.NoSuchMethodError
at org.jdom.input.SAXHandler.startElement(SAXBuilder.java:607)
at
 org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1289)
at
 org.apache.xerces.framework.XMLParser.callStartElement(XMLParser.java:1922)
at
 org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne
 r.java:1831)
at
 org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
 LDocumentScanner.java:1223)
at
 org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
 java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1208)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:302)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:373)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)
at
 com.psg.blkjck.control.RequestParser.loadNodeCollection(RequestParser.java:6
 1)
at
 com.psg.blkjck.control.RequestParser.clinit(RequestParser.java:44)
at com.psg.blkjck.control.NavController.doGet(NavController.java:98)
at
 com.psg.blkjck.control.NavController.doPost(NavController.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:204)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:302)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:329)
at com.evermind.server.http.d3.sw(JAX)
at com.evermind.server.http.d3.su(JAX)
at com.evermind.server.http.ef.s1(JAX)
at com.evermind.server.http.ef.do(JAX)
at com.evermind.util.f.run(JAX)
 
 
 -Original Message-
 From: Eddie [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 05, 2001 5:47 AM
 To: Orion-Interest
 Subject: Re: Including jar files in my web app ?
 
 
 Thanks court but it doesn't work with me.
 
 I did what you suggested, put the velocity.jar file in the classes dir,
 removed the lib, unpacked it in the classes dir, put the org dir  in the
 same package dir as where the java file is located, but no luck. Maybe
 because my class file is located in a package and I call it through a
 sevlet
 reference.
 
 It keeps on giving me that classDefnotFound error. I also validated my
 web.xml file, but nothing.
 
 Can someone please tell me where Orion looks ?? or how to debug this ?? as
 this is getting a bit fru...
 I also tried some debug options as explained on the site, but can't find
 one
 which shows where Orion looks !
 
 Hope to get some help here as I am a bit stuck!
 Eddie
 
 
 
 - Original Message -
 From: Court Demas [EMAIL PROTECTED]
 To: Orion-Interest [EMAIL PROTECTED]
 Sent: Thursday, April 05, 2001 9:36 AM
 Subject: Re: Including jar files in my web app ?
 
 
   I just had a similar problem.  Orion saw classes *either* in
 WEB-INF/classes
   *or* in WEB-INF/lib.
  
   My solution was to either unpack all classes into WEB-INF/classes
 (removing the
   lib directory), or create one huge JAR file in WEB-INF/lib (removing the
   classes directory).
  
   I hope there's a better solution!
  
   court
  
  
   Eddie wrote:
  
I don't seem be able to tell Orion 1.4.7 te read my bla.jar that is
 located
in the WEB-INF/lib ??
   
To me it's not re

web application classloading

2001-04-03 Thread Court Demas

short:  Orion's classloading seems to be broken.  It handles classes
differently depending on whether they're loaded from WEB-INF/lib or
WEB-INF/classes.  I see related bugs in the Orion bugzilla database
(http://bugzilla.orionserver.com/bugzilla/show_bug.cgi?id=340) with no
comments or solutions metioned..


long:

I'm having some troubles with the Orion web application classloader.
I'm currently using Orion 1.4.5 (I tried "java -jar autoupdate.jar" but
it only asks me "Overwrite /config/database-schemas/sapdb.xml" and
doesn't seem to do anything else).  I'm running Linux, Sun JDK1.3_02.

I'm trying to get the IdooXoap 1.1.1 toolkit running
(http://www.idoox.com).  It is delivered in an unpacked WAR directory.

Classes seem to load from the WEB-INF/lib directory, but the application
fails when those classes from WEB-INF/lib try to use Class.forName() to
load classes that are in WEB-INF/classes.  (Confused yet?)  Here's what
the default setup is, and what works on most other application servers:

IdooXoap/WEB-INF/etc/config.xml
IdooXoap/WEB-INF/lib/IdooXoap.jar
IdooXoap/WEB-INF/lib/log4j.jar
IdooXoap/WEB-INF/lib/xerces.jar
IdooXoap/WEB-INF/classes/demos/..

The servlet that is being called is inside of IdooXoap.jar, and it tries
to load the demos from the "classes" subdirectory.  This fails -
ClassNotFoundException.  Here's how I've tried to fix it:

1) Create "IdooXoap/WEB-INF/lib/demos.jar" with the contents of
"classes/demos".  This fails again with ClassNotFound.
2) Unpack all of the libraries from "lib" into "classes" (and then
remove everything from the "lib" directory).  This works!!
3) Create a giant JAR of all classes in the "lib" directory (and then
remove the "classes" directory).  This works too!!

court