Use Glassfish JMS from remote client - java

I have glassfish installed on a server with a JMS ConnectionFactory set up jms/MyConnectionFactory with a resource type or javax.jms.ConnectionFactory.
I now want to access this from a client application on my local machine for this I have the following:
public static void main(String[] args) {
try{
Properties env = new Properties();
env.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
env.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
env.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
env.setProperty("org.omg.CORBA.ORBInitialHost", "10.97.3.74");
env.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
InitialContext initialContext = new InitialContext(env);
ConnectionFactory connectionFactory = null;
try {
connectionFactory = (ConnectionFactory)
initialContext.lookup("jms/MyConnectionFactory");
} catch (Exception e) {
System.out.println("JNDI API lookup failed: " + e.toString());
e.printStackTrace();
System.exit(1);
}
}catch(Exception e){ e.printStackTrace(System.err);
}
}
When I run my client I get the following output:
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
{org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, org.omg.CORBA.ORBInitialHost=10.97.3.74, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
19-Mar-2010 16:09:13 org.hibernate.validator.util.Version <clinit>
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
19-Mar-2010 16:09:13 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
19-Mar-2010 16:09:13 com.sun.messaging.jms.ra.ResourceAdapter start
INFO: MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting: REMOTE
19-Mar-2010 16:09:13 com.sun.messaging.jms.ra.ResourceAdapter start
INFO: MQJMSRA_RA1101: SJSMQ JMSRA Started:REMOTE
19-Mar-2010 16:09:13 com.sun.enterprise.naming.impl.SerialContext lookup
SEVERE: enterprise_naming.serialctx_communication_exception
19-Mar-2010 16:09:13 com.sun.enterprise.naming.impl.SerialContext lookup
SEVERE:
java.lang.RuntimeException: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: This pool is not bound in JNDI : jms/MyConnectionFactory
at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:159)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:472)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:437)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at simpleproducerclient.Main.main(Main.java:89)
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.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:424)
at org.glassfish.appclient.client.AppClientFacade.main(AppClientFacade.java:134)
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: This pool is not bound in JNDI : jms/MyConnectionFactory
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:1017)
at com.sun.enterprise.connectors.ConnectorRuntime.obtainManagedConnectionFactory(ConnectorRuntime.java:375)
at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:124)
... 11 more
Caused by: javax.naming.NamingException: Lookup failed for '__SYSTEM/pools/jms/MyConnectionFactory' in SerialContext targetHost=localhost,targetPort=3700,orb'sInitialHost=ithfdv01,orb'sInitialPort=3700 [Root exception is javax.naming.NameNotFoundException: pools]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getConnectorConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:804)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:932)
... 13 more
Caused by: javax.naming.NameNotFoundException: pools
at com.sun.enterprise.naming.impl.TransientContext.resolveContext(TransientContext.java:252)
at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:171)
at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:58)
at com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:89)
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 com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:146)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:176)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:682)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:216)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1841)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1695)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1078)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:221)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:797)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:561)
JNDI API lookup failed: javax.naming.CommunicationException: Communication exception for SerialContext targetHost=10.97.3.74,targetPort=3700,orb'sInitialHost=ithfdv01,orb'sInitialPort=3700 [Root exception is java.lang.RuntimeException: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: This pool is not bound in JNDI : jms/MyConnectionFactory]
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2558)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:492)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:528)
javax.naming.CommunicationException: Communication exception for SerialContext targetHost=10.97.3.74,targetPort=3700,orb'sInitialHost=ithfdv01,orb'sInitialPort=3700 [Root exception is java.lang.RuntimeException: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: This pool is not bound in JNDI : jms/MyConnectionFactory]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:461)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at simpleproducerclient.Main.main(Main.java:89)
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.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:424)
at org.glassfish.appclient.client.AppClientFacade.main(AppClientFacade.java:134)
Caused by: java.lang.RuntimeException: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: This pool is not bound in JNDI : jms/MyConnectionFactory
at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:159)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:472)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:437)
... 8 more
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: This pool is not bound in JNDI : jms/MyConnectionFactory
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:1017)
at com.sun.enterprise.connectors.ConnectorRuntime.obtainManagedConnectionFactory(ConnectorRuntime.java:375)
at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:124)
... 11 more
Caused by: javax.naming.NamingException: Lookup failed for '__SYSTEM/pools/jms/MyConnectionFactory' in SerialContext targetHost=localhost,targetPort=3700,orb'sInitialHost=ithfdv01,orb'sInitialPort=3700 [Root exception is javax.naming.NameNotFoundException: pools]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.getConnectorConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:804)
at com.sun.enterprise.connectors.service.ConnectorConnectionPoolAdminServiceImpl.obtainManagedConnectionFactory(ConnectorConnectionPoolAdminServiceImpl.java:932)
... 13 more
Caused by: javax.naming.NameNotFoundException: pools
at com.sun.enterprise.naming.impl.TransientContext.resolveContext(TransientContext.java:252)
at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:171)
at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:172)
at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:58)
at com.sun.enterprise.naming.impl.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:89)
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 com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:146)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:176)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:682)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:216)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1841)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1695)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1078)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:221)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:797)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:561)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2558)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:492)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:528)
I have looked at a number of posts and have tried a number of things with no success. I can run the following commands on my server:
./asadmin list-jndi-entries
UserTransaction: com.sun.enterprise.transaction.TransactionNamingProxy$UserTransactionProxy
java:global: com.sun.enterprise.naming.impl.TransientContext
jdbc: com.sun.enterprise.naming.impl.TransientContext
ejb: com.sun.enterprise.naming.impl.TransientContext
com.sun.enterprise.container.common.spi.util.InjectionManager: com.sun.enterprise.container.common.impl.util.InjectionManagerImpl
jms: com.sun.enterprise.naming.impl.TransientContext
Command list-jndi-entries executed successfully.
./asadmin list-jndi-entries --context jms
MyTopic: org.glassfish.javaee.services.ResourceProxy
MyConnectionFactory: org.glassfish.javaee.services.ResourceProxy
MyQueue: org.glassfish.javaee.services.ResourceProxy
Command list-jndi-entries executed successfully.
Any help is greatly appreciated.
Cheers,
James

Caused by: javax.naming.NameNotFoundException: pools
This seems to be caused by a bug which was fixed pretty recent (15 feb 2010). You need to upgrade to at least GF v3.0.1 build 05. Give it a try.

Related

Getting initialization error connecting to Oracle Driver

In my Spring Boot application I updated the application.properties to connect to Oracle DB as :
spring.datasource.url = jdbc:oracle:thin:#//${mysql.service.host}:${mysql.service.port}/${mysql.service.database}
spring.datasource.username = ${mysql.service.username}
spring.datasource.password = ${mysql.service.password}
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
and included the Oracle Driver dependency in build.gradle file as:
runtime group: 'com.oracle.database.jdbc', name: 'ojdbc11', version:'21.1.0.0'
But still facing error:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.driver.OracleDriver
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650)
20 common frames omitted
Caused by: java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.driver.OracleDriver
at org.springframework.util.Assert.state(Assert.java:97)
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:223)
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:175)
org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:43)
at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
Any suggestions for the fix please?
it's possible...
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
:)

JndiLookupFailureException: JndiObjectTargetSource failed to obtain new target object

While connecting Db2 database from my application in WAS 8.5.5.10 I'm facing below exception. My application is built in 1.8 and I mentioned the db2 configuration details in web.xml. Guide me to resolve this.
org.springframework.jndi.JndiLookupFailureException: JndiObjectTargetSource failed to obtain new target object; nested exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is javax.xml.stream.FactoryConfigurationError: Provider javax.xml.stream.XMLInputFactory could not be instantiated: java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype]
at org.springframework.jndi.JndiObjectTargetSource.getTarget(JndiObjectTargetSource.java:139)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182)
at com.sun.proxy.$Proxy27.getConnection(Unknown Source)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:572)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:867)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:875)
Web.xml
<resource-ref id="FrontEnd_DataSource">
<description>DB2 database</description>
<res-ref-name>db2_DB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Anyone have idea about this?
[Root exception is javax.xml.stream.FactoryConfigurationError: Provider javax.xml.stream.XMLInputFactory could not be instantiated: java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype]
You might need to upgrade the Websphere to 8.5.5.12 or higher. See PI79731

Unable to start tomcat7 with webapp (spring + hibernate + hibernate search 4.5) NoClassDefFound : CorruptIndexException

I am trying to start my tomcat 7. It throws
ERROR [localhost-startStop-1] (ContextLoader.java:307) - Context initialization failed
Code:
Error creating bean with name 'sessionFactory' defined in
ServletContext resource [/WEB-INF/hibernate-config.xml]: Invocation of
init method failed; nested exception is
java.util.ServiceConfigurationError:
org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.search.hcore.impl.HibernateSearchIntegrator could not be
instantiated: java.lang.NoClassDefFoundError:
org/apache/lucene/index/CorruptIndexException
Caused by: java.lang.ClassNotFoundException:
org.apache.lucene.index.CorruptIndexException at
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:423) at
java.lang.ClassLoader.loadClass(ClassLoader.java:356)
You are missing org.apache.lucene.index.CorruptIndexException dependencies .. Check the required jars are in class path.

Running Maven Spring project in eclipse using Web preview server

getting an error while running in web preview server in eclipse but the same projects runs fine in tomcat.
Error
[ERROR ] SRVE0293E: [Servlet Error]-[Failed to load listener: org.springframework.web.context.ContextLoaderListener]: java.lang.ClassNotFoundException: org/springframework/web/context/ContextLoaderListener
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:75)
at com.sun.beans.finder.ClassFinder.findClass(ClassFinder.java:110)
at java.beans.Beans.instantiate(Beans.java:216)
at java.beans.Beans.instantiate(Beans.java:80)
at com.ibm.ws.webcontainer.webapp.WebApp.loadListener(WebApp.java:2176)
at [internal classes]
[ERROR ] SRVE0279E: Error occured while processing global listeners for the application {0}: {1}
java.lang.NullPointerException
[ERROR ] SRVE8052E: Logging ClassNotFoundException
org/springframework/web/servlet/DispatcherServlet
[ERROR ] SRVE0276E: Error while initializing Servlet [dispatcher]: javax.servlet.UnavailableException: SRVE0200E: Servlet [org.springframework.web.servlet.DispatcherServlet]: Could not find required class - org/springframework/web/servlet/DispatcherServlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1497)
at [internal classes]
[ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.servlet.UnavailableException: SRVE0200E: Servlet [org.springframework.web.servlet.DispatcherServlet]: Could not find required class - org/springframework/web/servlet/DispatcherServlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
at [internal classes]
Caused by: javax.servlet.UnavailableException: SRVE0200E: Servlet [org.springframework.web.servlet.DispatcherServlet]: Could not find required class - org/springframework/web/servlet/DispatcherServlet
... 3 more
this may cause by either
There is no Spring jars in WEB-INF/lib
or
You need to change WebSphere class load policy to PARENT LAST

How to deploy an EJB application to Glassfish server

When I am running a JSP file I am getting this error:
SEVERE: Exception while loading the app
java.lang.RuntimeException: EJB Container initialization error
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:219)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:197)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:63)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:310)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:195)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.RuntimeException: Error while binding JNDI name ejbExample.stateful.Account#ejbExample.stateful.Account for EJB : AccountBean
at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1530)
at com.sun.ejb.containers.StatefulSessionContainer.initializeHome(StatefulSessionContainer.java:214)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:161)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:207)
... 20 more
Caused by: javax.naming.NameAlreadyBoundException: Use rebind to override
at com.sun.enterprise.naming.impl.TransientContext.doBindOrRebind(TransientContext.java:275)
at com.sun.enterprise.naming.impl.TransientContext.bind(TransientContext.java:214)
at com.sun.enterprise.naming.impl.SerialContextProviderImpl.bind(SerialContextProviderImpl.java:79)
at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.bind(LocalSerialContextProviderImpl.java:81)
at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:586)
at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:602)
at javax.naming.InitialContext.bind(InitialContext.java:404)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:206)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:187)
at com.sun.ejb.containers.BaseContainer$JndiInfo.publish(BaseContainer.java:5533)
at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1515)
... 23 more
WARNING: [AutoDeploy] Autodeploy failed : C:\glassfishv3\glassfish\domains\domain1\autodeploy\StatefullSessionBeanExample.jar.
How is this caused and how can I solve it?
Try to undeploy the project (clean and build) and redeploy it .

Categories

Resources