javax.naming.NameNotFoundException: TravelAgentBean not bound

I get this error and do not know what is causing it.  Could you please help?

javax.naming.NameNotFoundException: TravelAgentBean not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
mpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav

    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor

    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCP
va:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
a:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Thread
.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPool
a:908)
    at java.lang.Thread.run(Thread.java:662)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
teCall.java:255)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa

    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
    at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:72

    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:68

    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at titan.clients.Client.main(Client.java:17)

SFUL
2 seconds

seppa\Downloads\JEE Class\FirstBeans>

Open in new window

sunseAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gurpsbassiCommented:
what application server are you deploying to?
Check the JNDI name set up for the TravelAgentBean on the application server.
0
sunseAuthor Commented:
I made some changes.  I have imported FirstBeansTitan.jar which is in C:\Users\Giuseppa\Downloads\JEE Class\FirstBeans\build to the project's Referenced libraries and I have deployed it to C:\jboss-6.1.0.Final\server\default\deploy\applications.  Additionally, I have placed the mysql-ds.xml in C:\jboss-6.1.0.Final\server\default\lib

mysql-connector-java-5.1.36-bin.jar is in C:\jboss-6.1.0.Final\server\default\lib

Since I did this, I do not get the previous error any more, but a new one.  Could you please help with this?

Thanks,

  JBoss Bootstrap Environment

 
 JBOSS_HOME: C:\jboss-6.1.0.Final

  JAVA: C:\Java\jdk1.6.0_38\bin\java

  JAVA_OPTS: -Dprogram.name=run.bat -Dlogging.configuration=file:logging.propert
ies -Xms128M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=36000
00 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -Xr
unjdwp:transport=dt_socket,address=8000,server=y,suspend=n -server

  CLASSPATH: C:\Java\jdk1.6.0_38\lib\tools.jar;C:\jboss-6.1.0.Final\bin\run.jar

===============================================================================

Listening for transport dt_socket at address: 8000
Failed to boot JBoss:
org.jboss.bootstrap.api.config.InvalidConfigurationException: Could not get a co
nnection to the jboss.server.config.url: file:/C:/jboss-6.1.0.Final/server/defau
lt/conf
        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
.require(JBossASBasedConfigurationValidator.java:217)
        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
.require(JBossASBasedConfigurationValidator.java:187)
        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
.validate(JBossASBasedConfigurationValidator.java:120)
        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
.validate(JBossASBasedConfigurationValidator.java:43)
        at org.jboss.bootstrap.impl.base.server.AbstractServer.validate(Abstract
Server.java:1010)
        at org.jboss.bootstrap.impl.base.server.AbstractServer.doInitialize(Abst
ractServer.java:566)
        at org.jboss.bootstrap.impl.mc.server.AbstractMCServerBase.doInitialize(
AbstractMCServerBase.java:230)
        at org.jboss.bootstrap.impl.as.server.AbstractJBossASServerBase.doInitia
lize(AbstractJBossASServerBase.java:284)
        at org.jboss.bootstrap.impl.base.server.AbstractServer.initialize(Abstra
ctServer.java:524)
        at org.jboss.Main.boot(Main.java:469)
        at org.jboss.Main$1.run(Main.java:816)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.FileNotFoundException: C:\jboss-6.1.0.Final\server\default\co
nf
        at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnecti
on.java:105)
        at org.jboss.bootstrap.impl.as.config.JBossASBasedConfigurationValidator
.require(JBossASBasedConfigurationValidator.java:213)
        ... 11 more
Posting Shutdown Request to the server...
Server startup has not completed, so halting the process
Press any key to continue . . .

Open in new window

0
sunseAuthor Commented:
I have solved the new problem and I am back to the previous one.  The conf folder was removed I guess by accident  and I had to do a new installation.  I will check the JNDI output.  Thanks
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sunseAuthor Commented:
This is my JNDI view.  Could you please point to what I should be looking for?

java: Namespace

  +- jboss (class: org.jnp.interfaces.NamingContext)
  |   +- datasources (class: org.jnp.interfaces.NamingContext)
  |   |   +- ExampleDS[link -> java:DefaultDS] (class: javax.naming.LinkRef)
  +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
  +- comp (class: javax.naming.Context)
  |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
  |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  |   +- env (class: org.jnp.interfaces.NamingContext)
  |   |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
  |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
  |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
  |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
  |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
  |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
  |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
  |   +- ModuleName (class: java.lang.String)
  +- XAConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
  +- JmsXA (class: org.hornetq.ra.HornetQRAConnectionFactoryImpl)
  +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
  +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
  +- app (class: javax.naming.Context)
  |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
  |   +- AppName (class: java.lang.String)
  +- Mail (class: javax.mail.Session)
  +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
  +- ProfileService (class: org.jboss.profileservice.AbstractProfileService)
  +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  +- jaas (class: javax.naming.Context)
  |   +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
  |   +- hornetq (class: org.jboss.security.plugins.SecurityDomainContext)
  +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
  +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
  +- ConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
  +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
  +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
  +- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
  +- module (class: javax.naming.Context)
  |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
  |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  |   +- env (class: org.jnp.interfaces.NamingContext)
  |   |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
  |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
  |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
  |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
  |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
  |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
  |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
  |   +- ModuleName (class: java.lang.String)
  +- internal (class: org.jnp.interfaces.NamingContext)
  |   +- EJBContext (class: javax.ejb.EJBContext)
  |   +- TimerService (class: javax.ejb.TimerService)
  +- global (class: org.jnp.interfaces.NamingContext)
  |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
  |   +- ROOT (class: org.jnp.interfaces.NamingContext)
  |   +- FirstBeansTitan (class: org.jnp.interfaces.NamingContext)
  |   |   +- TravelAgentBean[link -> TravelAgentBean/remote-titan.travelagent.TravelAgentRemote] (class: javax.naming.LinkRef)
  |   |   +- TravelAgentBean!titan.travelagent.TravelAgentRemote[link -> TravelAgentBean/remote-titan.travelagent.TravelAgentRemote] (class: javax.naming.LinkRef)
  |   +- uuid-key-generator (class: org.jnp.interfaces.NamingContext)
  |   +- http-invoker (class: org.jnp.interfaces.NamingContext)
  |   |   +- invoker (class: org.jnp.interfaces.NamingContext)
  |   +- cdi (class: org.jnp.interfaces.NamingContext)


Global JNDI Namespace

  +- UserTransactionSessionFactory (proxy: $Proxy123 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
  +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
  +- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
  +- SecureDeploymentManager (class: org.jnp.interfaces.NamingContext)
  |   +- remote[link -> DeploymentManager] (class: javax.naming.LinkRef)
  +- SecureManagementView (class: org.jnp.interfaces.NamingContext)
  |   +- remote[link -> ManagementView] (class: javax.naming.LinkRef)
  +- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)
  +- XAConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
  +- ProfileService (class: org.jboss.aop.generatedproxies.AOPProxy$2)
  +- persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb (class: org.hibernate.impl.SessionFactoryImpl)
  +- SecureProfileService (class: org.jnp.interfaces.NamingContext)
  |   +- remote[link -> ProfileService] (class: javax.naming.LinkRef)
  +- queue (class: org.jnp.interfaces.NamingContext)
  |   +- DLQ (class: org.hornetq.jms.client.HornetQQueue)
  |   +- ExpiryQueue (class: org.hornetq.jms.client.HornetQQueue)
  +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
  +- ConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
  +- jmx (class: org.jnp.interfaces.NamingContext)
  |   +- invoker (class: org.jnp.interfaces.NamingContext)
  |   |   +- RMIAdaptor (class: javax.management.MBeanServerConnection)
  |   +- rmi (class: org.jnp.interfaces.NamingContext)
  |   |   +- RMIAdaptor (class: javax.management.MBeanServerConnection)
  +- BeanValidatorFactories (class: org.jnp.interfaces.NamingContext)
  +- TomcatAuthenticators (class: java.util.Properties)
  +- XAThroughputConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)
  +- ManagementView (class: org.jboss.aop.generatedproxies.AOPProxy$3)
  +- ThroughputConnectionFactory (class: org.hornetq.jms.client.HornetQXAConnectionFactory)

Open in new window

0
gurpsbassiCommented:
I don't know JBOSS that well.
What I was after was a GUI view to show you the EJB's and their JNDI names.
0
sunseAuthor Commented:
Is there anyone with JBoss knowledge that could answer this question?

Hi,

I have solved the previous issue.  Now, I have a different one,  Could you please help with this?

Thanks,

Giuseppa

I created a user name
mysql> GRANT ALL PRIVILEGES ON jboss.* TO jboss@localhost IDENTIFIED BY 'password'
I checked that everyting was going smoothly:
mysql>  select User,Host,Password from mysql.User;
+-------+-----------+-------------------------------------------+
| User  | Host      | Password                                  |
+-------+-----------+-------------------------------------------+
| root  | localhost | *7B9CB6FF820F8EB2569BBC05BF1F871CE258444F |
| jboss | localhost | *7B9CB6FF820F8EB2569BBC05BF1F871CE258444F |
| root  | %         | *7B9CB6FF820F8EB2569BBC05BF1F871CE258444F |
+-------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

This is my mysql-ds.xml file, which is in C:\jboss-6.1.0.Final\server\default\deploy
<?xml version="1.0" encoding="UTF-8"?>
<datasources><local-tx-datasource><jndi-name>MySqlTitanDS</jndi-name><connection-url>jdbc:mysql://localhost:3306/Titan</connection-url><driver-class>com.mysql.jdbc.Driver</driver-class>
<!-- 1.Comment out user-name/password if you are using anonymous account 2. Adjust user-name/password if you are using different values -->
<user-name>jboss</user-name><password>giuseppa</password><min-pool-size>5</min-pool-size><max-pool-size>30</max-pool-size><exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter </exception-sorter-class-name><metadata><type-mapping>mySQL</type-mapping></metadata></local-tx-datasource><local-tx-datasource><jndi-name>MySqlSamplesDS</jndi-name><connection-url>jdbc:mysql://localhost:3306/Samples</connection-url><driver-class>com.mysql.jdbc.Driver</driver-class>
<!-- 1.Comment out user-name/password if you are using anonymous account 2. Adjust user-name/password if you are using different values -->
<!-- <user-name>jboss</user-name> <password>giuseppa</password> -->
<min-pool-size>5</min-pool-size><max-pool-size>30</max-pool-size><exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter </exception-sorter-class-name><metadata><type-mapping>mySQL</type-mapping></metadata></local-tx-datasource></datasources>

Mysql-connector-java-5.1.36.jar is in C:\jboss-6.1.0.Final\server\default\lib

FirstBeansTitan.jar is in 
C:\jboss-6.1.0.Final\server\default\deploy\applications



I follow these steps to run my application:
Turn off jboss
In the home directory of the application, run the following commands:
Ant clean
Ant ejbjar

C:\FirstBeans>ant clean
Buildfile: C:\FirstBeans\build.xml

clean:
   [delete] Deleting directory C:\FirstBeans\build

BUILD SUCCESSFUL
Total time: 0 seconds

C:\FirstBeans>ant ejbjar
Buildfile: C:\FirstBeans\build.xml

prepare:
    [mkdir] Created dir: C:\FirstBeans\build
    [mkdir] Created dir: C:\FirstBeans\build\classrues

compile:
    [javac] Compiling 4 source files to C:\FirstBeans\build\classrues

ejbjar:
      [jar] Building jar: C:\FirstBeans\build\FirstBeansTitan.jar
     [copy] Copying 1 file to C:\jboss-6.1.0.Final\server\default\deploy\applica
tions

BUILD SUCCESSFUL
Total time: 2 seconds

Start Jboss server again

C:\FirstBeans> ant run.client

I get the following:
     [java]     at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCC
LInterceptor.java:86)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(Sta
telessContainer.java:392)
     [java]     at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynami
cInvoke(InvokableContextClassProxyHack.java:53)
     [java]     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
     [java]     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invok
e(AOPRemotingInvocationHandler.java:82)
     [java]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:96
7)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.completeInvo
cation(ServerThread.java:791)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.processInvoc
ation(ServerThread.java:744)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.dorun(Server
Thread.java:548)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerTh
read.java:234)
     [java]     at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemot
eClientInvoker.java:218)
     [java]     at org.jboss.remoting.Client.invoke(Client.java:2070)
     [java]     at org.jboss.remoting.Client.invoke(Client.java:879)
     [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(Inv
okeRemoteInterceptor.java:60)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(Cl
ientTxPropagationInterceptor.java:61)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.security.client.SecurityClientInterceptor.invo
ke(SecurityClientInterceptor.java:65)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInte
rceptor.java:77)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInter
ceptor.invoke(AsynchronousClientInterceptor.java:143)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62
)
     [java]     at $Proxy4.invoke(Unknown Source)
     [java]     at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocat
ionHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
     [java]     at $Proxy3.createCabin(Unknown Source)
     [java]     at titan.clients.Client.main(Client.java:27)
     [java]     at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(Inv
okeRemoteInterceptor.java:72)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(Cl
ientTxPropagationInterceptor.java:61)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.security.client.SecurityClientInterceptor.invo
ke(SecurityClientInterceptor.java:65)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInte
rceptor.java:77)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInter
ceptor.invoke(AsynchronousClientInterceptor.java:143)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62
)
     [java]     at $Proxy4.invoke(Unknown Source)
     [java]     at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocat
ionHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
     [java]     at $Proxy3.createCabin(Unknown Source)
     [java]     at titan.clients.Client.main(Client.java:27)
     [java] Caused by: javax.persistence.PersistenceException: org.hibernate.exc
eption.GenericJDBCException: Cannot open connection
     [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractE
ntityManagerImpl.java:1215)
     [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractE
ntityManagerImpl.java:1148)
     [java]     at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractE
ntityManagerImpl.java:1154)
     [java]     at org.hibernate.ejb.AbstractEntityManagerImpl$3.mapManagedFlush
Failure(AbstractEntityManagerImpl.java:1068)
     [java]     at org.hibernate.transaction.synchronization.CallbackCoordinator
.beforeCompletion(CallbackCoordinator.java:122)
     [java]     at org.hibernate.transaction.synchronization.HibernateSynchroniz
ationImpl.beforeCompletion(HibernateSynchronizationImpl.java:51)
     [java]     at com.arjuna.ats.internal.jta.resources.arjunacore.Synchronizat
ionImple.beforeCompletion(SynchronizationImple.java:97)
     [java]     at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeC
ompletion(TwoPhaseCoordinator.java:274)
     [java]     at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(Two
PhaseCoordinator.java:94)
     [java]     at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:1
59)
     [java]     at com.arjuna.ats.internal.jta.transaction.arjunacore.Transactio
nImple.commitAndDisassociate(TransactionImple.java:1158)
     [java]     at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransa
ction.commit(BaseTransaction.java:119)
     [java]     at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit
(BaseTransactionManagerDelegate.java:75)
     [java]     at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.endTransaction(CMTTx
Interceptor.java:82)
     [java]     at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxI
nterceptor.java:255)
     [java]     at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterc
eptor.java:349)
     [java]     at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxIntercep
tor.java:209)
     [java]     at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxIn
terceptorWrapper.java:52)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropag
ationInterceptor.java:76)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java
:42)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invok
e(Ejb3AuthenticationInterceptorv2.java:182)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagatio
nInterceptor.java:41)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
    [java]     at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(Block
ContainerShutdownInterceptor.java:67)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.core.context.CurrentInvocationContextIntercept
or.invoke(CurrentInvocationContextInterceptor.java:47)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.aspects.currentinvocation.CurrentInvocationIntercep
tor.invoke(CurrentInvocationInterceptor.java:67)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCC
LInterceptor.java:86)
     [java]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
ocation.java:102)
     [java]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(Sta
telessContainer.java:392)
     [java]     at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynami
cInvoke(InvokableContextClassProxyHack.java:53)
     [java]     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
     [java]     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invok
e(AOPRemotingInvocationHandler.java:82)
     [java]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:96
7)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.completeInvo
cation(ServerThread.java:791)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.processInvoc
ation(ServerThread.java:744)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.dorun(Server
Thread.java:548)
     [java]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerTh
read.java:234)
     [java] Caused by: org.hibernate.exception.GenericJDBCException: Cannot open
connection
     [java]     at org.hibernate.exception.SQLStateConverter.handledNonSpecificE
xception(SQLStateConverter.java:140)
     [java]     at org.hibernate.exception.SQLStateConverter.convert(SQLStateCon
verter.java:128)
     [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExcep
tionHelper.java:66)
     [java]     at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExcep
tionHelper.java:52)
     [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(Connectio
nManager.java:449)
     [java]     at org.hibernate.jdbc.ConnectionManager.getConnection(Connection
Manager.java:167)
     [java]     at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractB
atcher.java:116)
     [java]     at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractB
atcher.java:109)
     [java]     at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(Abst
ractBatcher.java:244)
     [java]     at org.hibernate.persister.entity.AbstractEntityPersister.insert
(AbstractEntityPersister.java:2411)
     [java]     at org.hibernate.persister.entity.AbstractEntityPersister.insert
(AbstractEntityPersister.java:2874)
     [java]     at org.hibernate.action.EntityInsertAction.execute(EntityInsertA
ction.java:79)
     [java]     at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273
)
     [java]     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.j
ava:265)
     [java]     at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.j
ava:184)
     [java]     at org.hibernate.event.def.AbstractFlushingEventListener.perform
Executions(AbstractFlushingEventListener.java:321)
     [java]     at org.hibernate.event.def.DefaultFlushEventListener.onFlush(Def
aultFlushEventListener.java:51)
     [java]     at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
     [java]     at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:
383)
     [java]     at org.hibernate.transaction.synchronization.CallbackCoordinator
.beforeCompletion(CallbackCoordinator.java:117)
     [java]     ... 39 more
     [java] Caused by: org.jboss.util.NestedSQLException: Unable to get managed
connection for MySqlTitanDS; - nested throwable: (javax.resource.ResourceExcepti
on: Unable to get managed connection for MySqlTitanDS)
     [java]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnecti
on(WrapperDataSource.java:95)
     [java]     at org.hibernate.ejb.connection.InjectedDataSourceConnectionProv
ider.getConnection(InjectedDataSourceConnectionProvider.java:71)
     [java]     at org.hibernate.jdbc.ConnectionManager.openConnection(Connectio
nManager.java:446)
     [java]     ... 54 more
     [java] Caused by: javax.resource.ResourceException: Unable to get managed c
onnection for MySqlTitanDS
     [java]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.g
etManagedConnection(BaseConnectionManager2.java:441)
     [java]     at org.jboss.resource.connectionmanager.TxConnectionManager.getM
anagedConnection(TxConnectionManager.java:414)
     [java]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.a
llocateConnection(BaseConnectionManager2.java:496)
     [java]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$C
onnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
     [java]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnecti
on(WrapperDataSource.java:89)
     [java]     ... 56 more
     [java] Caused by: org.jboss.resource.JBossResourceException: Could not crea
te connection; - nested throwable: (com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxE
rrorException: Access denied for user 'jboss'@'localhost' to database 'titan')
     [java]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionF
actory.getLocalManagedConnection(LocalManagedConnectionFactory.java:261)
     [java]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionF
actory.createManagedConnection(LocalManagedConnectionFactory.java:215)
     [java]     at org.jboss.resource.connectionmanager.InternalManagedConnectio
nPool.createConnectionEventListener(InternalManagedConnectionPool.java:648)
     [java]     at org.jboss.resource.connectionmanager.InternalManagedConnectio
nPool.getConnection(InternalManagedConnectionPool.java:272)
     [java]     at org.jboss.resource.connectionmanager.JBossManagedConnectionPo
ol$BasePool.getConnection(JBossManagedConnectionPool.java:747)
     [java]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.g
etManagedConnection(BaseConnectionManager2.java:403)
     [java]     ... 60 more
     [java] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
: Access denied for user 'jboss'@'localhost' to database 'titan'
     [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
     [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
onstructorAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
egatingConstructorAccessorImpl.java:27)
     [java]     at java.lang.reflect.Constructor.newInstance(Constructor.java:51
3)
     [java]     at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
     [java]     at com.mysql.jdbc.Util.getInstance(Util.java:383)
     [java]     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)

     [java]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
     [java]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
     [java]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
     [java]     at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4292)
     [java]     at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1259)
     [java]     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java
:2249)
     [java]     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImp
l.java:2280)
     [java]     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java
:2079)
     [java]     at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)

     [java]     at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44
)
     [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
     [java]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
onstructorAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
egatingConstructorAccessorImpl.java:27)
     [java]     at java.lang.reflect.Constructor.newInstance(Constructor.java:51
3)
     [java]     at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
     [java]     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java
:399)
     [java]     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDri
ver.java:325)
     [java]     at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionF
actory.getLocalManagedConnection(LocalManagedConnectionFactory.java:229)
     [java]     ... 65 more
     [java] Java Result: 1

BUILD SUCCESSFUL
Total time: 2 seconds

C:\FirstBeans>

Open in new window

0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
: Access denied for user 'jboss'@'localhost' to database 'titan'

The above seems to be the main cause of your current issue. So does the "jboss" user have required permission and access to the "titan" database?
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sunseAuthor Commented:
yes, the name of the database it titan, therefore the permission needed to be granted to titan.

mysql> GRANT ALL PRIVILEGES ON titan.* TO titan@localhost IDENTIFIED BY 'password'.

Thank you for your response.
0
sunseAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for sunse's comment #a40915501

for the following reason:

It is the statement that solved the problem
0
sunseAuthor Commented:
It is the issue that was causing the problem
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Thank you for your response.

You're welcome!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.