2 Replies Latest reply on Aug 2, 2006 12:18 PM by Markus Kühn

    tomcat deploy

    Markus Kühn Newbie

      Deploying the seam hibernate example with ant and a fresh tomcat 5.5.17 install gives me following error:

      ...
      INFO 30-07 20:04:15,265 (Log4JLogger.java:info:94) -Component: hotel, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.hibernate.Hotel
      INFO 30-07 20:04:15,296 (Log4JLogger.java:info:94) -Hibernate Annotations 3.2.0.CR1
      INFO 30-07 20:04:15,312 (Log4JLogger.java:info:94) -Hibernate 3.2 cr2
      INFO 30-07 20:04:15,328 (Log4JLogger.java:info:94) -hibernate.properties not found
      INFO 30-07 20:04:15,328 (Log4JLogger.java:info:94) -Bytecode provider name : cglib
      INFO 30-07 20:04:15,343 (Log4JLogger.java:info:94) -using JDK 1.4 java.sql.Timestamp handling
      INFO 30-07 20:04:15,484 (Log4JLogger.java:info:94) -configuring from resource: /hibernate.cfg.xml
      INFO 30-07 20:04:15,484 (Log4JLogger.java:info:94) -Configuration resource: /hibernate.cfg.xml
      INFO 30-07 20:04:15,625 (Log4JLogger.java:info:94) -Configured SessionFactory: java:/bookingDatabase
      INFO 30-07 20:04:15,765 (Log4JLogger.java:info:94) -Binding entity from annotated class: org.jboss.seam.example.hibernate.Hotel
      INFO 30-07 20:04:15,843 (Log4JLogger.java:info:94) -Bind entity org.jboss.seam.example.hibernate.Hotel on table Hotel
      INFO 30-07 20:04:15,906 (Log4JLogger.java:info:94) -Binding entity from annotated class: org.jboss.seam.example.hibernate.User
      INFO 30-07 20:04:15,906 (Log4JLogger.java:info:94) -Bind entity org.jboss.seam.example.hibernate.User on table User
      INFO 30-07 20:04:15,906 (Log4JLogger.java:info:94) -Binding entity from annotated class: org.jboss.seam.example.hibernate.Booking
      INFO 30-07 20:04:15,906 (Log4JLogger.java:info:94) -Bind entity org.jboss.seam.example.hibernate.Booking on table Booking
      INFO 30-07 20:04:16,125 (Log4JLogger.java:info:94) -JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      ERROR 30-07 20:04:16,156 (Log4JLogger.java:error:119) -Could not obtain initial context
      javax.naming.NamingException: Local server is not initialized
       at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
       at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
       at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.init(Unknown Source)
       at javax.naming.InitialContext.<init>(Unknown Source)
       at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
       at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
       at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
       at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
       at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:385)
       at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:61)
       at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
       at org.jboss.seam.core.Hibernate.startup(Hibernate.java:69)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1334)
       at org.jboss.seam.Component.callCreateMethod(Component.java:1322)
       at org.jboss.seam.Component.newInstance(Component.java:1312)
       at org.jboss.seam.Component.getInstance(Component.java:1263)
       at org.jboss.seam.Component.getInstance(Component.java:1253)
       at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:125)
       at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:104)
       at org.jboss.seam.init.Initialization.init(Initialization.java:196)
       at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:32)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
       at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
       at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
       at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
       at org.apache.catalina.core.StandardService.start(StandardService.java:450)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)...


        • 1. Re: tomcat deploy
          Thomas Heute Master

          Did you use the deploy.tomcat target for ant ?

          • 2. Re: tomcat deploy
            Markus Kühn Newbie

            Yes, deploy.tomcat was the target I used.

            As far I can tell, the problem is the components.xml file that is created.

            Mine is:

            <components>
            
             <component name="org.jboss.seam.core.init">
             <property name="myFacesLifecycleBug">false</property>
             <property name="debug">true</property>
             </component>
            
             <!-- 120 second conversation timeout -->
             <component name="org.jboss.seam.core.manager">
             <property name="conversationTimeout">120000</property>
             </component>
            
             <!-- Bootstrap Hibernate -->
             <component name="bookingDatabase"
             class="org.jboss.seam.core.ManagedHibernateSession"/>
             <component class="org.jboss.seam.core.Hibernate"/>
             <component class="org.jboss.seam.core.Microcontainer"
             installed=""/>
            
            </components>


            When I remove the installed-attribute, the JNDI Service is available, but hibernate is initialised 2 times. But that's another issue.

            Could you plz check if deploy.tomcat works for you and what the content of your components.xml file is.

            Thanks!