1 Reply Latest reply on Feb 9, 2002 4:20 AM by vincent

    J2ee Connecor Architecture SAP Resource Adapter

    guru

      Hi,

      I have deveploped a ResourceAdapter for SAP R/3.
      i have tested it in various AppServers like Weblogic,
      websphere, Hp-AS, Sun Ri, Pramati.

      now im deploying my adapter in JBOSS 3.0 alpha.
      im facing problem in JNDI.

      i don't have any problem while deploying the ResourceAdapter, but when i run my client jsp or servlet
      im getting the following error

      --------------------------------------------
      [15:09:41,671,Default] javax.naming.NameNotFoundException: SAPR3ConnectionFactor
      y not bound
      [15:09:41,671,Default] at org.jnp.server.NamingServer.getBinding(NamingServer.j
      ava:495)
      [15:09:41,687,Default] at org.jnp.server.NamingServer.getBinding(NamingServer.j
      ava:503)
      [15:09:41,687,Default] at org.jnp.server.NamingServer.getObject(NamingServer.ja
      va:509)
      [15:09:41,687,Default] at org.jnp.server.NamingServer.lookup(NamingServer.java:
      282)
      [15:09:41,703,Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext
      .java:365)
      [15:09:41,703,Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext
      .java:349)
      [15:09:41,703,Default] at javax.naming.InitialContext.lookup(Unknown Source)
      [15:09:41,718,Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext
      .java:437)
      [15:09:41,718,Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext
      .java:473)
      [15:09:41,718,Default] at org.jnp.interfaces.NamingContext.lookup(NamingContext
      .java:349)
      [15:09:41,734,Default] at javax.naming.InitialContext.lookup(Unknown Source)
      [15:09:41,734,Default] at com.vergil.bean.SapR3Bean.connect(SapR3Bean.java:103)
      --------------------------------------------

      My Adapter doesn't support TRANSACTION but even then im getting the following error

      [15:12:51,015,LogInterceptor] TransactionRolledbackException, causedBy:
      javax.ejb.EJBException: null
      at com.vergil.bean.SapR3Bean.getPOList(SapR3Bean.java:193)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
      tatelessSessionContainer.java:569)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
      elessSessionInstanceInterceptor.java:67)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:137)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
      5)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:131)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
      ner.java:280)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPCon
      tainerInvoker.java:506)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(Ge
      nericProxy.java:346)
      at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(St
      atelessSessionProxy.java:123)
      at $Proxy2.getPOList(Unknown Source)
      at ClientServlet.processRequest(ClientServlet.java:72)
      at ClientServlet.doGet(ClientServlet.java:34)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:488
      )
      ------------------------------------------------------

      both above mentioned errors are coming at the same time.

      Following is my service.xml file
      ================================

      <?xml version="1.0" encoding="UTF-8"?>



      ClientNumber=800
      Language=EN
      UserName=sap*
      Password=pass
      ServerName=sap2
      SystemNumber=13
      LogConfigFileName=D:\sap\log\logconfig.xml

      SAPR3ConnectionFactory
      <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=SAPR3ConnectionFactory</mbean-ref>
      <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaNoTransCMFactory</mbean-ref>

      BlockingTimeoutMillis=50000
      IdleTimeoutMinutes=30
      MaxSize=10
      CleanupIntervalMinutes=10
      MinSize=0
      MaxIdleTimeoutPercent=1.0


      org.jboss.resource.security.ManyToOnePrincipalMapping


      userName=sap*
      password=pass




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

      following is my jboss.xml file which is attached to the session bean.
      ---------------

      <?xml version="1.0" encoding="UTF-8"?>

      <enterprise-beans>

      <ejb-name>com.vergil.bean.SapR3Bean</ejb-name>
      <jndi-name>SapR3Home.SapR3Bean</jndi-name>
      <resource-ref>
      <res-ref-name>eis/SAPConnectorFactory</res-ref-name>
      <jndi-name>java:/SAPR3ConnectionFactory</jndi-name>
      </resource-ref>

      </enterprise-beans>


      ----------------------------------------------------------

      im able to lookup the bean .. but not able to lookup the Resource Adapter.

      ResourceAdapter lookup in my bean :-
      -------------------------------------
      try {
      initialcontext = new InitialContext();
      // lookup J2EE Connector
      connectionfactory = (ConnectionFactory)initialcontext.lookup("java:comp/env/eis/" + m_resourceAdapter);
      // Making Connection
      connection = connectionfactory.getConnection();
      }catch(Exception exception) {
      exception.printStackTrace();
      }

      ----------------------------------------------

      Kindly help me in solving this problem.
      Ur help in this regard will be deeply appreciated.

      thanks,
      Gurumurthy R.