Hi,
I'm had write simple ejb3 program which lookup the session bean from a servlet in the web container.
I'm using Netbean5.5 with Java 1.6 and Jboss 4.0.5 GA.
The program is running fine in my local pc but was failed to lookup the session bean if deployed in my linux server which running on the same Jboss version.
I found from the deploy logs that the database connection was not able to Bound when deploying in server.
Is there any other setting file is required besides the persistence.xml? Please advice.
Below here is my persistence.xml contents:
<?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="BilltoBillApp-ejbPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/skDirectPaymentDS</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
Below here is the logs while deploying in my local pc:
12:34:50,451 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=skDirectPaymentDS' to JNDI name 'java:skDirectPaymentDS'
12:34:50,794 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
.
.
.
12:34:57,059 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/BilltoBillApp.ear
12:35:10,011 INFO [Ejb3Deployment] EJB3 deployment time took: 2540
12:35:10,463 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,unitName=BilltoBillApp-ejbPU with dependencies:
12:35:10,463 INFO [JmxKernelAbstraction] jboss.jca:name=skDirectPaymentDS,service=DataSourceBinding
12:35:10,604 INFO [Version] Hibernate EntityManager 3.2.0.GA
12:35:10,619 INFO [Version] Hibernate Annotations 3.2.0.GA
12:35:10,619 INFO [Environment] Hibernate 3.2.0.ga
12:35:10,666 INFO [Environment] hibernate.properties not found
12:35:10,884 INFO [Environment] Bytecode provider name : javassist
12:35:10,884 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
12:35:11,383 INFO [Ejb3Configuration] found EJB3 Entity bean: directpayment.skPaymentEntity
12:35:11,398 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
12:35:11,632 INFO [Configuration] Reading mappings from resource: META-INF/orm.xml
12:35:11,648 INFO [Ejb3Configuration] [PersistenceUnit: BilltoBillApp-ejbPU] no META-INF/orm.xml found
12:35:12,053 INFO [AnnotationBinder] Binding entity from annotated class: directpayment.skPaymentEntity
12:35:12,162 INFO [EntityBinder] Bind entity directpayment.skPaymentEntity on table sk_directpayment
12:35:13,253 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
12:35:13,253 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
12:35:15,420 INFO [SettingsFactory] RDBMS: MySQL, version: 5.0.27
12:35:15,420 INFO [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.11 ( $Date: 2005-09-21 18:20:03 +0000 (Wed, 21 Sep 2005) $, $Revision: 4287 $ )
12:35:15,451 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
12:35:15,451 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
12:35:15,451 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
12:35:15,482 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
12:35:15,482 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
12:35:15,482 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
12:35:15,482 INFO [SettingsFactory] JDBC batch size: 15
12:35:15,482 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
12:35:15,482 INFO [SettingsFactory] Scrollable result sets: enabled
12:35:15,482 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
12:35:15,482 INFO [SettingsFactory] Connection release mode: auto
12:35:15,482 INFO [SettingsFactory] Maximum outer join fetch depth: 2
12:35:15,482 INFO [SettingsFactory] Default batch fetch size: 1
12:35:15,482 INFO [SettingsFactory] Generate SQL with comments: disabled
12:35:15,482 INFO [SettingsFactory] Order SQL updates by primary key: disabled
12:35:15,482 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
12:35:15,482 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
12:35:15,482 INFO [SettingsFactory] Query language substitutions: {}
12:35:15,482 INFO [SettingsFactory] JPA-QL strict compliance: enabled
12:35:15,482 INFO [SettingsFactory] Second-level cache: enabled
12:35:15,482 INFO [SettingsFactory] Query cache: disabled
12:35:15,482 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
12:35:15,482 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
12:35:15,482 INFO [SettingsFactory] Structured second-level cache entries: disabled
12:35:15,498 INFO [SettingsFactory] Echoing all SQL to stdout
12:35:15,498 INFO [SettingsFactory] Statistics: disabled
12:35:15,498 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
12:35:15,498 INFO [SettingsFactory] Default entity-mode: pojo
12:35:16,417 INFO [SessionFactoryImpl] building session factory
12:35:17,243 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
12:35:17,243 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming
rg.jnp.interfaces}
12:35:17,383 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,name=skPaymentEntityFacade,service=EJB3 with dependencies:
12:35:17,383 INFO [JmxKernelAbstraction] persistence.units:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,unitName=BilltoBillApp-ejbPU
12:35:18,022 INFO [EJBContainer] STARTED EJB: directpayment.skPaymentEntityFacade ejbName: skPaymentEntityFacade
12:35:18,178 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,name=skPayment,service=EJB3 with dependencies:
12:35:18,178 INFO [JmxKernelAbstraction] persistence.units:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,unitName=BilltoBillApp-ejbPU
12:35:18,178 INFO [EJBContainer] STARTED EJB: directpayment.skPaymentEntityFacade ejbName: skPayment
12:35:18,272 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp16002BilltoBillApp.ear-contents/BilltoBillApp-ejb.jar
12:35:18,319 INFO [TomcatDeployer] deploy, ctxPath=/BilltoBillApp-war, warUrl=.../tmp/deploy/tmp16002BilltoBillApp.ear-contents/BilltoBillApp-war-exp.war/
12:35:20,158 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/BilltoBillApp.ear
Below here is the logs while deploying in my linux server:
13:43:49,454 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java
efaultDS'
.
.
.
13:43:52,459 INFO [EARDeployer] Init J2EE application: file:/data/opt/jboss-4.0.5.GA-ARCOT/server/default/deploy/BilltoBillApp.ear
13:43:53,468 INFO [Ejb3Deployment] EJB3 deployment time took: 49
13:43:53,478 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,unitName=BilltoBillApp-ejbPU with dependencies:
13:43:53,478 INFO [JmxKernelAbstraction] jboss.jca:name=skDirectPaymentDS,service=ManagedConnectionFactory
13:43:53,486 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,name=skPaymentEntityFacade,service=EJB3 with dependencies:
13:43:53,486 INFO [JmxKernelAbstraction] persistence.units:ear=BilltoBillApp.ear,jar=BilltoBillApp-ejb.jar,unitName=BilltoBillApp-ejbPU
13:43:53,489 INFO [EJB3Deployer] Deployed: file:/data/opt/jboss-4.0.5.GA-ARCOT/server/default/tmp/deploy/tmp9981BilltoBillApp.ear-contents/BilltoBillApp-ejb.jar
13:43:53,496 INFO [TomcatDeployer] deploy, ctxPath=/BilltoBillApp-war, warUrl=.../tmp/deploy/tmp9981BilltoBillApp.ear-contents/BilltoBillApp-war-exp.war/
13:43:53,639 INFO [EARDeployer] Started J2EE application: file:/data/opt/jboss-4.0.5.GA-ARCOT/server/default/deploy/BilltoBillApp.ear