I am new to JBoss and hope someone is willing/able to help with this problem. Thanks in
advance for any help you can provide.
I've successfully deployed Session Beans and performed JNDI lookups on them, but
cannot seem to do the same with a BMP. I've read many posts and tried a number of
different things to no avail.
There are no compile errors and when I deploy the BMP, JBoss gives no errors to indicate
there is a problem. When I run a test program that performs a lookup on the ejb it fails
with the error "ejb not bound". In the case of the error it is referring to the
ejb directory node where I am attempting to register the BMPCustomer ejb.
When I access the JBoss JMX Console, I can see the CustomerApplication and Customer.jar
(contains the BMPCustomer ejb) deployed. However, when I use the JNDIView bean under the
console to view the JNDI listing, it doesn't contain an "ejb" node or any
reference, anywhere, for the BMPCustomer ejb. However, the persistence unit associated
with the ejb is registered under the Global JNDI Namespace, so it seems to be registering
some of the components.
The following are the JBoss log, ejb-jar.xml file, jboss.xml file and the code snippet
used to perform the JNDI lookup.
The following is the JBoss log...
| 14:31:50,210 INFO [Server] Starting JBoss (MX MicroKernel)...
| 14:31:50,211 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build:
SVNTag=JBoss_4_2_2_GA date=200710221139)
| 14:31:50,213 INFO [Server] Home Dir: C:\Program Files\jboss-4.2.2.GA
| 14:31:50,213 INFO [Server] Home URL: file:/C:/Program Files/jboss-4.2.2.GA/
| 14:31:50,214 INFO [Server] Patch URL: null
| 14:31:50,214 INFO [Server] Server Name: default
| 14:31:50,215 INFO [Server] Server Home Dir: C:\Program
Files\jboss-4.2.2.GA\server\default
| 14:31:50,215 INFO [Server] Server Home URL: file:/C:/Program
Files/jboss-4.2.2.GA/server/default/
| 14:31:50,215 INFO [Server] Server Log Dir: C:\Program
Files\jboss-4.2.2.GA\server\default\log
| 14:31:50,216 INFO [Server] Server Temp Dir: C:\Program
Files\jboss-4.2.2.GA\server\default\tmp
| 14:31:50,216 INFO [Server] Root Deployment Filename: jboss-service.xml
| 14:31:50,582 INFO [ServerInfo] Java version: 1.6.0_03,Sun Microsystems Inc.
| 14:31:50,582 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.6.0_03-b05,Sun
Microsystems Inc.
| 14:31:50,582 INFO [ServerInfo] OS-System: Windows Vista 6.0,x86
| 14:31:51,370 INFO [Server] Core system initialized
| 14:31:53,585 INFO [WebService] Using RMI server codebase:
http://127.0.0.1:8083/
| 14:31:53,588 INFO [Log4jService$URLWatchTimerTask] Configuring from URL:
resource:jboss-log4j.xml
| 14:31:54,116 INFO [TransactionManagerService] JBossTS Transaction Service (JTA
version) - JBoss Inc.
| 14:31:54,116 INFO [TransactionManagerService] Setting up property manager MBean and
JMX layer
| 14:31:54,369 INFO [TransactionManagerService] Starting recovery manager
| 14:31:54,642 INFO [TransactionManagerService] Recovery manager started
| 14:31:54,642 INFO [TransactionManagerService] Binding TransactionManager JNDI
Reference
| 14:31:57,665 INFO [EJB3Deployer] Starting java:comp multiplexer
| 14:31:58,014 INFO [STDOUT] no object for null
| 14:31:58,017 INFO [STDOUT] no object for null
| 14:31:58,039 INFO [STDOUT] no object for null
| 14:31:58,062 INFO [STDOUT] no object for {urn:jboss:bean-deployer}supplyType
| 14:31:58,074 INFO [STDOUT] no object for {urn:jboss:bean-deployer}dependsType
| 14:32:00,484 INFO [NativeServerConfig] JBoss Web Services - Native
| 14:32:00,484 INFO [NativeServerConfig] jbossws-native-2.0.1.SP2 (build=200710210837)
| 14:32:01,598 INFO [Embedded] Catalina naming disabled
| 14:32:01,803 INFO [AprLifecycleListener] The Apache Tomcat Native library which
allows optimal performance in production environments was not found on the
java.library.path: C:\Program
Files\Java\jdk1.6.0_03\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program
Files\Java\jre1.6.0_03\bin\client;C:\Program
Files\Java\jre1.6.0_03\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program
Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio
Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\Program
Files\Java\jdk1.6.0_03\bin;C:\derby10321\bin
| 14:32:01,895 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on
http-127.0.0.1-8080
| 14:32:01,931 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 14:32:01,932 INFO [Catalina] Initialization processed in 333 ms
| 14:32:01,932 INFO [StandardService] Starting service jboss.web
| 14:32:01,935 INFO [StandardEngine] Starting Servlet Engine: JBossWeb/2.0.1.GA
| 14:32:01,999 INFO [Catalina] Server startup in 66 ms
| 14:32:02,137 INFO [TomcatDeployer] deploy, ctxPath=/,
warUrl=.../deploy/jboss-web.deployer/ROOT.war/
| 14:32:03,045 INFO [TomcatDeployer] deploy, ctxPath=/invoker,
warUrl=.../deploy/http-invoker.sar/invoker.war/
| 14:32:03,263 INFO [TomcatDeployer] deploy, ctxPath=/jbossws,
warUrl=.../deploy/jbossws.sar/jbossws-context.war/
| 14:32:03,399 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil,
warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
| 14:32:04,224 INFO [TomcatDeployer] deploy, ctxPath=/web-console,
warUrl=.../deploy/management/console-mgr.sar/web-console.war/
| 14:32:04,799 INFO [MailService] Mail Service bound to java:/Mail
| 14:32:05,027 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/jboss-ha-local-jdbc.rar
| 14:32:05,103 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/jboss-ha-xa-jdbc.rar
| 14:32:05,170 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/jboss-local-jdbc.rar
| 14:32:05,226 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/jboss-xa-jdbc.rar
| 14:32:05,303 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/jms/jms-ra.rar
| 14:32:05,364 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/mail-ra.rar
| 14:32:05,448 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml
in .../deploy/quartz-ra.rar
| 14:32:05,464 INFO [QuartzResourceAdapter] start quartz!!!
| 14:32:05,550 INFO [SimpleThreadPool] Job execution threads will use class loader of
thread: main
| 14:32:05,587 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
| 14:32:05,590 INFO [RAMJobStore] RAMJobStore initialized.
| 14:32:05,591 INFO [StdSchedulerFactory] Quartz scheduler
'DefaultQuartzScheduler' initialized from default resource file in Quartz package:
'quartz.properties'
| 14:32:05,591 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
| 14:32:05,591 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED
started.
| 14:32:05,908 INFO [STDOUT] [Server@bcfa38]: [Thread[hypersonic-hsqldb,5,jboss]]:
checkRunning(false) entered
| 14:32:05,909 INFO [STDOUT] [Server@bcfa38]: [Thread[hypersonic-hsqldb,5,jboss]]:
checkRunning(false) exited
| 14:32:05,909 INFO [STDOUT] [Server@bcfa38]: Startup sequence initiated from main()
method
| 14:32:05,909 INFO [STDOUT] [Server@bcfa38]: Loaded properties from [C:\Program
Files\jboss-4.2.2.GA\bin\server.properties]
| 14:32:05,912 INFO [STDOUT] [Server@bcfa38]: Initiating startup sequence...
| 14:32:05,927 INFO [ConnectionFactoryBindingService] Bound ConnectionManager
'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name
'java:DefaultDS'
| 14:32:05,971 INFO [STDOUT] [Server@bcfa38]: Server socket opened successfully in 57
ms.
| 14:32:06,687 INFO [A] Bound to JNDI name: queue/A
| 14:32:06,690 INFO [B] Bound to JNDI name: queue/B
| 14:32:06,692 INFO [C] Bound to JNDI name: queue/C
| 14:32:06,695 INFO [D] Bound to JNDI name: queue/D
| 14:32:06,697 INFO [ex] Bound to JNDI name: queue/ex
| 14:32:06,719 INFO [testTopic] Bound to JNDI name: topic/testTopic
| 14:32:06,721 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
| 14:32:06,724 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
| 14:32:06,728 INFO [testQueue] Bound to JNDI name: queue/testQueue
| 14:32:06,789 INFO [UILServerILService] JBossMQ UIL service available at :
/127.0.0.1:8093
| 14:32:06,826 INFO [DLQ] Bound to JNDI name: queue/DLQ
| 14:32:06,891 INFO [STDOUT] [Server@bcfa38]: Database [index=0, id=0,
db=file:C:\Program Files\jboss-4.2.2.GA\server\default\data\hypersonic\hsqldb, alias=]
opened sucessfully in 917 ms.
| 14:32:06,892 INFO [STDOUT] [Server@bcfa38]: Startup sequence completed in 978 ms.
| 14:32:06,892 INFO [STDOUT] [Server@bcfa38]: 2007-12-31 14:32:06.892 HSQLDB server
1.8.0 is online
| 14:32:06,892 INFO [STDOUT] [Server@bcfa38]: To close normally, connect and execute
SHUTDOWN SQL
| 14:32:06,892 INFO [STDOUT] [Server@bcfa38]: From command line, use [Ctrl]+[C] to
abort abruptly
| 14:32:06,981 INFO [ConnectionFactoryBindingService] Bound ConnectionManager
'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name
'java:JmsXA'
| 14:32:07,017 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console,
warUrl=.../deploy/jmx-console.war/
| 14:32:07,204 INFO [EARDeployer] Init J2EE application: file:/C:/Program
Files/jboss-4.2.2.GA/server/default/deploy/CustomerApplication.ear
| 14:32:07,769 INFO [JmxKernelAbstraction] creating wrapper delegate for:
org.jboss.ejb3.entity.PersistenceUnitDeployment
| 14:32:07,774 INFO [JmxKernelAbstraction] installing MBean:
persistence.units:ear=CustomerApplication.ear,unitName=BMPCustomer with dependencies:
| 14:32:07,774 INFO [JmxKernelAbstraction]
jboss.jca:name=DefaultDS,service=DataSourceBinding
| 14:32:07,777 INFO [PersistenceUnitDeployment] Starting persistence unit
persistence.units:ear=CustomerApplication.ear,unitName=BMPCustomer
| 14:32:07,810 INFO [Version] Hibernate EntityManager 3.2.1.GA
| 14:32:07,838 INFO [Version] Hibernate Annotations 3.2.1.GA
| 14:32:07,847 INFO [Environment] Hibernate 3.2.4.sp1
| 14:32:07,856 INFO [Environment] hibernate.properties not found
| 14:32:07,858 INFO [Environment] Bytecode provider name : javassist
| 14:32:07,865 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
| 14:32:08,054 INFO [Configuration] Reading mappings from resource : META-INF/orm.xml
| 14:32:08,145 INFO [Ejb3Configuration] [PersistenceUnit: BMPCustomer] META-INF/orm.xml
found
| 14:32:08,563 INFO [ConnectionProviderFactory] Initializing connection provider:
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
| 14:32:08,567 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
| 14:32:08,571 INFO [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
| 14:32:08,571 INFO [SettingsFactory] JDBC driver: HSQL Database Engine Driver,
version: 1.8.0
| 14:32:08,598 INFO [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
| 14:32:08,665 INFO [TransactionFactoryFactory] Transaction strategy:
org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
| 14:32:08,685 INFO [TransactionManagerLookupFactory] instantiating
TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
| 14:32:08,688 INFO [TransactionManagerLookupFactory] instantiated
TransactionManagerLookup
| 14:32:08,688 INFO [SettingsFactory] Automatic flush during beforeCompletion():
disabled
| 14:32:08,688 INFO [SettingsFactory] Automatic session close at end of transaction:
disabled
| 14:32:08,688 INFO [SettingsFactory] JDBC batch size: 15
| 14:32:08,688 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
| 14:32:08,689 INFO [SettingsFactory] Scrollable result sets: enabled
| 14:32:08,690 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
| 14:32:08,690 INFO [SettingsFactory] Connection release mode: auto
| 14:32:08,691 INFO [SettingsFactory] Default batch fetch size: 1
| 14:32:08,691 INFO [SettingsFactory] Generate SQL with comments: disabled
| 14:32:08,691 INFO [SettingsFactory] Order SQL updates by primary key: disabled
| 14:32:08,691 INFO [SettingsFactory] Order SQL inserts for batching: disabled
| 14:32:08,691 INFO [SettingsFactory] Query translator:
org.hibernate.hql.ast.ASTQueryTranslatorFactory
| 14:32:08,695 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
| 14:32:08,695 INFO [SettingsFactory] Query language substitutions: {}
| 14:32:08,695 INFO [SettingsFactory] JPA-QL strict compliance: enabled
| 14:32:08,695 INFO [SettingsFactory] Second-level cache: enabled
| 14:32:08,695 INFO [SettingsFactory] Query cache: disabled
| 14:32:08,695 INFO [SettingsFactory] Cache provider:
org.hibernate.cache.HashtableCacheProvider
| 14:32:08,697 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
| 14:32:08,697 INFO [SettingsFactory] Cache region prefix:
CustomerApplication_ear,BMPCustomer
| 14:32:08,697 INFO [SettingsFactory] Structured second-level cache entries: disabled
| 14:32:08,710 INFO [SettingsFactory] Statistics: disabled
| 14:32:08,710 INFO [SettingsFactory] Deleted entity synthetic identifier rollback:
disabled
| 14:32:08,711 INFO [SettingsFactory] Default entity-mode: pojo
| 14:32:08,712 INFO [SettingsFactory] Named query checking : enabled
| 14:32:08,756 INFO [SessionFactoryImpl] building session factory
| 14:32:08,763 INFO [SessionFactoryObjectFactory] Factory name:
persistence.units:ear=CustomerApplication.ear,unitName=BMPCustomer
| 14:32:08,765 INFO [NamingHelper] JNDI InitialContext
properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 14:32:08,770 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name:
persistence.units:ear=CustomerApplication.ear,unitName=BMPCustomer
| 14:32:08,771 WARN [SessionFactoryObjectFactory] InitialContext did not implement
EventContext
| 14:32:08,771 INFO [NamingHelper] JNDI InitialContext
properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 14:32:08,780 INFO [EJB3Deployer] Deployed: file:/C:/Program
Files/jboss-4.2.2.GA/server/default/tmp/deploy/tmp38357CustomerApplication.ear-contents/Customer.jar
| 14:32:08,795 INFO [EARDeployer] Started J2EE application: file:/C:/Program
Files/jboss-4.2.2.GA/server/default/deploy/CustomerApplication.ear
| 14:32:08,902 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 14:32:08,935 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 14:32:08,945 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build:
SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 18s:726ms
|
|
| The following is the ejb-jar.xml...
|
| <?xml version="1.0" encoding="UTF-8"?>
| |
| | <ejb-jar id="ejb-jar_1"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
| |
| | <description>Customer</description>
| | <display-name>Customer</display-name>
| |
| | <enterprise-beans>
| | <!-- Entity Beans -->
| | <entity id="BMPCustomer">
| | <description>Customer BMP</description>
| | <display-name>BMPCustomer</display-name>
| | <ejb-name>BMPCustomer</ejb-name>
| | <home>bank.BMPCustomerHome</home>
| | <remote>bank.BMPCustomer</remote>
| | <local-home>bank.BMPCustomerLocalHome</local-home>
| | <local>bank.BMPCustomerLocal</local>
| | <ejb-class>bank.BMPCustomerBean</ejb-class>
| | <persistence-type>Bean</persistence-type>
| | <prim-key-class>java.lang.Integer</prim-key-class>
| | <reentrant>false</reentrant>
| | <primkey-field>userid</primkey-field>
| | <resource-ref>
| | <description>customer database</description>
| | <res-ref-name>java:/DefaultDS</res-ref-name>
| | <res-type>javax.sql.DataSource</res-type>
| | <res-auth>Container</res-auth>
| | </resource-ref>
| | <security-identity>
| | <use-caller-identity></use-caller-identity>
| | </security-identity>
| | </entity>
| | </enterprise-beans>
| |
| | <ejb-client-jar>CustomerClient.jar</ejb-client-jar>
| |
| | </ejb-jar>
| |
| |
|
| The following is the jboss.xml file...
|
| <?xml version="1.0" encoding="UTF-8"?>
| | <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
| |
| | <jboss>
| |
| | <enterprise-beans>
| |
| | <entity>
| | <ejb-name>BMPCustomer</ejb-name>
| | <jndi-name>ejb/BMPCustomer</jndi-name>
| | <local-jndi-name>ejb/BMPCustomer</local-jndi-name>
| | <method-attributes>
| | </method-attributes>
| |
| | </entity>
| |
| | </enterprise-beans>
| |
| | </jboss>
| |
|
| The following is the code used for the JNDI lookup...
|
|
| | Hashtable<String,String> props = new Hashtable<String,String>();
| | props.put
("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
| | props.put
("java.naming.provider.url","jnp://localhost:1099");
| | try {
| | c = new InitialContext(props);
| | result = c.lookup("ejb/BMPCustomer");
| | } catch(NamingException ne) {
| | ne.printStackTrace();
| | }
| |
|
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116197#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...