You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by jam_developer <kb...@mailcity.com> on 2010/01/04 12:18:09 UTC

Re: Resource Adapter deployment problem

Thanks David and Jack for your response.

With couple of changes, I could able to deploy RA in Geronimo using
Administrative console. Now when I go to JNDI viewer, I don't see my
specified JNDI name. Following is my geronimo-ra.xml details:
-------------------------------------------------------------------------------------------------------------------
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">

   <environment
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
     <moduleId>
       <groupId>hammurapi</groupId>
       <artifactId>RulesAdapter</artifactId>
       <version>4.1</version>
       <type>rar</type>
     </moduleId>
     <dependencies/>
     <dep:hidden-classes/>
     <dep:non-overridable-classes/>
   </environment>

  <resourceadapter>
    <outbound-resourceadapter>
      <connection-definition>
       
<connectionfactory-interface>com.hammurapi.reasoning.ForwardReasoningSessionFactory</connectionfactory-interface>
        <connectiondefinition-instance>
          <name>eis/RuleConnection</name>
          <connectionmanager>
            <no-transaction/>
            <no-pool/>
          </connectionmanager>
        </connectiondefinition-instance>
      </connection-definition>
    </outbound-resourceadapter>
  </resourceadapter>
</connector>

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

I was expecting to see specified JNDI name (eis/RuleConnection)  in JNDI
viewer but JNDI viewer just shows
hammurapi/RulesAdapter/4.1/rar

Please let me know what am I missing out here.




djencks wrote:
> 
> You'd need an environment element in the geronimo-ra.xml that has at  
> least a module id for the adapter.
> 
> After that, you need to list the module id as a dependency of the web  
> app in the geronimo-web.xml or other plan file to get the lookup to  
> work.
> 
> Other than that, I'd need to see a more detailed description of  
> exactly what you are doing and what errors you get.
> 
> thanks
> david jencks
> 
> On Dec 23, 2009, at 3:49 AM, jam_developer wrote:
> 
>>
>> Hi,
>>
>> I have a outbound resource adapter which is a connector for a rule  
>> engine. I
>> need help to deploy it in Geronimo.
>>
>> Structure of rar is:
>>
>> adapter.jar(contains adapter classes)
>> connector-api.jar(required 3rd party library)
>> jsr94.jar(required 3rd party library)
>> META-INF\rar.xml
>> META-INF\geronimo.xml
>>
>>
>> Following is my geronimo-ra.xml :
>>
>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/ 
>> connector-1.2">
>>  <resourceadapter>
>>    <outbound-resourceadapter>
>>      <connection-definition>
>>
>> <connectionfactory- 
>> interface>biz.hammurapi.rules.ra.ConnectionFactory</ 
>> connectionfactory-interface>
>>        <connectiondefinition-instance>
>>          <name>RuleConnection</name>
>>          <connectionmanager>
>>            <no-transaction/>
>>            <no-pool/>
>>          </connectionmanager>
>>        </connectiondefinition-instance>
>>      </connection-definition>
>>    </outbound-resourceadapter>
>>  </resourceadapter>
>> </connector>
>>
>> Following is ra.xml :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <connector xmlns="http://java.sun.com/xml/ns/j2ee"
>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
>>    version="1.5">
>>    <display-name>Hammurapi Rules Adapter</display-name>
>>    <vendor-name>Hammurapi Group</vendor-name>
>>    <eis-type>Rules enabled application</eis-type>
>>    <resourceadapter-version>1.0</resourceadapter-version>
>>    <resourceadapter>
>>
>> <resourceadapter-class>biz.hammurapi.rules.ra.ResourceAdapterImpl</ 
>> resourceadapter-class>
>>
>>        <outbound-resourceadapter>
>>            <connection-definition>
>>
>> <managedconnectionfactory- 
>> class>biz.hammurapi.rules.ra.ManagedConnectionFactoryImpl</ 
>> managedconnectionfactory-class>
>>
>> <connectionfactory- 
>> interface>biz.hammurapi.rules.ra.ConnectionFactory</ 
>> connectionfactory-interface>
>>
>> <connectionfactory-impl- 
>> class>biz.hammurapi.rules.ra.ConnectionFactoryImpl</ 
>> connectionfactory-impl-class>
>>
>> <connection-interface>javax.rules.RuleSession</connection-interface>
>>
>> <connection-impl-class>biz.hammurapi.rules.ra.RuleSessionImpl</ 
>> connection-impl-class>
>>            </connection-definition>
>>            <transaction-support>NoTransaction</transaction-support>
>>            <authentication-mechanism>
>>
>> <authentication-mechanism-type>BasicPassword</authentication- 
>> mechanism-type>
>>
>> <credential- 
>> interface>javax.resource.spi.security.PasswordCredential</credential- 
>> interface>
>>            </authentication-mechanism>
>>            <reauthentication-support>false</reauthentication-support>
>>        </outbound-resourceadapter>
>>    </resourceadapter>
>> </connector>
>>
>> Please let me know what am I missing here.
>>
>> My second question is I have another web application through which I  
>> need to
>> access this resource adapter. I assume connectiondefinition-instance
>> name(which is "RuleConnection") can be used as JNDI name to get  
>> Connection
>> object. Is this understanding correct?
>>
>> Please suggest.
>>
>> -- 
>> View this message in context:
>> http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p26899531.html
>> Sent from the Apache Geronimo - Users mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p27011579.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Resource Adapter deployment problem

Posted by Jack Cai <gr...@gmail.com>.
As I mentioned in my last reply, you can try one of the below two approaches:

1. Remove the jndi entries in the web.xml and geronimo-web.xml. Do the
lookup use the global jndi name as indicated in the log, i.e.,
"hammurapi/RulesAdapter/JCAManagedConnectionFactory/eis/RuleConnection";

2. Add a dependency in your geronimo-web.xml as below -
<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
 xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
 xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">

 <dep:environment>
   <dep:moduleId>
     <dep:groupId>TestResourceAdapter</dep:groupId>
     <dep:artifactId>web.test</dep:artifactId>
     <dep:version>1.0</dep:version>
     <dep:type>war</dep:type>
   </dep:moduleId>
   <dep:dependencies>
     <dep:dependency>
      <dep:groupId>hammurapi</dep:groupId>
      <dep:artifactId>RulesAdapter</dep:artifactId>
      <dep:version>4.1</dep:version>
      <dep:type>rar</dep:type>
     </dep:dependency>
   </dep:dependencies>
   <dep:hidden-classes/>
   <dep:non-overridable-classes/>
 </dep:environment>

 <context-root>/TestResourceAdapter</context-root>

 <naming:resource-ref>
               <naming:ref-name>eis/RuleConnection</naming:ref-name>
               <naming:resource-link>eis/RuleConnection</naming:resource-link>
 </naming:resource-ref>

</web-app>

I'm not 100% sure whether Approach 2 would work though...

-Jack

On Tue, Jan 5, 2010 at 8:46 PM, jam_developer <kb...@mailcity.com> wrote:
>
> Thanks for your response Jack !!
>
> I could able to locate following in log
> ------------------------------------------------------------------------------------------------------------------
> 2010-01-05 17:32:01,389 INFO  [KernelContextGBean] bound gbean
> hammurapi/RulesAdapter/4.1/rar?J2EEApplication=null,JCAConnectionFactory=eis/RuleConnection,JCAResource=hammurapi/RulesAdapter/4.1/rar,ResourceAdapter=hammurapi/RulesAdapter/4.1/rar,ResourceAdapterModule=hammurapi/RulesAdapter/4.1/rar,j2eeType=JCAManagedConnectionFactory,name=eis/RuleConnection
> at name
> hammurapi/RulesAdapter/JCAManagedConnectionFactory/eis/RuleConnection
> -----------------------------------------------------------------------------------------------------------------
>
> Now I have a separate web application in which I have to do JNDI lookup to
> get ForwardReasoningSessionFactory(from a simple jsp)
>
> Following is my web.xml
> -------------------------------------------------------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_ID" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>        <display-name>TestResourceAdapter</display-name>
>        <welcome-file-list>
>                <welcome-file>index.jsp</welcome-file>
>        </welcome-file-list>
>
>        <resource-ref>
>                <description>Rules Session Connection Factory</description>
>                <res-ref-name>eis/RuleConnection</res-ref-name>
>
> <res-type>com.hammurapi.reasoning.ForwardReasoningSessionFactory</res-type>
>                <res-auth>Application</res-auth>
>        </resource-ref>
> </web-app>
> --------------------------------------------------------------------------------------------------------------------
>
> Below is my geronimo-web.xml details:
>
> --------------------------------------------------------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
>  xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
>  xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">
>
>  <dep:environment>
>    <dep:moduleId>
>      <dep:groupId>TestResourceAdapter</dep:groupId>
>      <dep:artifactId>web.test</dep:artifactId>
>      <dep:version>1.0</dep:version>
>      <dep:type>war</dep:type>
>    </dep:moduleId>
>    <dep:dependencies/>
>    <dep:hidden-classes/>
>    <dep:non-overridable-classes/>
>  </dep:environment>
>
>  <context-root>/TestResourceAdapter</context-root>
>
>  <naming:resource-ref>
>                <naming:ref-name>eis/RuleConnection</naming:ref-name>
>                <naming:resource-link>eis/RuleConnection</naming:resource-link>
>  </naming:resource-ref>
>
> </web-app>
> --------------------------------------------------------------------------------------------------------------------
>
> While deploying this web application through Administration Console, I am
> getting error:
> Deployment failed:
> Unable to resolve resource reference 'eis/RuleConnection' (Could not find
> resource 'eis/RuleConnection'. Perhaps it has not yet been configured, or
> your application does not have a dependency declared for that resource
> module?
>
> Following is the detailed exception log:
> -------------------------------------------------------------------------------------------------------------------
> Unable to resolve resource reference 'eis/RuleConnection' (Could not find
> resource 'eis/RuleConnection'.  Perhaps it has not yet been configured, or
> your application does not have a dependency declared for that resource
> module?
> Search conducted in current module and dependencies:
> [ALL: org.apache.geronimo.configs/tomcat6/2.1.4/car]
> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
> [CLASSES: org.apache.geronimo.configs/openejb//car]
> [ALL: org.apache.geronimo.configs/openjpa//car]
> [ALL: org.apache.geronimo.configs/axis//car]
> [ALL: org.apache.geronimo.configs/axis2//car]
> )
> org.apache.geronimo.common.DeploymentException: Unable to resolve resource
> reference 'eis/RuleConnection' (Could not find resource
> 'eis/RuleConnection'.  Perhaps it has not yet been configured, or your
> application does not have a dependency declared for that resource module?
> Search conducted in current module and dependencies:
> [ALL: org.apache.geronimo.configs/tomcat6/2.1.4/car]
> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
> [CLASSES: org.apache.geronimo.configs/openejb//car]
> [ALL: org.apache.geronimo.configs/openjpa//car]
> [ALL: org.apache.geronimo.configs/axis//car]
> [ALL: org.apache.geronimo.configs/axis2//car]
> )
>        at
> org.apache.geronimo.connector.deployment.ResourceRefBuilder.buildNaming(ResourceRefBuilder.java:216)
>        at
> org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
>        at
> org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:842)
>        at
> org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:347)
>        at
> org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
>        at
> org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
>        at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
>        at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
>        at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
>        at
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
>        at
> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
>        at
> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
>        at java.lang.Thread.run(Thread.java:619)
>
> -------------------------------------------------------------------------------------------------------------------
>
> Please let me know the mistake in my configuration.
>
>
>
>
>
> Jack Cai wrote:
>>
>> The global JNDI name will be something different from the "name" you
>> specify in ra.xml. Try to find the name in the server start up log,
>> which is located in var/log folder.
>>
>> Or, as David pointed out, you can claim a dependency in your
>> application deployment plan (e.g., geronimo-web.xml for Web app) to
>> this resource adapter, and use "eis/RuleConnection" to look up it.
>>
>> -Jack
>>
>> On Mon, Jan 4, 2010 at 7:18 PM, jam_developer <kb...@mailcity.com> wrote:
>>>
>>> Thanks David and Jack for your response.
>>>
>>> With couple of changes, I could able to deploy RA in Geronimo using
>>> Administrative console. Now when I go to JNDI viewer, I don't see my
>>> specified JNDI name. Following is my geronimo-ra.xml details:
>>> -------------------------------------------------------------------------------------------------------------------
>>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
>>>
>>>   <environment
>>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>>     <moduleId>
>>>       <groupId>hammurapi</groupId>
>>>       <artifactId>RulesAdapter</artifactId>
>>>       <version>4.1</version>
>>>       <type>rar</type>
>>>     </moduleId>
>>>     <dependencies/>
>>>     <dep:hidden-classes/>
>>>     <dep:non-overridable-classes/>
>>>   </environment>
>>>
>>>  <resourceadapter>
>>>    <outbound-resourceadapter>
>>>      <connection-definition>
>>>
>>> <connectionfactory-interface>com.hammurapi.reasoning.ForwardReasoningSessionFactory</connectionfactory-interface>
>>>        <connectiondefinition-instance>
>>>          <name>eis/RuleConnection</name>
>>>          <connectionmanager>
>>>            <no-transaction/>
>>>            <no-pool/>
>>>          </connectionmanager>
>>>        </connectiondefinition-instance>
>>>      </connection-definition>
>>>    </outbound-resourceadapter>
>>>  </resourceadapter>
>>> </connector>
>>>
>>> ------------------------------------------------------------------------------------------------------------------
>>>
>>> I was expecting to see specified JNDI name (eis/RuleConnection)  in JNDI
>>> viewer but JNDI viewer just shows
>>> hammurapi/RulesAdapter/4.1/rar
>>>
>>> Please let me know what am I missing out here.
>>>
>>>
>>>
>>>
>>> djencks wrote:
>>>>
>>>> You'd need an environment element in the geronimo-ra.xml that has at
>>>> least a module id for the adapter.
>>>>
>>>> After that, you need to list the module id as a dependency of the web
>>>> app in the geronimo-web.xml or other plan file to get the lookup to
>>>> work.
>>>>
>>>> Other than that, I'd need to see a more detailed description of
>>>> exactly what you are doing and what errors you get.
>>>>
>>>> thanks
>>>> david jencks
>>>>
>>>> On Dec 23, 2009, at 3:49 AM, jam_developer wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have a outbound resource adapter which is a connector for a rule
>>>>> engine. I
>>>>> need help to deploy it in Geronimo.
>>>>>
>>>>> Structure of rar is:
>>>>>
>>>>> adapter.jar(contains adapter classes)
>>>>> connector-api.jar(required 3rd party library)
>>>>> jsr94.jar(required 3rd party library)
>>>>> META-INF\rar.xml
>>>>> META-INF\geronimo.xml
>>>>>
>>>>>
>>>>> Following is my geronimo-ra.xml :
>>>>>
>>>>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/
>>>>> connector-1.2">
>>>>>  <resourceadapter>
>>>>>    <outbound-resourceadapter>
>>>>>      <connection-definition>
>>>>>
>>>>> <connectionfactory-
>>>>> interface>biz.hammurapi.rules.ra.ConnectionFactory</
>>>>> connectionfactory-interface>
>>>>>        <connectiondefinition-instance>
>>>>>          <name>RuleConnection</name>
>>>>>          <connectionmanager>
>>>>>            <no-transaction/>
>>>>>            <no-pool/>
>>>>>          </connectionmanager>
>>>>>        </connectiondefinition-instance>
>>>>>      </connection-definition>
>>>>>    </outbound-resourceadapter>
>>>>>  </resourceadapter>
>>>>> </connector>
>>>>>
>>>>> Following is ra.xml :
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>
>>>>> <connector xmlns="http://java.sun.com/xml/ns/j2ee"
>>>>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>>>> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
>>>>>    version="1.5">
>>>>>    <display-name>Hammurapi Rules Adapter</display-name>
>>>>>    <vendor-name>Hammurapi Group</vendor-name>
>>>>>    <eis-type>Rules enabled application</eis-type>
>>>>>    <resourceadapter-version>1.0</resourceadapter-version>
>>>>>    <resourceadapter>
>>>>>
>>>>> <resourceadapter-class>biz.hammurapi.rules.ra.ResourceAdapterImpl</
>>>>> resourceadapter-class>
>>>>>
>>>>>        <outbound-resourceadapter>
>>>>>            <connection-definition>
>>>>>
>>>>> <managedconnectionfactory-
>>>>> class>biz.hammurapi.rules.ra.ManagedConnectionFactoryImpl</
>>>>> managedconnectionfactory-class>
>>>>>
>>>>> <connectionfactory-
>>>>> interface>biz.hammurapi.rules.ra.ConnectionFactory</
>>>>> connectionfactory-interface>
>>>>>
>>>>> <connectionfactory-impl-
>>>>> class>biz.hammurapi.rules.ra.ConnectionFactoryImpl</
>>>>> connectionfactory-impl-class>
>>>>>
>>>>> <connection-interface>javax.rules.RuleSession</connection-interface>
>>>>>
>>>>> <connection-impl-class>biz.hammurapi.rules.ra.RuleSessionImpl</
>>>>> connection-impl-class>
>>>>>            </connection-definition>
>>>>>            <transaction-support>NoTransaction</transaction-support>
>>>>>            <authentication-mechanism>
>>>>>
>>>>> <authentication-mechanism-type>BasicPassword</authentication-
>>>>> mechanism-type>
>>>>>
>>>>> <credential-
>>>>> interface>javax.resource.spi.security.PasswordCredential</credential-
>>>>> interface>
>>>>>            </authentication-mechanism>
>>>>>            <reauthentication-support>false</reauthentication-support>
>>>>>        </outbound-resourceadapter>
>>>>>    </resourceadapter>
>>>>> </connector>
>>>>>
>>>>> Please let me know what am I missing here.
>>>>>
>>>>> My second question is I have another web application through which I
>>>>> need to
>>>>> access this resource adapter. I assume connectiondefinition-instance
>>>>> name(which is "RuleConnection") can be used as JNDI name to get
>>>>> Connection
>>>>> object. Is this understanding correct?
>>>>>
>>>>> Please suggest.
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p26899531.html
>>>>> Sent from the Apache Geronimo - Users mailing list archive at
>>>>> Nabble.com.
>>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p27011579.html
>>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p27026602.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Re: Resource Adapter deployment problem

Posted by jam_developer <kb...@mailcity.com>.
Thanks for your response Jack !!

I could able to locate following in log
------------------------------------------------------------------------------------------------------------------
2010-01-05 17:32:01,389 INFO  [KernelContextGBean] bound gbean
hammurapi/RulesAdapter/4.1/rar?J2EEApplication=null,JCAConnectionFactory=eis/RuleConnection,JCAResource=hammurapi/RulesAdapter/4.1/rar,ResourceAdapter=hammurapi/RulesAdapter/4.1/rar,ResourceAdapterModule=hammurapi/RulesAdapter/4.1/rar,j2eeType=JCAManagedConnectionFactory,name=eis/RuleConnection
at name
hammurapi/RulesAdapter/JCAManagedConnectionFactory/eis/RuleConnection
-----------------------------------------------------------------------------------------------------------------

Now I have a separate web application in which I have to do JNDI lookup to
get ForwardReasoningSessionFactory(from a simple jsp)

Following is my web.xml
-------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
	<display-name>TestResourceAdapter</display-name>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
	
	<resource-ref>
		<description>Rules Session Connection Factory</description>
		<res-ref-name>eis/RuleConnection</res-ref-name>
	
<res-type>com.hammurapi.reasoning.ForwardReasoningSessionFactory</res-type>
		<res-auth>Application</res-auth>
	</resource-ref>
</web-app>
--------------------------------------------------------------------------------------------------------------------

Below is my geronimo-web.xml details:

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

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0"
  xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
  xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2">

  <dep:environment>
    <dep:moduleId>
      <dep:groupId>TestResourceAdapter</dep:groupId>
      <dep:artifactId>web.test</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>war</dep:type>
    </dep:moduleId>
    <dep:dependencies/>
    <dep:hidden-classes/>
    <dep:non-overridable-classes/>
  </dep:environment>

  <context-root>/TestResourceAdapter</context-root>
  
  <naming:resource-ref>
		<naming:ref-name>eis/RuleConnection</naming:ref-name>
		<naming:resource-link>eis/RuleConnection</naming:resource-link>
  </naming:resource-ref>

</web-app>
--------------------------------------------------------------------------------------------------------------------

While deploying this web application through Administration Console, I am
getting error:
Deployment failed:
Unable to resolve resource reference 'eis/RuleConnection' (Could not find
resource 'eis/RuleConnection'. Perhaps it has not yet been configured, or
your application does not have a dependency declared for that resource
module?

Following is the detailed exception log:
-------------------------------------------------------------------------------------------------------------------
Unable to resolve resource reference 'eis/RuleConnection' (Could not find
resource 'eis/RuleConnection'.  Perhaps it has not yet been configured, or
your application does not have a dependency declared for that resource
module?
Search conducted in current module and dependencies:
[ALL: org.apache.geronimo.configs/tomcat6/2.1.4/car]
[ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
[CLASSES: org.apache.geronimo.configs/openejb//car]
[ALL: org.apache.geronimo.configs/openjpa//car]
[ALL: org.apache.geronimo.configs/axis//car]
[ALL: org.apache.geronimo.configs/axis2//car]
)
org.apache.geronimo.common.DeploymentException: Unable to resolve resource
reference 'eis/RuleConnection' (Could not find resource
'eis/RuleConnection'.  Perhaps it has not yet been configured, or your
application does not have a dependency declared for that resource module?
Search conducted in current module and dependencies:
[ALL: org.apache.geronimo.configs/tomcat6/2.1.4/car]
[ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
[CLASSES: org.apache.geronimo.configs/openejb//car]
[ALL: org.apache.geronimo.configs/openjpa//car]
[ALL: org.apache.geronimo.configs/axis//car]
[ALL: org.apache.geronimo.configs/axis2//car]
)
	at
org.apache.geronimo.connector.deployment.ResourceRefBuilder.buildNaming(ResourceRefBuilder.java:216)
	at
org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:53)
	at
org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:842)
	at
org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:347)
	at
org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:165)
	at
org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:647)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:134)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
	at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
	at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:867)
	at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
	at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
	at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
	at java.lang.Thread.run(Thread.java:619)

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

Please let me know the mistake in my configuration.





Jack Cai wrote:
> 
> The global JNDI name will be something different from the "name" you
> specify in ra.xml. Try to find the name in the server start up log,
> which is located in var/log folder.
> 
> Or, as David pointed out, you can claim a dependency in your
> application deployment plan (e.g., geronimo-web.xml for Web app) to
> this resource adapter, and use "eis/RuleConnection" to look up it.
> 
> -Jack
> 
> On Mon, Jan 4, 2010 at 7:18 PM, jam_developer <kb...@mailcity.com> wrote:
>>
>> Thanks David and Jack for your response.
>>
>> With couple of changes, I could able to deploy RA in Geronimo using
>> Administrative console. Now when I go to JNDI viewer, I don't see my
>> specified JNDI name. Following is my geronimo-ra.xml details:
>> -------------------------------------------------------------------------------------------------------------------
>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
>>
>>   <environment
>> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>>     <moduleId>
>>       <groupId>hammurapi</groupId>
>>       <artifactId>RulesAdapter</artifactId>
>>       <version>4.1</version>
>>       <type>rar</type>
>>     </moduleId>
>>     <dependencies/>
>>     <dep:hidden-classes/>
>>     <dep:non-overridable-classes/>
>>   </environment>
>>
>>  <resourceadapter>
>>    <outbound-resourceadapter>
>>      <connection-definition>
>>
>> <connectionfactory-interface>com.hammurapi.reasoning.ForwardReasoningSessionFactory</connectionfactory-interface>
>>        <connectiondefinition-instance>
>>          <name>eis/RuleConnection</name>
>>          <connectionmanager>
>>            <no-transaction/>
>>            <no-pool/>
>>          </connectionmanager>
>>        </connectiondefinition-instance>
>>      </connection-definition>
>>    </outbound-resourceadapter>
>>  </resourceadapter>
>> </connector>
>>
>> ------------------------------------------------------------------------------------------------------------------
>>
>> I was expecting to see specified JNDI name (eis/RuleConnection)  in JNDI
>> viewer but JNDI viewer just shows
>> hammurapi/RulesAdapter/4.1/rar
>>
>> Please let me know what am I missing out here.
>>
>>
>>
>>
>> djencks wrote:
>>>
>>> You'd need an environment element in the geronimo-ra.xml that has at
>>> least a module id for the adapter.
>>>
>>> After that, you need to list the module id as a dependency of the web
>>> app in the geronimo-web.xml or other plan file to get the lookup to
>>> work.
>>>
>>> Other than that, I'd need to see a more detailed description of
>>> exactly what you are doing and what errors you get.
>>>
>>> thanks
>>> david jencks
>>>
>>> On Dec 23, 2009, at 3:49 AM, jam_developer wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> I have a outbound resource adapter which is a connector for a rule
>>>> engine. I
>>>> need help to deploy it in Geronimo.
>>>>
>>>> Structure of rar is:
>>>>
>>>> adapter.jar(contains adapter classes)
>>>> connector-api.jar(required 3rd party library)
>>>> jsr94.jar(required 3rd party library)
>>>> META-INF\rar.xml
>>>> META-INF\geronimo.xml
>>>>
>>>>
>>>> Following is my geronimo-ra.xml :
>>>>
>>>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/
>>>> connector-1.2">
>>>>  <resourceadapter>
>>>>    <outbound-resourceadapter>
>>>>      <connection-definition>
>>>>
>>>> <connectionfactory-
>>>> interface>biz.hammurapi.rules.ra.ConnectionFactory</
>>>> connectionfactory-interface>
>>>>        <connectiondefinition-instance>
>>>>          <name>RuleConnection</name>
>>>>          <connectionmanager>
>>>>            <no-transaction/>
>>>>            <no-pool/>
>>>>          </connectionmanager>
>>>>        </connectiondefinition-instance>
>>>>      </connection-definition>
>>>>    </outbound-resourceadapter>
>>>>  </resourceadapter>
>>>> </connector>
>>>>
>>>> Following is ra.xml :
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <connector xmlns="http://java.sun.com/xml/ns/j2ee"
>>>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>>> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
>>>>    version="1.5">
>>>>    <display-name>Hammurapi Rules Adapter</display-name>
>>>>    <vendor-name>Hammurapi Group</vendor-name>
>>>>    <eis-type>Rules enabled application</eis-type>
>>>>    <resourceadapter-version>1.0</resourceadapter-version>
>>>>    <resourceadapter>
>>>>
>>>> <resourceadapter-class>biz.hammurapi.rules.ra.ResourceAdapterImpl</
>>>> resourceadapter-class>
>>>>
>>>>        <outbound-resourceadapter>
>>>>            <connection-definition>
>>>>
>>>> <managedconnectionfactory-
>>>> class>biz.hammurapi.rules.ra.ManagedConnectionFactoryImpl</
>>>> managedconnectionfactory-class>
>>>>
>>>> <connectionfactory-
>>>> interface>biz.hammurapi.rules.ra.ConnectionFactory</
>>>> connectionfactory-interface>
>>>>
>>>> <connectionfactory-impl-
>>>> class>biz.hammurapi.rules.ra.ConnectionFactoryImpl</
>>>> connectionfactory-impl-class>
>>>>
>>>> <connection-interface>javax.rules.RuleSession</connection-interface>
>>>>
>>>> <connection-impl-class>biz.hammurapi.rules.ra.RuleSessionImpl</
>>>> connection-impl-class>
>>>>            </connection-definition>
>>>>            <transaction-support>NoTransaction</transaction-support>
>>>>            <authentication-mechanism>
>>>>
>>>> <authentication-mechanism-type>BasicPassword</authentication-
>>>> mechanism-type>
>>>>
>>>> <credential-
>>>> interface>javax.resource.spi.security.PasswordCredential</credential-
>>>> interface>
>>>>            </authentication-mechanism>
>>>>            <reauthentication-support>false</reauthentication-support>
>>>>        </outbound-resourceadapter>
>>>>    </resourceadapter>
>>>> </connector>
>>>>
>>>> Please let me know what am I missing here.
>>>>
>>>> My second question is I have another web application through which I
>>>> need to
>>>> access this resource adapter. I assume connectiondefinition-instance
>>>> name(which is "RuleConnection") can be used as JNDI name to get
>>>> Connection
>>>> object. Is this understanding correct?
>>>>
>>>> Please suggest.
>>>>
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p26899531.html
>>>> Sent from the Apache Geronimo - Users mailing list archive at
>>>> Nabble.com.
>>>>
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p27011579.html
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p27026602.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Resource Adapter deployment problem

Posted by Jack Cai <gr...@gmail.com>.
The global JNDI name will be something different from the "name" you
specify in ra.xml. Try to find the name in the server start up log,
which is located in var/log folder.

Or, as David pointed out, you can claim a dependency in your
application deployment plan (e.g., geronimo-web.xml for Web app) to
this resource adapter, and use "eis/RuleConnection" to look up it.

-Jack

On Mon, Jan 4, 2010 at 7:18 PM, jam_developer <kb...@mailcity.com> wrote:
>
> Thanks David and Jack for your response.
>
> With couple of changes, I could able to deploy RA in Geronimo using
> Administrative console. Now when I go to JNDI viewer, I don't see my
> specified JNDI name. Following is my geronimo-ra.xml details:
> -------------------------------------------------------------------------------------------------------------------
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
>
>   <environment
> xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
>     <moduleId>
>       <groupId>hammurapi</groupId>
>       <artifactId>RulesAdapter</artifactId>
>       <version>4.1</version>
>       <type>rar</type>
>     </moduleId>
>     <dependencies/>
>     <dep:hidden-classes/>
>     <dep:non-overridable-classes/>
>   </environment>
>
>  <resourceadapter>
>    <outbound-resourceadapter>
>      <connection-definition>
>
> <connectionfactory-interface>com.hammurapi.reasoning.ForwardReasoningSessionFactory</connectionfactory-interface>
>        <connectiondefinition-instance>
>          <name>eis/RuleConnection</name>
>          <connectionmanager>
>            <no-transaction/>
>            <no-pool/>
>          </connectionmanager>
>        </connectiondefinition-instance>
>      </connection-definition>
>    </outbound-resourceadapter>
>  </resourceadapter>
> </connector>
>
> ------------------------------------------------------------------------------------------------------------------
>
> I was expecting to see specified JNDI name (eis/RuleConnection)  in JNDI
> viewer but JNDI viewer just shows
> hammurapi/RulesAdapter/4.1/rar
>
> Please let me know what am I missing out here.
>
>
>
>
> djencks wrote:
>>
>> You'd need an environment element in the geronimo-ra.xml that has at
>> least a module id for the adapter.
>>
>> After that, you need to list the module id as a dependency of the web
>> app in the geronimo-web.xml or other plan file to get the lookup to
>> work.
>>
>> Other than that, I'd need to see a more detailed description of
>> exactly what you are doing and what errors you get.
>>
>> thanks
>> david jencks
>>
>> On Dec 23, 2009, at 3:49 AM, jam_developer wrote:
>>
>>>
>>> Hi,
>>>
>>> I have a outbound resource adapter which is a connector for a rule
>>> engine. I
>>> need help to deploy it in Geronimo.
>>>
>>> Structure of rar is:
>>>
>>> adapter.jar(contains adapter classes)
>>> connector-api.jar(required 3rd party library)
>>> jsr94.jar(required 3rd party library)
>>> META-INF\rar.xml
>>> META-INF\geronimo.xml
>>>
>>>
>>> Following is my geronimo-ra.xml :
>>>
>>> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/
>>> connector-1.2">
>>>  <resourceadapter>
>>>    <outbound-resourceadapter>
>>>      <connection-definition>
>>>
>>> <connectionfactory-
>>> interface>biz.hammurapi.rules.ra.ConnectionFactory</
>>> connectionfactory-interface>
>>>        <connectiondefinition-instance>
>>>          <name>RuleConnection</name>
>>>          <connectionmanager>
>>>            <no-transaction/>
>>>            <no-pool/>
>>>          </connectionmanager>
>>>        </connectiondefinition-instance>
>>>      </connection-definition>
>>>    </outbound-resourceadapter>
>>>  </resourceadapter>
>>> </connector>
>>>
>>> Following is ra.xml :
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <connector xmlns="http://java.sun.com/xml/ns/j2ee"
>>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>> http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
>>>    version="1.5">
>>>    <display-name>Hammurapi Rules Adapter</display-name>
>>>    <vendor-name>Hammurapi Group</vendor-name>
>>>    <eis-type>Rules enabled application</eis-type>
>>>    <resourceadapter-version>1.0</resourceadapter-version>
>>>    <resourceadapter>
>>>
>>> <resourceadapter-class>biz.hammurapi.rules.ra.ResourceAdapterImpl</
>>> resourceadapter-class>
>>>
>>>        <outbound-resourceadapter>
>>>            <connection-definition>
>>>
>>> <managedconnectionfactory-
>>> class>biz.hammurapi.rules.ra.ManagedConnectionFactoryImpl</
>>> managedconnectionfactory-class>
>>>
>>> <connectionfactory-
>>> interface>biz.hammurapi.rules.ra.ConnectionFactory</
>>> connectionfactory-interface>
>>>
>>> <connectionfactory-impl-
>>> class>biz.hammurapi.rules.ra.ConnectionFactoryImpl</
>>> connectionfactory-impl-class>
>>>
>>> <connection-interface>javax.rules.RuleSession</connection-interface>
>>>
>>> <connection-impl-class>biz.hammurapi.rules.ra.RuleSessionImpl</
>>> connection-impl-class>
>>>            </connection-definition>
>>>            <transaction-support>NoTransaction</transaction-support>
>>>            <authentication-mechanism>
>>>
>>> <authentication-mechanism-type>BasicPassword</authentication-
>>> mechanism-type>
>>>
>>> <credential-
>>> interface>javax.resource.spi.security.PasswordCredential</credential-
>>> interface>
>>>            </authentication-mechanism>
>>>            <reauthentication-support>false</reauthentication-support>
>>>        </outbound-resourceadapter>
>>>    </resourceadapter>
>>> </connector>
>>>
>>> Please let me know what am I missing here.
>>>
>>> My second question is I have another web application through which I
>>> need to
>>> access this resource adapter. I assume connectiondefinition-instance
>>> name(which is "RuleConnection") can be used as JNDI name to get
>>> Connection
>>> object. Is this understanding correct?
>>>
>>> Please suggest.
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p26899531.html
>>> Sent from the Apache Geronimo - Users mailing list archive at
>>> Nabble.com.
>>>
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Resource-Adapter-deployment-problem-tp26899531s134p27011579.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>