4 Replies Latest reply on Jul 9, 2007 6:45 AM by laksu

    problem configuring SMPC with Glassfish

    laksu

      Hi,
      I have followed some topics from the forum and tried to convert my application to use SMPC.
      I use Glassfish and Seam 1.2.1

      Here is my components.xml:

      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:core="http://jboss.com/products/seam/core"
       xmlns:security="http://jboss.com/products/seam/security"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd
       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
      ">
       <core:init jndi-pattern="java:comp/env/gop-ejb/#{ejbName}/local" debug="true"/>
      
       <core:manager conversation-timeout="120000"
       concurrent-request-timeout="500"
       conversation-id-parameter="cid"
       conversation-is-long-running-parameter="clr"/>
      
      
       <core:entity-manager-factory name="gopFactory" persistence-unit-name="gopent-ejbPU" />
       <core:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{gopFactory}"/>
       <core:entity-converter entity-manager="${entityManager}"/>
      
       <core:transactionListener/>
      
       <security:identity authenticate-method="#{otantikamator.otantikmi}"/>
      
       <event type="org.jboss.seam.notLoggedIn">
       <action expression="#{redirect.captureCurrentView}"/>
       </event>
       <event type="org.jboss.seam.postAuthenticate">
       <action expression="#{redirect.returnToCapturedView}"/>
       </event>
      
       <component class="org.jboss.seam.web.MultipartFilter">
       <property name="createTempFiles">true</property>
       <property name="maxRequestSize">1000000</property>
       </component>
      
       <event type="isteklerRefresh">
       <action expression="#{isteklerAra.refresh}"/>
       </event>
      
      </components>
      


      and my persistence.xml:

      
      <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
       <persistence-unit name="transaction-type=" transaction-type="JTA">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>jdbc/gop</jta-data-source>
       <properties>
       <property name="hibernate.hbm2ddl.auto" value="update"/>
       <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
       <property name="hibernate.show_sql" value="true"/>
       <!--property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/-->
       <!--property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/-->
       <!--property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" /-->
       </properties>
       </persistence-unit>
      </persistence>
      


      I receive a rather absurd exception upon deployment:
      WEB0100: Loading web module [gop:gop-war.war] in virtual server [server] at [/gop-war]
      WebModule[/gop-war]Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.NullPointerException:
       at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:120)
       at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
       at org.jboss.seam.core.EntityManagerFactory.startup(EntityManagerFactory.java:74)
       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:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1842)
       at org.jboss.seam.Component.callCreateMethod(Component.java:1757)
       at org.jboss.seam.Component.newInstance(Component.java:1746)
       at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:175)
       at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:145)
       at org.jboss.seam.init.Initialization.init(Initialization.java:504)
       at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4236)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4760)
       at com.sun.enterprise.web.WebModule.start(WebModule.java:292)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:833)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:817)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1479)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1143)
       at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1068)
       at com.sun.enterprise.server.TomcatApplicationLoader.load(TomcatApplicationLoader.java:128)
       at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:322)
       at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:216)
       at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:189)
       at com.sun.enterprise.server.ApplicationManager.applicationEnabled(ApplicationManager.java:754)
      


      toplink?
      I must be missing something.

        • 1. Re: problem configuring SMPC with Glassfish
          gavin.king

          Um, yeah, TopLink shouldn't do that, I guess.


          Why not try looking at the "jpa" example, it has all this stuff working...

          • 2. Re: problem configuring SMPC with Glassfish
            laksu

            that was working before trying to switch to SMPC.
            ok, I have gone through the jpa example and changed a few things here and there, i still get the same thing. I cannot understand why it tries to get it to toplink. i have never used it and i had almost forgotten such a thing even existed.

            here follows my updated components, persistence and faces-config.xml files. I don't know if I should I be concerned about anything else?

            and, do you think it is a good idea asking about it to glassfish people?

            <?xml version="1.0" encoding="UTF-8"?>
            
            <components xmlns="http://jboss.com/products/seam/components"
             xmlns:core="http://jboss.com/products/seam/core"
             xmlns:security="http://jboss.com/products/seam/security"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="
             http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd
             http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
            ">
             <core:init jndi-pattern="java:comp/env/gop-ejb/#{ejbName}/local" debug="true"/>
            
             <core:manager conversation-timeout="120000"
             concurrent-request-timeout="500"
             conversation-id-parameter="cid"
             conversation-is-long-running-parameter="clr"/>
            
             <core:entity-manager-factory name="gopent-ejbPU" />
            
             <core:managed-persistence-context name="entityManager"
             auto-create="true"
             entity-manager-factory="#{gopent-ejbPU}"/>
            
             <security:identity authenticate-method="#{otantikamator.otantikmi}"/>
            
             <event type="org.jboss.seam.notLoggedIn">
             <action expression="#{redirect.captureCurrentView}"/>
             </event>
             <event type="org.jboss.seam.postAuthenticate">
             <action expression="#{redirect.returnToCapturedView}"/>
             </event>
            
             <component class="org.jboss.seam.web.MultipartFilter">
             <property name="createTempFiles">true</property>
             <property name="maxRequestSize">1000000</property>
             </component>
            
             <event type="isteklerRefresh">
             <action expression="#{isteklerAra.refresh}"/>
             </event>
            
            </components>
            

            <?xml version="1.0" encoding="UTF-8"?>
            <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
             <persistence-unit name="gopent-ejbPU" transaction-type="JTA">
             <provider>org.hibernate.ejb.HibernatePersistence</provider>
             <jta-data-source>jdbc/gop</jta-data-source>
             <properties>
             <property name="hibernate.hbm2ddl.auto" value="update"/>
             <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
             <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
            
             <property name="hibernate.show_sql" value="true"/>
             </properties>
             </persistence-unit>
            </persistence>
            
            


            <?xml version='1.0' encoding='UTF-8'?>
            <faces-config version="1.2"
             xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
            
             <application>
             <view-handler>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</view-handler>
             </application>
            
             <lifecycle>
             <phase-listener>org.jboss.seam.jsf.TransactionalSeamPhaseListener</phase-listener>
             </lifecycle>
            
             <application>
             <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>
             </application>
            </faces-config>
            


            • 3. Re: problem configuring SMPC with Glassfish
              pmuir

              Post the result of ls -R on your exploded built project.

              • 4. Re: problem configuring SMPC with Glassfish
                laksu

                This is the root project: gop.ear

                -rwx------+ 1 levent PROJE 433 Jul 9 12:35 J2EE.dpf
                drwx------+ 3 levent PROJE 0 Jul 9 10:05 META-INF
                -rwx------+ 1 levent PROJE 1214410 Jul 9 10:05 ajax4jsf-1.1.1-SNAPSHOT.jar
                -rwx------+ 1 levent PROJE 207723 Jul 9 10:05 commons-lang-2.1.jar
                -rwx------+ 1 levent PROJE 55365 Jul 9 12:35 gop-ejb.jar
                -rwx------+ 1 levent PROJE 49218 Jul 9 12:35 gop-war.war
                -rwx------+ 1 levent PROJE 2574777 Jul 9 10:05 hibernate-all.jar
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 jar
                -rwx------+ 1 levent PROJE 706964 Jul 9 10:05 jboss-cache-jdk50.jar
                -rwx------+ 1 levent PROJE 8210655 Jul 9 10:05 jboss-ejb3-all.jar
                -rwx------+ 1 levent PROJE 11426 Jul 9 10:05 jboss-seam-debug.jar
                -rwx------+ 1 levent PROJE 124446 Jul 9 10:05 jboss-seam-ui.jar
                -rwx------+ 1 levent PROJE 665529 Jul 9 10:05 jboss-seam.jar
                -rwx------+ 1 levent PROJE 287090 Jul 9 10:05 jsf-facelets.jar
                -rwx------+ 1 levent PROJE 124487 Jul 9 10:05 oscache-2.3.2.jar
                -rwx------+ 1 levent PROJE 823367 Jul 9 10:05 richfaces-3.0.1-SNAPSHOT.jar
                
                ./META-INF:
                total 3
                -rwx------+ 1 levent PROJE 23 Jul 9 10:05 MANIFEST.MF
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 META-INF
                -rwx------+ 1 levent PROJE 600 Jul 9 10:05 application.xml
                -rwx------+ 1 levent PROJE 250 Jul 9 10:05 sun-application.xml
                
                ./META-INF/META-INF:
                total 1
                -rwx------+ 1 levent PROJE 52 Jul 9 10:05 jboss-app.xml
                
                ./jar:
                total 0



                Here are the sub-projects
                EJB module gop-ejb.jar:

                .:
                total 0
                drwx------+ 4 levent PROJE 0 Jul 9 10:05 ear-module
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 jar
                
                ./ear-module:
                total 1
                drwx------+ 3 levent PROJE 0 Jul 9 12:35 META-INF
                drwx------+ 3 levent PROJE 0 Jul 9 10:05 datassist
                -rwx------+ 1 levent PROJE 41 Jul 9 10:05 seam.properties
                
                ./ear-module/META-INF:
                total 16
                -rwx------+ 1 levent PROJE 392 Jul 9 10:05 MANIFEST.MF
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 META-INF
                -rwx------+ 1 levent PROJE 763 Jul 9 10:05 ejb-jar.xml
                -rwx------+ 1 levent PROJE 48 Jul 9 10:05 jboss.xml
                -rwx------+ 1 levent PROJE 653 Jul 9 10:05 log4j.properties
                -rwx------+ 1 levent PROJE 939 Jul 9 12:35 persistence.xml
                -rwx------+ 1 levent PROJE 41 Jul 9 10:05 seam.properties
                -rwx------+ 1 levent PROJE 255 Jul 9 10:05 sun-ejb-jar.xml
                
                ./ear-module/META-INF/META-INF:
                total 1
                -rwx------+ 1 levent PROJE 48 Jul 9 10:05 jboss.xml
                
                ./ear-module/datassist:
                total 0
                drwx------+ 4 levent PROJE 0 Jul 9 10:05 gop
                
                ./ear-module/datassist/gop:
                total 0
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 action
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 domain
                
                ./ear-module/datassist/gop/action:
                total 46
                -rwx------+ 1 levent PROJE 9034 Jul 9 10:05 IstekForm.class
                -rwx------+ 1 levent PROJE 1288 Jul 9 10:05 IstekFormLocal.class
                -rwx------+ 1 levent PROJE 6193 Jul 9 10:05 IsteklerAra.class
                -rwx------+ 1 levent PROJE 666 Jul 9 10:05 IsteklerAraLocal.class
                -rwx------+ 1 levent PROJE 3193 Jul 9 10:05 KullaniciForm.class
                -rwx------+ 1 levent PROJE 650 Jul 9 10:05 KullaniciFormLocal.class
                -rwx------+ 1 levent PROJE 2618 Jul 9 10:05 KullanicilarAra.class
                -rwx------+ 1 levent PROJE 266 Jul 9 10:05 KullanicilarAraLocal.class
                -rwx------+ 1 levent PROJE 4029 Jul 9 10:05 Otantikamator.class
                -rwx------+ 1 levent PROJE 278 Jul 9 10:05 OtantikamatorLocal.class
                
                ./ear-module/datassist/gop/domain:
                total 29
                -rwx------+ 1 levent PROJE 496 Jul 9 10:05 Eklenti.class
                -rwx------+ 1 levent PROJE 7325 Jul 9 10:05 Istek.class
                -rwx------+ 1 levent PROJE 3952 Jul 9 10:05 Kullanici.class
                -rwx------+ 1 levent PROJE 2192 Jul 9 10:05 Olay.class
                -rwx------+ 1 levent PROJE 1752 Jul 9 10:05 Proje.class
                -rwx------+ 1 levent PROJE 2268 Jul 9 10:05 Uzman.class
                -rwx------+ 1 levent PROJE 1625 Jul 9 10:05 VaziyetDegisikligi.class
                
                ./jar:
                total 0


                and the web app: gop-war.war

                .:
                total 14624
                -rwx------+ 1 levent PROJE 1214410 Jul 9 10:05 ajax4jsf-1.1.1-SNAPSHOT.jar
                -rwx------+ 1 levent PROJE 207723 Jul 9 10:05 commons-lang-2.1.jar
                drwx------+ 6 levent PROJE 0 Jul 9 10:05 ear-module
                -rwx------+ 1 levent PROJE 2574777 Jul 9 10:05 hibernate-all.jar
                -rwx------+ 1 levent PROJE 706964 Jul 9 10:05 jboss-cache-jdk50.jar
                -rwx------+ 1 levent PROJE 8210655 Jul 9 10:05 jboss-ejb3-all.jar
                -rwx------+ 1 levent PROJE 11426 Jul 9 10:05 jboss-seam-debug.jar
                -rwx------+ 1 levent PROJE 124446 Jul 9 10:05 jboss-seam-ui.jar
                -rwx------+ 1 levent PROJE 665529 Jul 9 10:05 jboss-seam.jar
                -rwx------+ 1 levent PROJE 287090 Jul 9 10:05 jsf-facelets.jar
                -rwx------+ 1 levent PROJE 124487 Jul 9 10:05 oscache-2.3.2.jar
                -rwx------+ 1 levent PROJE 823367 Jul 9 10:05 richfaces-3.0.1-SNAPSHOT.jar
                
                ./ear-module:
                total 47
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 META-INF
                drwx------+ 3 levent PROJE 0 Jul 9 12:35 WEB-INF
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 css
                -rwx------+ 1 levent PROJE 574 Jul 9 10:05 form.xhtml
                -rwx------+ 1 levent PROJE 1600 Jul 9 10:05 genel.xhtml
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 img
                -rwx------+ 1 levent PROJE 445 Jul 9 10:05 index.jsp
                -rwx------+ 1 levent PROJE 14142 Jul 9 10:05 istek.xhtml
                -rwx------+ 1 levent PROJE 6688 Jul 9 10:05 istekler.xhtml
                -rwx------+ 1 levent PROJE 1768 Jul 9 10:05 kullanici.xhtml
                -rwx------+ 1 levent PROJE 2164 Jul 9 10:05 kullanicilar.xhtml
                -rwx------+ 1 levent PROJE 3000 Jul 9 10:05 login.xhtml
                -rwx------+ 1 levent PROJE 350 Jul 9 10:05 notBegun.xhtml
                -rwx------+ 1 levent PROJE 595 Jul 9 10:05 security_error.xhtml
                
                ./ear-module/META-INF:
                total 1
                -rwx------+ 1 levent PROJE 169 Jul 9 10:05 MANIFEST.MF
                
                ./ear-module/WEB-INF:
                total 22
                drwx------+ 2 levent PROJE 0 Jul 9 10:05 classes
                -rwx------+ 1 levent PROJE 2092 Jul 9 12:35 components.xml
                -rwx------+ 1 levent PROJE 875 Jul 9 12:21 faces-config.xml
                -rwx------+ 1 levent PROJE 1227 Jul 9 10:05 navigation.xml
                -rwx------+ 1 levent PROJE 700 Jul 9 10:05 pages.xml
                -rwx------+ 1 levent PROJE 713 Jul 9 10:05 sun-web.xml
                -rwx------+ 1 levent PROJE 6692 Jul 9 10:05 web.xml
                
                ./ear-module/WEB-INF/classes:
                total 0
                
                ./ear-module/css:
                total 4
                -rwx------+ 1 levent PROJE 1454 Jul 9 10:05 gop.css
                
                ./ear-module/img:
                total 5
                -rwx------+ 1 levent PROJE 753 Jul 9 10:05 admin.png
                -rwx------+ 1 levent PROJE 589 Jul 9 10:05 user.png