-->
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.  [ 9 posts ] 
Author Message
 Post subject: Getting Hibernate3 to run w/o jta.jar?
PostPosted: Tue Apr 26, 2005 1:35 am 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
Hibernate version: 3.01
Container: Tomcat 5.5.9

I've removed jta.jar and now Hibernate is complaining ClassNotFoundException: javax/transaction/SystemException. I'm trying to understand why it is looking up JTA in the first place when my configuration says it should do otherwise. Here is the verbose log I see on startup:

Using CATALINA_BASE: C:\Documents and Settings\Gili\.netbeans\dev\jakarta-tomcat-5.5.7_base
Using CATALINA_HOME: C:\Program Files\netbeans-4.2dev\enterprise1\jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR: C:\Documents and Settings\Gili\.netbeans\dev\jakarta-tomcat-5.5.7_base\temp
Using JAVA_HOME: C:\Program Files\Java\jdk1.5.0_02
26-Apr-2005 1:19:40 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
26-Apr-2005 1:19:40 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1437 ms
26-Apr-2005 1:19:40 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
26-Apr-2005 1:19:40 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
26-Apr-2005 1:19:40 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
26-Apr-2005 1:19:43 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
26-Apr-2005 1:19:43 AM org.apache.jk.common.ChannelSocket init
INFO: Port busy 8009 java.net.BindException: Address already in use: JVM_Bind
26-Apr-2005 1:19:43 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8010
26-Apr-2005 1:19:43 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=1 time=0/171 config=null
26-Apr-2005 1:19:44 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
26-Apr-2005 1:19:44 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3532 ms
26-Apr-2005 1:19:44 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost'
26-Apr-2005 1:19:44 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: init: Global resources are available
26-Apr-2005 1:19:44 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: list: Listing contexts for virtual host 'localhost'
26-Apr-2005 1:19:44 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: list: Listing contexts for virtual host 'localhost'
26-Apr-2005 1:19:45 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: undeploy: Undeploying web application at '/DesktopBeautifierServer'
26-Apr-2005 1:19:45 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: install: Installing context configuration at 'file:/C:/DOCUME~1/Gili/LOCALS~1/Temp/context29194.xml'
26-Apr-2005 1:19:45 AM org.apache.catalina.core.ApplicationContext log
INFO: Manager: start: Starting web application at '/netbeans4'
26-Apr-2005 1:19:45 AM org.apache.catalina.core.StandardContext start
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/netbeans4] has already been started
01:19:47,984 INFO Environment:460 - Hibernate 3.0.1
01:19:48,000 INFO Environment:478 - loaded properties from resource hibernate.properties: {hibernate.order_updates=true, hibernate.default_batch_fetch_size=8, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hibernate.jdbc.use_streams_for_binary=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.cache.region_prefix=hibernate.test, hibernate.show_sql=false, hibernate.jdbc.batch_versioned_data=true, hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory, hibernate.connection.pool_size=1}
01:19:48,063 INFO Environment:505 - using java.io streams to persist binary types
01:19:48,063 INFO Environment:506 - using CGLIB reflection optimizer
01:19:48,078 INFO Environment:536 - using JDK 1.4 java.sql.Timestamp handling
01:19:48,219 INFO Configuration:1160 - configuring from resource: /hibernate.cfg.xml
01:19:48,219 INFO Configuration:1131 - Configuration resource: /hibernate.cfg.xml
01:19:48,422 INFO Configuration:441 - Mapping resource: com/be/desktopbeautifier/server/AbstractImage.hbm.xml
01:19:49,281 INFO HbmBinder:258 - Mapping class: com.be.desktopbeautifier.server.AbstractImage -> image
01:19:49,516 INFO HbmBinder:736 - Mapping subclass: com.be.desktopbeautifier.server.DefaultImage -> image
01:19:49,516 INFO Configuration:441 - Mapping resource: com/be/desktopbeautifier/server/AbstractTheme.hbm.xml
01:19:50,438 INFO HbmBinder:258 - Mapping class: com.be.desktopbeautifier.server.AbstractTheme -> theme
01:19:50,438 INFO HbmBinder:736 - Mapping subclass: com.be.desktopbeautifier.server.DefaultTheme -> theme
01:19:50,438 INFO Configuration:441 - Mapping resource: com/be/desktopbeautifier/server/DefaultContentType.hbm.xml
01:19:51,156 INFO HbmBinder:258 - Mapping class: com.be.desktopbeautifier.server.DefaultContentType -> content_type
01:19:51,156 INFO Configuration:441 - Mapping resource: com/be/desktopbeautifier/server/DefaultImageSpecification.hbm.xml
01:19:51,875 INFO HbmBinder:258 - Mapping class: com.be.desktopbeautifier.server.DefaultImageSpecification -> image_specification
01:19:51,875 INFO Configuration:441 - Mapping resource: com/be/desktopbeautifier/server/DefaultImageProvider.hbm.xml
01:19:52,578 INFO HbmBinder:258 - Mapping class: com.be.desktopbeautifier.server.DefaultImageProvider -> image_provider
01:19:52,578 INFO Configuration:1272 - Configured SessionFactory: null
01:19:52,594 INFO Configuration:852 - processing extends queue
01:19:52,594 INFO Configuration:856 - processing collection mappings
01:19:52,594 INFO HbmBinder:1962 - Mapping collection: com.be.desktopbeautifier.server.AbstractTheme.children -> theme
01:19:52,594 INFO Configuration:865 - processing association property references
01:19:52,594 INFO Configuration:894 - processing foreign key constraints
01:19:52,656 INFO Dialect:91 - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
01:19:52,672 INFO SettingsFactory:88 - Maximum outer join fetch depth: 1
01:19:52,672 INFO SettingsFactory:91 - Default batch fetch size: 8
01:19:52,672 INFO SettingsFactory:95 - Generate SQL with comments: disabled
01:19:52,672 INFO SettingsFactory:99 - Order SQL updates by primary key: enabled
01:19:52,672 INFO SettingsFactory:285 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
01:19:52,672 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
01:19:52,703 INFO SettingsFactory:107 - Query language substitutions: {no='N', true=1, yes='Y', false=0}
01:19:52,719 INFO NamingHelper:26 - JNDI InitialContext properties:{}
01:19:52,719 INFO DatasourceConnectionProvider:51 - Using datasource: java:/comp/env/jdbc/desktopbeautifier
AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@1f8bd0d)
LogAbandoned: true
RemoveAbandoned: true
RemoveAbandonedTimeout: 60
01:19:53,094 INFO SettingsFactory:149 - JDBC batch size: 15
01:19:53,094 INFO SettingsFactory:152 - JDBC batch updates for versioned data: enabled
01:19:53,094 INFO SettingsFactory:157 - Scrollable result sets: enabled
01:19:53,094 INFO SettingsFactory:165 - JDBC3 getGeneratedKeys(): enabled
01:19:53,109 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
01:19:53,109 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
01:19:53,125 INFO SettingsFactory:177 - Automatic flush during beforeCompletion(): disabled
01:19:53,125 INFO SettingsFactory:180 - Automatic session close at end of transaction: disabled
01:19:53,125 INFO SettingsFactory:186 - Second-level cache: enabled
01:19:53,125 INFO SettingsFactory:190 - Query cache: disabled
01:19:53,125 INFO SettingsFactory:272 - Cache provider: org.hibernate.cache.HashtableCacheProvider
01:19:53,250 INFO SettingsFactory:205 - Optimize cache for minimal puts: disabled
01:19:53,250 INFO SettingsFactory:210 - Cache region prefix: hibernate.test
01:19:53,250 INFO SettingsFactory:214 - Structured second-level cache entries: enabled
01:19:53,250 INFO SettingsFactory:226 - Statistics: disabled
01:19:53,250 INFO SettingsFactory:230 - Deleted entity synthetic identifier rollback: disabled
01:19:53,250 INFO SettingsFactory:244 - Default entity-mode: pojo
01:19:53,344 ERROR [/netbeans4]:662 - StandardWrapper.Throwable
java.lang.NoClassDefFoundError: javax/transaction/SystemException
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at com.be.desktopbeautifier.servlet.AbstractServlet.init(AbstractServlet.java:48)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:725)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:131)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


Do you see anything in the log that would indicate why it is looking up JTA in the first place? According to hibernate/lib/readme.txt, jta.jar is optional if you run inside a container.

Thank you,
Gili


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 1:55 am 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
Is this because Tomcat counts as a "non-managed environment"? The readme says:

runtime, required for standalone operation (outside application server)

which is why I am expecting it to be optional, even under Tomcat. If this isn't the case I can file a bug against the documentation to explicitly refer to Tomcat.

Gili


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 2:16 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Tomcat is not an application server. Please don't file bugs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 2:23 am 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
christian wrote:
Tomcat is not an application server. Please don't file bugs.


At the very least I'd like to file a documentation RFE so we explicitly say "Tomcat is not an application server" somewhere. I just did a text search through out online doc and we never seem to make this discuss this at all.

That paragraph I quoted for you out of Hibernate in Action is very well written. Is it possible for us to paraphrase it in the online doc?

Gili


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 2:51 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
hibernate doco doesn't have to tell you about the differences between tomcat and JBoss AS,Weblo,Websphere, you have to know what you are using, no?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 2:57 am 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
anthony wrote:
hibernate doco doesn't have to tell you about the differences between tomcat and JBoss AS,Weblo,Websphere, you have to know what you are using, no?


Right, except that I don't consider "Tomcat is not an application server" to be common knowledge and when readme.txt says jta.jar is optional if you're running inside one, I assumed I was fine without it.

Are you telling me I am the first person to ever confuse Tomcat for an application server? :) I don't see much harm adding a small paragraph to the documentation. If it was good enough for Hibernate in Action it should be good enough for our online documentation. We already have an entire chapter dedicated to Tomcat; why not add this paragraph there?

Gili


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 3:40 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There _is_ a whole chapter about Tomcat in the reference documentation!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 3:50 am 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
christian wrote:
There _is_ a whole chapter about Tomcat in the reference documentation!


Absolutely, but you will note that:

1) It does not list jta.jar as one of the dependencies, even though it is required.
2) It does not explicitly explain out that Tomcat is not a full-fledged application server but rather a servlet container which is a subset thereof.

I know this is all obvious stuff to Hibernate veterans such as yourself, but it is the first time I ever heard of it and I've been doing servlet development for a long while now. I don't mean to push, I'm only trying to help future users so they don't run into the same problems I did and hopefully help you guys as well because they won't come running to you with questions.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 26, 2005 4:39 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Because its not a requirement in some Tomcat versions. I don't intent to document Tomcat in the Hibernate reference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.