- This topic has 8 replies, 3 voices, and was last updated 20 years, 6 months ago by Scott Anderson.
-
AuthorPosts
-
petem1030MemberI am using a struts plugin to load some information in my servlet context at startup. I am using dbUtils from Jakarta and I get the following exception:
Inside Service Facade calling getSenGrade
<Apr 19, 2004 9:27:42 AM CDT> <Error> <HTTP> <BEA-101216> <Servlet: “action” failed to preload on startup in Web application: “/wfsWeb”.
javax.servlet.ServletException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: org/apache/commons/dbutils/ResultSetHandler
at com.ual.struts.plugins.loadSeniorityObjects.init(loadSeniorityObjects.java:66)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:993)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:869)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:848)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:787)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:3252)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3209)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:3195)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3174)
at weblogic.servlet.internal.HttpServer.preloadResources(HttpServer.java:688)
at weblogic.servlet.internal.WebService.preloadResources(WebService.java:483)
at weblogic.servlet.internal.ServletInitService.resume(ServletInitService.java:30)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:964)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:359)
at weblogic.Server.main(Server.java:32)
>I set up my Java Build Path by right clicking on the EJB project and selecting properties. I then went to Java Build Path and selected “Add External JAR’s. I selected dbUtils from my hard drive. Is there anything I am missing?
Riyad KallaMemberI set up my Java Build Path by right clicking on the EJB project and selecting properties. I then went to Java Build Path and selected “Add External JAR’s. I selected dbUtils from my hard drive. Is there anything I am missing?
What you did sets up your build environment (compiling). The error you are getting above is your runtime environment complaining that it cannot find the class you are trying to USE. You can go to Window > Preferences > MyEclipse > Application Server > Tomcat (4 or 5) > Paths, and then “Append to Classpath” the dbUtils JAR file in question. When you restart your App Server you should be ready to rock.
Were is the dbUtils JAR file on your hard drive? You can copy it to your WEB-INF/lib directory if your project needs it, as it is not part of the base Tomcat install, so if you were to deploy this app you’d need to distribute dbUtils JAR file with it anyway.
petem1030MemberThe file is just located on my C drive. How do I deploy the file if it is an EJB project. There is no WEB-INF directory. Actually, it is a J2EE project and the error is in the EJB piece. When it is deployed the EJB and the WEB will not be collocated. What should I do with the JAR file in this instance?
Scott AndersonParticipantSince the J2EE classloader hierarchy makes everything that is loaded by the EJB classloader also accessible to the WAR classloader, it is simplest to simply place the shared library somewhere within the EJB project (the root is ok) and then reference the jar specifically using the Class-Path setting you can place in your META-INF/MANIFEST.MF file.
petem1030MemberI used Import to import the JAR file from the file system into my EJB project. Then I added the JAR file name to the Manifest.mf file. I redeployed, and got the same error.
Scott AndersonParticipantWhen you look at the deployment directory for the project, has the library been copied to it? I assume you’re using exploded deployment, right? What does the content of your MANIFEST.MF look like, specifically?
petem1030MemberBelow is my MANIFEST.MF file for the EJB portion of my Enterprise Archive:
Manifest-Version: 1.0
Class-Path: commons-dbutils-1.0.jarI added commons-dbutils-1.0.jar to the MANIFEST.MF file and imported the file to my EJB project. When I did a redeploy, the file did not get copied, and I still had the same exception.
My other question is how does MyEclipse build a project? Right now I am running WebLogic 8 locally on my computer. If I were to want to deploy to a remote server could I just copy the file that MyEclipse generates to the remote server and use WebLogic to deploy it or would I need to use Ant? I also though that MANIFEST.MF files were auto generated as part of the build process.
petem1030MemberCan anyone answer my last question?
Scott AndersonParticipantI added commons-dbutils-1.0.jar to the MANIFEST.MF file and imported the file to my EJB project. When I did a redeploy, the file did not get copied, and I still had the same exception.
I tried to make the copy of MANIFEST.MF to the deployment directory fail, but I was unable to do so with our latest version. What configuration are you running (please see the Posting Guidelines thread at the top of this forum)? Also, please be aware that the file path needs to be META-INF/MANIFEST.MF, exactly. The spec says the path is in all caps and that is specifically what is used by our deployer and by app servers. If you’ve entered it in any other case configuration, this is likely the cause of the problem you’re seeing.
My other question is how does MyEclipse build a project? Right now I am running WebLogic 8 locally on my computer. If I were to want to deploy to a remote server could I just copy the file that MyEclipse generates to the remote server and use WebLogic to deploy it or would I need to use Ant?
If you’re generating archives (EAR, EJB jar, WAR) out of MyEclipse, you can copy these to your remote machine and use WebLogic’s deployer to deploy them. However, please bear in mind that our archives are compiled with full symbolic information to enable debugging. In a production configuration we recommend that you have an external process or application (ie Ant Farm) that pulls all the source directly from your repository, compiles it with optimization, and packages it for production deployment.
I also though that MANIFEST.MF files were auto generated as part of the build process.
An empty one is generated by the jar process if you don’t specify your own. To use Class-Path, you need to specify your own and this is what MyEclipse does.
-
AuthorPosts