0 Replies Latest reply on Sep 12, 2005 12:11 PM by ihcazt

    connecting to ms sql

    ihcazt Newbie

      hi all,

      i'm trying to connect to ms sql.
      i need your help.
      thanks

      tz

      i got that message:

      Buildfile: D:\workspace\tutorial\packaging\build.xml
      prepare:
      compile:
      ejbjar:
      run:
      [java] Exception in thread "main" javax.ejb.EJBException: null; CausedByException is:
      [java] Cannot open connection
      [java] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:46)
      [java] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
      [java] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:195)
      [java] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
      [java] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:69)
      [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:325)
      [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:201)
      [java] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:259)
      [java] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:313)
      [java] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:147)
      [java] org.hibernate.exception.GenericJDBCException: Cannot open connection
      [java] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
      [java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
      [java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      [java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
      [java] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:301)
      [java] at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)
      [java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:77)
      [java] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1810)
      [java] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2265)
      [java] at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)
      [java] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
      [java] at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:266)
      [java] at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:164)
      [java] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
      [java] at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:124)
      [java] at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:84)
      [java] at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
      [java] at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:532)
      [java] at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:130)
      [java] at org.jboss.tutorial.packaging.bean.Session1Bean.create1FromFactory(Session1Bean.java:43)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:585)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:99)
      [java] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
      [java] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
      [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
      [java] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:195)
      [java] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
      [java] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:69)
      [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:325)
      [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:201)
      [java] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:259)
      [java] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:313)
      [java] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:147)
      [java] Caused by: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'jb'. Reason: Not associated with a trusted SQL Server connection.); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'jb'. Reason: Not associated with a trusted SQL Server connection.))
      [java] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:107)
      [java] at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:67)
      [java] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:298)
      [java] ... 41 more
      [java] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'jb'. Reason: Not associated with a trusted SQL Server connection.)
      [java] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:161)
      [java] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:508)
      [java] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
      [java] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
      [java] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:395)
      [java] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:297)
      [java] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:447)
      [java] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:874)
      [java] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
      [java] ... 43 more
      [java] Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'jb'. Reason: Not associated with a trusted SQL Server connection.
      [java] at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
      [java] at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
      [java] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
      [java] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
      [java] at com.microsoft.jdbc.sqlserver.tds.TDSLoginRequest.processReplyToken(Unknown Source)
      [java] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
      [java] at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
      [java] at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
      [java] at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
      [java] at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
      [java] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:151)
      [java] ... 51 more
      [java] Java Result: 1
      BUILD SUCCESSFUL
      Total time: 2 seconds