2 Replies Latest reply on Apr 9, 2005 11:45 AM by jaba_o

    JCA chap7 NoTransFS questioning?

      Hi!

      I'm having jboss 4 series AS installed with embedded tomcat VM in use is tiger..platform is linux. This installation might or might not have EJB 3.0 Pre 4 in there...

      I've configured a datasource on the server and it seems to be installed in JNDI namespace by java: NoTransFS .I'm now figuring out a problen having a DirContext object created by using DirContextFactory.getConnection() method.

      There are one set of exceptions returned by the servlet and then the Root cause set...here's how Root Cause begins...

      ***************************
      javax.naming.NamingException: Unable to get Connection: javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 90000 [ms] )
      org.jboss.chap7.ex1.ra.DirContextFactoryImpl.getConnection(DirContextFactoryImpl.java:46)
      serverfun.ejb.webcentric.WebContextEJBBean.theRandomizer(WebContextEJBBean.java:59)
      serverfun.ejb.webcentric.WebContextEJBBean.getRandomFileInDir(WebContextEJBBean.java:107)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:585)
      org.jboss.invocation.Invocation.performCall(Invocation.java:345)....
      ***************************************

      The manual is very informative about how this jca consept works. this problem however might be a small detail in a larger context...
      Exceptions are informative also... What might be the part in the JCA configuration that refers to "Blocking" in the exception message ?

      I would first ask what " No ManagedConnections available within configured blocking.." means?

      jmx-console shows on the jca section:
      name=NoTransFS,service=ConnectionFactoryBinding
      name=NoTransFS,service=ManagedConnectionFactory
      name=NoTransFS,service=ManagedConnectionPool
      name=NoTransFS,service=NoTxCM

      Should it use FSManagedConnection instead of ManagedConnection for filesystem context to be available ??

      Could this be security related problem? As far as I can tell there is no security configuration related to this datasource at the moment.

      And Finally...what kind of technicues are there to effectively test ejb's method by method...to pinpoint to the very method and the very exception that in effect composes the rest of the two pages of exceptions?

      Here's the Oh! part of this quzzing:
      the EJB is of stateles session -type with local end remote interfaces and this exception is from the remote client (JSP Servlet).

      I think the dcf.getconnection fails:

      InitialContext inictx = new InitialContext();
      Object ref = inictx.lookup("java:NoTransFS");
      DirContextFactory dcf = (DirContextFactory) ref;
      webdirectory = (DirContext)dcf.getConnection();

      My hunch is that there is something to be configured in the JCA for this to work. The Module is supposed to handle all sorts of tasks related to webpages and this bean is supposed to pick a random image from a directory for the web page to use...

      Maybe tehere's something in the tomcat that needs to be figured out?

      Kind regards...Kai

        • 1. Re: JCA chap7 NoTransFS questioning?

          Found out that the an xml file for the adapter needed more configuration afterall and the filesystem access problem shifted to be a java language learning task :)

          I was so sure that accessing filesystem was somehow tricky by the j2ee restrictions.

          Hope that some points to the question about a conveniant practices in testing methods would com up...

          ----
          Kai

          • 2. Re: JCA chap7 NoTransFS questioning?

            Oh! Surprise awaiting...

            Let me be anyyb with this...

            Abstract Context classes gets inherited and at the end there is org.jboss.chap7.ex1.ra.FSDirContext class which return null from each method??

            It took awhile to get there :)

            Looks like I'm in the search for implemented DirContext class (and methods) for the JCA imnplementation ??

            Any ideas?