4 Replies Latest reply on Dec 25, 2001 8:27 PM by ma zhenduo

    is there some problem in my deploy file?

    ma zhenduo Newbie

      my deploy directory is
      |-*.class
      |-META-INF
      |-ejb.xml
      |-jbosscmp-jdbc.xml

      ejb.xml is
      -------------------------------------------------
      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd'>
      <ejb-jar>
      <display-name>Material</display-name>
      <enterprise-beans>

      <ejb-name>MaterialBean</ejb-name>
      MaterialHome
      Material
      <ejb-class>MaterialBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      <primkey-field>materialID</primkey-field>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>MaterialBean</abstract-schema-name>
      <cmp-field>
      <field-name>materialID</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>price</field-name>
      </cmp-field>

      </enterprise-beans>
      <assembly-descriptor>
      <container-transaction>

      <ejb-name>MaterialBean</ejb-name>
      <method-intf>Home</method-intf>
      <method-name>*</method-name>


      <ejb-name>MaterialBean</ejb-name>
      <method-name>*</method-name>


      <ejb-name>MaterialBean</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

      -------------------------------------------------

      jbosscmp-jdbc.xml is
      -------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <jbosscmp-jdbc>

      java:/MSSQL2000DS
      <type-mapping>MS SQLSERVER2000</type-mapping>
      false
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <tuned-updates>false</tuned-updates>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <select-for-update>false</select-for-update>
      <pk-constraint>true</pk-constraint>
      <relation-mapping-style>foreign-key</relation-mapping-style>


      <enterprise-beans>

      <ejb-name>MaterialBean</ejb-name>
      <table-name>Material</table-name>
      <create-table>false</create-table>
      <cmp-field>
      <field-name>materialID</field-name>
      <column-name>materialID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>price</field-name>
      <column-name>price</column-name>
      </cmp-field>

      </enterprise-beans>
      </jbosscmp-jdbc>
      -------------------------------------------------

      when first start jboss3 server,log file is
      -------------------------------------------------
      [2001-12-24 18:30:42,396,AutoDeployer,INFO] Auto deploy of file:/E:/JBoss3/deploy/testejb.jar
      [2001-12-24 18:30:42,396,J2eeDeployer#Default,INFO] Deploy J2EE application: file:/E:/JBoss3/deploy/testejb.jar
      [2001-12-24 18:30:42,416,J2eeDeployer#Default,INFO] Create application testejb.jar
      [2001-12-24 18:30:42,426,J2eeDeployer#Default,INFO] install EJB module testejb.jar
      [2001-12-24 18:30:42,626,J2eeDeployer#Default,INFO] about to invoke deploy on jardeployer:JBOSS-SYSTEM:service=ContainerFactory
      [2001-12-24 18:30:42,636,ContainerFactory,INFO] got to deploy in ContainerFactory
      [2001-12-24 18:30:42,636,ContainerFactory,INFO] Deploying:file:/E:/JBoss3/deploy/Default/testejb.jar
      [2001-12-24 18:30:42,726,ContainerFactory,INFO] Verifying file:/E:/JBoss3/deploy/Default/testejb.jar/ejb1003.jar
      [2001-12-24 18:30:42,746,ContainerFactory,INFO] Deploying MaterialBean
      [2001-12-24 18:30:42,927,JRMPContainerInvoker,DEBUG] Container Invoker RMI Port='4444'
      [2001-12-24 18:30:42,927,JRMPContainerInvoker,DEBUG] Container Invoker Client SocketFactory='Default'
      [2001-12-24 18:30:42,927,JRMPContainerInvoker,DEBUG] Container Invoker Server SocketFactory='Default'
      [2001-12-24 18:30:42,927,JRMPContainerInvoker,DEBUG] Container Invoker Server SocketAddr='Default'
      [2001-12-24 18:30:42,927,JRMPContainerInvoker,DEBUG] Container Invoker Optimize='true'
      [2001-12-24 18:30:43,217,EntityContainer,DEBUG] Begin java:comp/env for EJB: MaterialBean
      [2001-12-24 18:30:43,217,EntityContainer,DEBUG] TCL: java.net.URLClassLoader@701bdc
      [2001-12-24 18:30:43,217,EntityContainer,DEBUG] End java:comp/env for EJB: MaterialBean
      [2001-12-24 18:30:43,237,JRMPContainerInvoker,DEBUG] JRMP 1.3 CI initialized
      [2001-12-24 18:30:43,297,CMP,DEBUG] Loading standardjbosscmp-jdbc.xml : file:/E:/JBoss3//conf/default/standardjbosscmp-jdbc.xml
      [2001-12-24 18:30:43,347,CMP,DEBUG] jar:file:/E:/JBoss3/deploy/Default/testejb.jar/ejb1003.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
      [2001-12-24 18:30:43,357,ConnectionFactoryLoader,DEBUG] ConnectionFactoryLoader.getObjectInstance, name = 'MSSQL2000DS'
      [2001-12-24 18:30:43,397,CMP,DEBUG] Initializing CMP plugin for MaterialBean
      [2001-12-24 18:30:43,518,BaseLocalContainerInvoker,DEBUG] MaterialBean cannot be Bound, doesn't have local home.
      [2001-12-24 18:30:43,518,AutoDeployer,DEBUG] Received notification of mbean J2EE:service=EJB,jndiName=MaterialBean's deployment.
      [2001-12-24 18:30:43,538,JRMPContainerInvoker,DEBUG] Bound MaterialBean to MaterialBean
      [2001-12-24 18:30:43,558,EnterpriseContextCachePolicy,INFO] Cache policy scheduler started
      [2001-12-24 18:30:43,898,MSSQL2000DS,DEBUG] Pool MSSQL2000DS gave out new object: org.jboss.resource.adapter.jdbc.local.JDBCManagedConnection@ca208
      [2001-12-24 18:30:43,948,MSSQL2000DS,DEBUG] Connection handle 'org.jboss.resource.adapter.jdbc.local.ConnectionInPool@1f7708' issued by connection manager 'org.jboss.resource.connectionmanager.jboss.MinervaSharedLocalCM@3fbfb8' from mcf 'org.jboss.resource.adapter.jdbc.local.JDBCManagedConnectionFactory@401e99'
      [2001-12-24 18:30:44,158,CMP,INFO] Table 'Material' already exists
      [2001-12-24 18:30:44,209,MSSQL2000DS,DEBUG] Connection handle 'org.jboss.resource.adapter.jdbc.local.ConnectionInPool@1f7708' closed from connection manager 'org.jboss.resource.connectionmanager.jboss.MinervaSharedLocalCM@3fbfb8' from mcf 'org.jboss.resource.adapter.jdbc.local.JDBCManagedConnectionFactory@401e99'
      [2001-12-24 18:30:44,219,MSSQL2000DS,DEBUG] Pool MSSQL2000DS [0/1/10] returned object org.jboss.resource.adapter.jdbc.local.JDBCManagedConnection@ca208 to the pool.
      [2001-12-24 18:30:44,229,CMP,DEBUG] Finder: name
      [2001-12-24 18:30:44,229,AutoDeployer,DEBUG] Received notification of mbean Management:jndiName=MaterialBean's deployment.
      [2001-12-24 18:30:44,229,ContainerManagement,INFO] Starting
      [2001-12-24 18:30:44,239,ContainerManagement,INFO] Started
      [2001-12-24 18:30:44,239,ContainerFactory,INFO] Deployed application: file:/E:/JBoss3/deploy/Default/testejb.jar
      [2001-12-24 18:30:44,249,J2eeDeployer#Default,INFO] J2EE application: file:/E:/JBoss3/deploy/testejb.jar is deployed.
      -------------------------------------------------

      when create a new bean, log file is
      -------------------------------------------------
      [2001-12-24 18:32:37,437,TxCapsule,DEBUG] Created new instance for tx=XidImpl [FormatId=257, GlobalId=yema//0, BranchQual=]
      [2001-12-24 18:32:37,437,TxManager,DEBUG] began tx: TransactionImpl:XidImpl [FormatId=257, GlobalId=yema//0, BranchQual=]
      [2001-12-24 18:32:37,477,CMP,DEBUG] java.lang.NullPointerException
      [2001-12-24 18:32:37,477,CMP,DEBUG] java.lang.NullPointerException
      [2001-12-24 18:32:37,477,TxCapsule,DEBUG] Committing, tx=XidImpl [FormatId=257, GlobalId=yema//0, BranchQual=], status=STATUS_ACTIVE
      [2001-12-24 18:32:37,477,TxCapsule,DEBUG] Before completion done, tx=XidImpl [FormatId=257, GlobalId=yema//0, BranchQual=], status=STATUS_ACTIVE
      [2001-12-24 18:32:37,477,TxCapsule,DEBUG] Zero phase commit: No resources.
      [2001-12-24 18:32:37,477,TxCapsule,DEBUG] Committed OK, tx=XidImpl [FormatId=257, GlobalId=yema//0, BranchQual=]
      [2001-12-24 18:32:37,487,EntityContainer,ERROR] invoke returned an exception
      javax.ejb.CreateException: Could not create entity:java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:94)
      at org.jboss.ejb.plugins.cmp.CMPStoreManager.createEntity(CMPStoreManager.java:169)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:253)
      at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:673)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:926)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:74)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:74)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:234)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:151)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:104)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:100)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:156)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:56)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:106)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:441)
      at org.jboss.ejb.Container.invoke(Container.java:536)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:368)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      at sun.rmi.transport.Transport$1.run(Transport.java:142)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643)
      at java.lang.Thread.run(Thread.java:484)

      -------------------------------------------------

      when deploy testejb.jar again, log file is
      -------------------------------------------------
      [2001-12-24 18:33:30,796,ContainerFactory,ERROR] Could not deploy file:/E:/JBoss3/deploy/Default/testejb.jar/
      java.lang.NullPointerException
      at org.jboss.resource.adapter.jdbc.local.JDBCManagedConnectionFactory.matchManagedConnections(JDBCManagedConnectionFactory.java:447)
      at org.jboss.resource.connectionmanager.ManagedConnectionPoolFactory.checkValidObject(ManagedConnectionPoolFactory.java:106)
      at org.jboss.pool.ObjectPool.getObject(ObjectPool.java:639)
      at org.jboss.resource.connectionmanager.SharedLocalConnectionManager.allocateConnection(SharedLocalConnectionManager.java:124)
      at org.jboss.resource.adapter.jdbc.JDBCDataSource.getConnection(JDBCDataSource.java:110)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.getConnection(JDBCStoreManager.java:303)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:65)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:41)
      at org.jboss.ejb.plugins.cmp.CMPStoreManager.start(CMPStoreManager.java:142)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:137)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:186)
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:354)
      at org.jboss.ejb.Application.start(Application.java:206)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:382)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:308)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:467)
      at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:444)
      at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:215)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at java.lang.Thread.run(Thread.java:484)

      -------------------------------------------------
      why?

      thank a lot.


        • 1. Re: is there some problem in my deploy file?
          David Jencks Master

          I think there may be a configuration problem with your ConnectionFactoryLoader. Could you post the exact version of jboss you are using (3.0 alpha or cvs from when) and the ConnectionFactoryLoader *-service.xml?

          • 2. Re: is there some problem in my deploy file?
            ma zhenduo Newbie

            Jboss version is 3.0 alpha.
            the context of mssqlds-service.xml is
            ---------------------------------------------
            <?xml version="1.0" encoding="UTF-8"?>


            <!-- ===================================================================== -->
            <!-- -->
            <!-- JBoss Server Configuration -->
            <!-- -->
            <!-- ===================================================================== -->

            <!-- $Id: hsqldb-default-service.xml,v 1.5 2001/11/20 22:15:23 d_jencks Exp $ -->







            <!-- ==================================================================== -->
            <!-- JDBC - Initialize the databases -->
            <!-- to ConnectionFactoryLoader -->
            <!-- ==================================================================== -->


            ConnectionURL=jdbc:microsoft:sqlserver://jupiter:1433;db=erpdb;user=erp;password=erp
            DriverClass=com.microsoft.jdbc.sqlserver.SQLServerDriver

            MSSQL2000DS
            java:/TransactionManager

            <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
            <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
            #
            #Wed Aug 15 16:17:29 EDT 2001
            MinSize=0
            MaxSize=10
            BlockingTimeoutMillis=5000
            IdleTimeoutMinutes=30
            CleanupIntervalMinutes=10
            MaxIdleTimeoutPercent=1.0


            org.jboss.resource.security.ManyToOnePrincipalMapping




            • 3. Re: is there some problem in my deploy file?
              David Jencks Master

              The problem is caused by the ManagedConnectionFactory assuming that you have specified a user somewhere other than the URL. I fixed this in cvs (I think), so you might want to move to the cvs version. If so, you will have to change the "mbean-ref" tags to "depends" and in them "name=" to "optional-attribute-name=".

              If you wish to continue with jboss3.0Alpha you may be able to work around this problem by specifying user and password either in ManagedConnectionFactoryProperties or in PrincipalMappingProperties.

              • 4. Re: is there some problem in my deploy file?
                ma zhenduo Newbie

                thank you very very much.
                now,i change the url to
                jdbc:microsoft:sqlserver://jupiter:1433;db=erpdb

                and add
                UserName=erp
                password=erp

                CMP is ok.
                thank you again.