4 Replies Latest reply on Apr 25, 2002 9:28 PM by chuyux

    Help on DataSource configuration

    chuyux

      For JBoss 3.1RC, I used the mysql-service.xml suggested
      in here:
      http://jboss.org/forums/thread.jsp?forum=61&thread=13121

      It turns out, it works for BMP entity bean. But, it does
      not work for session bean.

      More details: In mysql-service.xml I set MySqlDS, also
      in login-config.xml I set MySqlDSRealm. Both are just like in the above suggestions.

      In BMP entity bean, I use java:/MySqlDS to look up datasource. It works, just like I did in JBoss 2.4.4. But, in a session bean, I use java:/MySqlDS to look up datasource, I got this exception: ResourceException: No ManagedConnection available.

      The session bean codes are working for JBoss 2.4.4. What is wrong in my setup? Please help.

        • 1. Re: Help on DataSource configuration
          ccm682

          I saw a solution to this on the FireBirdSQL list, they had a problem that the max-size was defaulting to 0 and needed to be explicitly set higher. Where to do that, I don't know, I'm still new to EJB and Resources.

          • 2. Re: Help on DataSource configuration
            chuyux

            Thanks. It could be this part wrong. I will check it out.

            • 3. Re: Help on DataSource configuration
              davidjencks

              Is there any chance you are not successfully closing all the connections? I'm not sure how this could actually use up all the connections with the new implementation, but can't think of anything else at the moment.

              If you are using a config from cvs, it will have maxsize set to a reasonable number. Also if your entities work, maxsize>0.

              • 4. Re: Help on DataSource configuration
                chuyux

                Using the Max-Size suggestion, I did following tries:

                1. I put both a BMP entity bean and a session bean into the container. The entity bean runs well. If I run the session bean, the exceptions is:

                javax.ejb.CreateException: Unable to get Connection: javax.resource.ResourceExce
                ption: No ManagedConnections Available!
                at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
                RemoteCall.java:245)
                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
                220)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
                at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
                ce)
                at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
                kerProxy.java:128)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
                a:108)
                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
                java:73)
                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:7
                6)
                at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)

                2. Take out all entity beans. Then try the session bean, it is OK to get DataSource, also it is OK to get the session bean instance. But, it fails at call business method, the exception is like this:

                java.lang.reflect.UndeclaredThrowableException: javax.resource.ResourceException
                : associateConnection not supported
                at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
                RemoteCall.java:245)
                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
                220)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
                at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
                ce)
                at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
                kerProxy.java:128)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
                a:108)
                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
                java:73)
                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:7
                6)
                at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSession
                Interceptor.java:117)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)

                So, I do not think this is a problem of Max-Size and a problem of not-close-connection. In fact, I checked all Max-size, and make sure they equal 50. But, what is this problem?