geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Custom resource factories in geronimo
Date Tue, 28 Oct 2008 17:49:26 GMT
One obvious problem is that the gbean name component is  
FileStorageResourceGbean and you are querying for FileStorage.   
Assuming you fix this and your FileStorageResourceGBean implements  
ResourceBinding I'd expect this to work.

thanks
david jencks

On Oct 28, 2008, at 3:43 AM, Hearty wrote:

>
> Hi
> I am getting the following error
>
> Could not resolve reference at deploy time for queries
> [?name=FileStorage#com.telelogic.focalpoint.gbeans.ResourceBinding]
> org.apache.geronimo.common.DeploymentException: Could not resolve  
> reference
> at deploy time for queries
> [?name=FileStorage#com.telelogic.focalpoint.gbeans.ResourceBinding]
> 	at
> org 
> .apache 
> .geronimo 
> .naming.deployment.GBeanRefBuilder.buildNaming(GBeanRefBuilder.java: 
> 75)
> 	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:254)
> 	at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:133)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
> 	at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:615)
> 	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:803)
> Caused by: org.apache.geronimo.kernel.GBeanNotFoundException: No  
> matches for
> referencePatterns:
> [?name=FileStorage#com.telelogic.focalpoint.gbeans.ResourceBinding]
> 	at
> org 
> .apache 
> .geronimo 
> .kernel.config.Configuration.findGBeanData(Configuration.java:669)
> 	at
> org 
> .apache 
> .geronimo 
> .naming.deployment.GBeanRefBuilder.buildNaming(GBeanRefBuilder.java: 
> 73)
> 	... 18 more
>
>
> In geronimo-web.xml, my entries are as follows
>
> <naming:gbean-ref>
> 	     <naming:ref-name>focalpoint/filestorage</naming:ref-name>
> 	
> <naming:ref-type>com.telelogic.focalpoint.gbeans.ResourceBinding</ 
> naming:ref-type>
> 	     <naming:pattern>
> 	       <naming:name>FileStorage</naming:name>
> 	     </naming:pattern>
>   </naming:gbean-ref>
> <sys:gbean name="FileStorageResourceGbean"
> class="com.telelogic.focalpoint.gbeans.ResourceBindingGBean">
>      <sys:attribute
> name 
> = 
> "factory 
> ">com.telelogic.focalpoint.tools.filestorage.FileStorageFactory</ 
> sys:attribute>
>      <sys:attribute
> name="type">com.telelogic.focalpoint.tools.filestorage.FileStorage</ 
> sys:attribute>
>      <sys:attribute
> name 
> = 
> "storageClassName 
> ">com.telelogic.focalpoint.tools.filestorage.FileStorageFS</ 
> sys:attribute>
>      <sys:attribute name="basePath">C:/hearty/tmp/files</ 
> sys:attribute>
>      <sys:attribute name="jndiName">focalpoint/filestorage</ 
> sys:attribute>
>  </sys:gbean>
>
> Hearty wrote:
>>
>> Can you please send me the schema url. It will be great if you can  
>> send me
>> the sample geronimo-web.xml which uses
>> <gbean-ref>
>>
>>
>> djencks wrote:
>>>
>>>
>>> On Oct 27, 2008, at 11:45 PM, Hearty wrote:
>>>
>>>>
>>>> My application is a web project (keeping war file for the  
>>>> deployment)
>>>> and my application uses tomcat. I've an entry in context.xml as
>>>> follows.
>>>> <Resource name="xy/filestorage" auth="Container"
>>>> 		type="tools.filestorage.FileStorage"
>>>> 		factory="tools.filestorage.FileStorageFactory"
>>>> 		storageClassName="tools.filestorage.FileStorageFS"
>>>> 		basePath="C:/tmp/files" />
>>>> 	
>>>> Later I am accessing xy/filestorage as jndi reference as below.
>>>>
>>>> <jee:jndi-lookup id="fileStorage"
>>>>   jndi-name="java:comp/env/xy/filestorage" /> [This entry is used  
>>>> in
>>>> applicationContext.xml
>>>> , a spring based config file]
>>>>
>>>> I have a restriction to keep same jndi-name as mentioned above  
>>>> since
>>>> I need to maintain the war file to compatible to tomcat as well as
>>>> apache
>>>> geronimo
>>>>
>>>> Please provide me a solution for this with a sample code.
>>>
>>> You are using proprietary features of tomcat so you'll have to
>>> duplicate the effect with proprietary features of geronimo.
>>>
>>> I'm not very familiar with the Resource element: I think maybe it  
>>> ends
>>> up creating an object.  In Geronimo you'll have to modify or extend
>>> that object to be a gbean and configure an instance somewhere
>>> accessible to your app such as the geronimo plan for your app.
>>>
>>> Then in the part of the geronimo plan where you map jndi stuff  
>>> such as
>>> resource-refs you need an element following this schema fragment:
>>>
>>>     <xsd:complexType name="gbean-refType">
>>>         <xsd:complexContent>
>>>             <xsd:extension base="gernaming:abstract-naming- 
>>> entryType">
>>>                 <xsd:sequence>
>>>                     <xsd:element name="ref-name" type="xsd:string">
>>>                         <xsd:annotation>
>>>                             <xsd:documentation>
>>>                                 The element ref-name is used to
>>> identify this
>>>                                 gbean reference. This name should be
>>> unique in a
>>>                                 module and will be used by
>>> application to as a
>>>                                 part of JNDI name for the referenced
>>> gbean. The
>>>                                 JNDI name used will be "java:/comp/
>>> env/ref-name.
>>>                                 It should map to the "ref-name"
>>> provided in
>>>                                 deployment descriptor.
>>>                             </xsd:documentation>
>>>                         </xsd:annotation>
>>>                     </xsd:element>
>>>                     <xsd:element name="ref-type" type="xsd:string"
>>> minOccurs="0"
>>>                         maxOccurs="unbounded">
>>>                         <xsd:annotation>
>>>                             <xsd:documentation>
>>>                                 The element ref-type is used to
>>> specify the
>>>                                 interface implemented by GBean being
>>> referenced.
>>>                             </xsd:documentation>
>>>                         </xsd:annotation>
>>>                     </xsd:element>
>>>                     <xsd:choice minOccurs="0" maxOccurs="unbounded">
>>>                         <xsd:element name="pattern"
>>>                             type="gernaming:patternType">
>>>                             <xsd:annotation>
>>>                                 <xsd:documentation>
>>>                                     The element pattern is used to
>>> provide
>>>                                     additional selection criterion
>>> for gbeans if
>>>                                     multiple gbeans with same name
>>> exists in
>>>                                     dependency modules. The pattern
>>> mapped
>>>                                     should result in single gbean.
>>>                                 </xsd:documentation>
>>>                             </xsd:annotation>
>>>                         </xsd:element>
>>>                     </xsd:choice>
>>>                 </xsd:sequence>
>>>             </xsd:extension>
>>>         </xsd:complexContent>
>>>     </xsd:complexType>
>>>
>>> Hope this helps..... this is a bit of a user list question.  Ask if
>>> you need more hints.
>>>
>>> thanks
>>> david jencks
>>>
>>>>
>>>>
>>>>
>>>>
>>>> djencks wrote:
>>>>>
>>>>>
>>>>> On Oct 24, 2008, at 1:49 AM, Hearty Raphael wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>>        Is there any way I can create custom resource factories/
>>>>>> ObjectFactories in geronimo.?
>>>>>
>>>>> probably, but knowing exactly what you are trying to achieve would
>>>>> help a lot.  Geronimo has no persistent jndi so there's usually an
>>>>> easier or more direct way to get stuff into jndi.
>>>>>
>>>>> thanks
>>>>> david jencks
>>>>>
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> Hearty
>>>>>
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/Custom-resource-factories-in-geronimo-tp20159796s134p20202105.html
>>>> Sent from the Apache Geronimo - Dev mailing list archive at
>>>> Nabble.com.
>>>>
>>>
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Custom-resource-factories-in-geronimo-tp20159796s134p20204850.html
> Sent from the Apache Geronimo - Dev mailing list archive at  
> Nabble.com.
>


Mime
View raw message