-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Porting Hibernate/Struts App from Tomcat 4 to 5
PostPosted: Wed Aug 25, 2004 7:02 am 
Newbie

Joined: Wed Aug 25, 2004 6:29 am
Posts: 2
Location: M
I'm trying to bring an struts and hibernate based application that runs sucessfully with tomcat 4 to tomcat 5.
Shortly after start it throws the exception

Code:
Time: 11:36:25  Priority: ERROR  Thread: main  NDC: null Category: net.sf.hibernate.cfg.Configuration Location: net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:381) Message:
Could not configure datastore from jar: ocp-dbmappings.jar
Throwable:
java.util.zip.ZipException: No such file or directory
   at java.util.zip.ZipFile.open(Native Method)
   at java.util.zip.ZipFile.<init>(ZipFile.java:204)
   at java.util.jar.JarFile.<init>(JarFile.java:132)
   at java.util.jar.JarFile.<init>(JarFile.java:97)
   at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:378)
   at de.oew.ocp.hibernate.HibernateAdapter.<clinit>(HibernateAdapter.java:46)
   at de.oew.ocp.hibernate.DomainStore.findActiveUsersByHost(DomainStore.java:353)
   at de.oew.ocp.user.UserManager.getActiveUsers(UserManager.java:76)
   at de.oew.ocp.user.UserManager.deleteActiveUsers(UserManager.java:107)
   at de.oew.ocp.OCPAppAttrContainer.initialize(OCPAppAttrContainer.java:111)
   at de.oew.web.servlet.OEWAppAttrContainerBase.contextInitialized(OEWAppAttrContainerBase.java:76)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3773)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4270)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
   at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320)
   at org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:657)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:476)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521)
   at org.apache.catalina.core.StandardService.start(StandardService.java:519)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:594)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:582)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)


Tomcat unpacks the application anyway. If I go to ${CATALINA_HOME}/work/Catalina/localhost/<appname> and set a symbolic link called "loader" to ${CATALINA_HOME}/webapps/<appname>/WEB-INF/classes I can sucessfully start the application via the tomcat5 manager application.
The jar file in question contains the hibernate mappings (*.hbm.xml) of the application.

I'm only the admin who tries to get it running, the developer is on vacation. Thus my hibernate know-how is very poor.

Hibernate version: 2.1.4


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 29, 2004 6:28 pm 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:57 am
Posts: 33
Location: Alpharetta, Georgia
I'm having similar weird problems with tomcat 5, particularly when trying to "write once run anywhere" (works on linux, pukes on windoze). Tomcat seems to unzip the jars ok, but for some reason begins execution before it's done -- maybe it's unzipping and executing in different threads? Several of my third party libraries write errors into the log saying they don't have access to such and such a resource, when it's plainly there in the expanded webapp.

As far as windoze, tomcat will just give up unzipping the .war, complaining that it can't find the WEB-INF subdirectory. If I unzip the the very same .war into $CATALINA_HOME/webapps myself, no problems.

There also seems to be a large collection of complaints about the web application being closed ... and it runs anyway!

I guess I'm not answering any question here, only adding some whining to the general complaint about how tomcat5 deals with loading applications from zipped formats.


Top
 Profile  
 
 Post subject: Re: Porting Hibernate/Struts App from Tomcat 4 to 5
PostPosted: Tue Aug 31, 2004 12:04 pm 
Newbie

Joined: Wed Aug 25, 2004 6:29 am
Posts: 2
Location: M
As recommended in this tomcat-users mailing list entry we changed .jar to .zip (also in the code of course) and it works now!

Problem resolved!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.