You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Hendrik Jander <he...@googlemail.com> on 2010/03/12 15:49:52 UTC

Resource Adpater: Could not find resource

Hello List,

i really need some help on the following topic and any help,tips or pointers
would be really appreciated.
I'm trying to get a jackrabbit + webapp scenario running on geronimo-tomcat
2.2.
To achieve a serverwide deployment of jackrabbit i want to deploy it as
resource adapter(in a rar file)

The deployment of my ra works fine. but when i try to deploy my webapp(with
the ra referenced), the following exception is raised:

org.apache.geronimo.common.DeploymentException: Unable to resolve resource
reference 'jcr/repository' (Could not find resource 'JcrRepoSource'.
 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: com.sample/repositoryResourceAdapter/1.0/car]
[ALL: org.apache.geronimo.configs/tomcat6/2.2/car]
[ALL: org.apache.geronimo.configs/concurrent/2.2/car]
[ALL: org.apache.geronimo.configs/openjpa//car]
[ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
[CLASSES: org.apache.geronimo.configs/openejb//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:220)
at
org.apache.geronimo.j2ee.deployment.NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:69)
at
org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:719)
at
org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:355)


the geronimo-ra.xml for this resource adapter looks as follows:

<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
 <sys:environment>
        <sys:moduleId>
            <sys:groupId>com.sample</sys:groupId>
            <sys:artifactId>repositoryResourceAdapter</sys:artifactId>
            <sys:version>1.0</sys:version>
            <sys:type>car</sys:type>
        </sys:moduleId>
    </sys:environment>

 <resourceadapter>
<resourceadapter-instance>
<resourceadapter-name>JcrRepoSource</resourceadapter-name>
<workmanager>
<gbean-link>DefaultWorkManager</gbean-link>
</workmanager>
</resourceadapter-instance>
</resourceadapter>
</connector>


-----------------------------------------------------------------------
The Deployment plan for my webapp client looks like this:

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>default</sys:groupId>
            <sys:artifactId>geronimo-web-6</sys:artifactId>
            <sys:version>1.0</sys:version>
            <sys:type>car</sys:type>
        </sys:moduleId>


<sys:dependencies>
<sys:dependency>
<sys:groupId>com.sample</sys:groupId>
<sys:artifactId>repositoryResourceAdapter</sys:artifactId>
<sys:version>1.0</sys:version>
<sys:type>car</sys:type>
</sys:dependency>
</sys:dependencies>
 <sys:hidden-classes />
<sys:non-overridable-classes />

    </sys:environment>

    <context-root>sample</context-root>
    <work-dir>sample-workdir</work-dir>


     <naming:resource-ref>
        <naming:ref-name>jcr/repository</naming:ref-name>
        <naming:resource-link>JcrRepoSource</naming:resource-link>
</naming:resource-ref>

------------------------------------
my web.xml looks like that:

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <resource-ref>
<description>JCR Content Repository</description>
<res-ref-name>jcr/repository</res-ref-name>
<res-type>javax.jcr.Repository</res-type> <res-auth>Container</res-auth>
</resource-ref>


</web-app>


Thanks in advance,Hendrik

Re: Resource Adpater: Could not find resource

Posted by David Jencks <da...@yahoo.com>.
Hi Hendrik,

In your geronimo-ra.xml you have only configured the resource  
adapter.  With this, you will only be able to use it for incoming  
messages to an mdb.  Since IIUC jcr is sort of like a database rather  
than sort of like jms, this is probably not what you want, and it's  
certainly not what your web app is expecting.

You need to configure a connection factory in the geronimo-ra.xml  
whose name is JcrRepoSource and whose type is javax.jcr.Repository.   
Hopefully the ra.xml from jackrabbit has enough info so this is  
easy :-)  If not, if you can provide a link to the ra.xml I can give  
more advice.

It would be nice to have a geronimo sample showing how to use  
jackrabbit.... once you get this working if you would like to  
contribute a simple sample or just some tell us more about the  
configuration that would be great!

thanks
david jencks

On Mar 12, 2010, at 6:49 AM, Hendrik Jander wrote:

> Hello List,
>
> i really need some help on the following topic and any help,tips or  
> pointers would be really appreciated.
> I'm trying to get a jackrabbit + webapp scenario running on geronimo- 
> tomcat 2.2.
> To achieve a serverwide deployment of jackrabbit i want to deploy it  
> as resource adapter(in a rar file)
>
> The deployment of my ra works fine. but when i try to deploy my  
> webapp(with the ra referenced), the following exception is raised:
>
> org.apache.geronimo.common.DeploymentException: Unable to resolve  
> resource reference 'jcr/repository' (Could not find resource  
> 'JcrRepoSource'.  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: com.sample/repositoryResourceAdapter/1.0/car]
> [ALL: org.apache.geronimo.configs/tomcat6/2.2/car]
> [ALL: org.apache.geronimo.configs/concurrent/2.2/car]
> [ALL: org.apache.geronimo.configs/openjpa//car]
> [ALL: org.apache.geronimo.configs/j2ee-corba-yoko//car]
> [CLASSES: org.apache.geronimo.configs/openejb//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: 
> 220)
> 	at  
> org 
> .apache 
> .geronimo 
> .j2ee 
> .deployment 
> .NamingBuilderCollection.buildNaming(NamingBuilderCollection.java:69)
> 	at  
> org 
> .apache 
> .geronimo 
> .web25 
> .deployment 
> .AbstractWebModuleBuilder 
> .configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:719)
> 	at  
> org 
> .apache 
> .geronimo 
> .tomcat 
> .deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java: 
> 355)
>
>
> the geronimo-ra.xml for this resource adapter looks as follows:
>
> <connector 	xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 
> "
> 			xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
> 			
> 	 <sys:environment>
>         <sys:moduleId>
>             <sys:groupId>com.sample</sys:groupId>
>             <sys:artifactId>repositoryResourceAdapter</sys:artifactId>
>             <sys:version>1.0</sys:version>
>             <sys:type>car</sys:type>
>         </sys:moduleId>
>     </sys:environment>
>
> 	
> 	<resourceadapter>
> 		<resourceadapter-instance>
> 			<resourceadapter-name>JcrRepoSource</resourceadapter-name>
> 			<workmanager>
> 				<gbean-link>DefaultWorkManager</gbean-link>
> 			</workmanager>
> 		</resourceadapter-instance>
> 	</resourceadapter>
> 	
> </connector>
>
>
> -----------------------------------------------------------------------
> The Deployment plan for my webapp client looks like this:
>
>     <sys:environment>
>         <sys:moduleId>
>             <sys:groupId>default</sys:groupId>
>             <sys:artifactId>geronimo-web-6</sys:artifactId>
>             <sys:version>1.0</sys:version>
>             <sys:type>car</sys:type>
>         </sys:moduleId>
>
>
> 		<sys:dependencies>
> 			<sys:dependency>
> 				<sys:groupId>com.sample</sys:groupId>
> 				<sys:artifactId>repositoryResourceAdapter</sys:artifactId>
> 				<sys:version>1.0</sys:version>
> 				<sys:type>car</sys:type>
> 			</sys:dependency>
> 		</sys:dependencies>
> 		
> 		<sys:hidden-classes />
> 		<sys:non-overridable-classes />
>
>     </sys:environment>
>
> 	
>     <context-root>sample</context-root>
>     <work-dir>sample-workdir</work-dir>
>
>
>      <naming:resource-ref>
>         <naming:ref-name>jcr/repository</naming:ref-name>
>         <naming:resource-link>JcrRepoSource</naming:resource-link>
> 	</naming:resource-ref>
>
> ------------------------------------
> my web.xml looks like that:
>
> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 	 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 	 
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd 
> "> 	<resource-ref> 		<description>JCR Content Repository</ 
> description> 		<res-ref-name>jcr/repository</res-ref-name> 		<res- 
> type>javax.jcr.Repository</res-type> 		<res-auth>Container</res- 
> auth> 	</resource-ref>
>
>
> </web-app>	
>
>
> Thanks in advance,Hendrik