You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by David Blevins <da...@visi.com> on 2009/11/01 01:54:30 UTC

Re: Configuring Resource Adapter

Hi Philipp,

I've been hacking on this and it looks like I'll need more changes  
that I anticipated -- some related code that really needs to be fixed  
up.

In the meantime you can use the <config-property-value> element  
directly in the ra.xml file to setup Jackrabbit.

This support may also be useful if you'd like to set it up differently  
for various tests:

   http://openejb.apache.org/3.0/alternate-descriptors.html

It *should* work for ra.xml files as well.

-David


On Oct 22, 2009, at 12:36 AM, Philipp Bunge wrote:

> Hi David!
>
> Thanks for taking a look! I really appreciate it!
>
> I've attached a the maven test project that I had hacked together.
>
> Thanks,
> Philipp
>
>
> On Wed, Oct 21, 2009 at 11:58 PM, David Blevins <david.blevins@visi.com 
> > wrote:
>>
>> On Oct 21, 2009, at 1:47 PM, Philipp Bunge wrote:
>>
>>> However, the repository never gets injected into my bean:
>>> WARN - Injection data not found in enc:
>>> jndiName='test.TestServiceBean/repository', target=class
>>> test.TestServiceBean/repository
>>>
>>> I guess this makes sense because I never actually configured the
>>> resource adapter (I would like to specify the Jackrabbit specific
>>> configuration file). I tried doing with in my jndi.properties as
>>> follows:
>>> repository = new://Resource?type=javax.jcr.Repository
>>> repository.HomeDir = /tmp/jackrabbit
>>> repository.ConfigFile = /tmp/jackrabbit/repository.xml
>>>
>>> This fails however, as openejb will know nothing about the resource
>>> adapter yet when it tries to create the resource.
>>
>> Though, what you tried to do makes a lot of sense and is pretty  
>> intuitive.
>>  It's pretty exciting actually as I had a good long look at the  
>> pieces
>> involved and think there's a way we can make this work.
>>
>> Going to see if I can hack up something for you.
>>
>> -David
>>
>>
> <jackrabbit-jca.tar.bz2>


Re: Configuring Resource Adapter

Posted by thabach <ba...@evolootion.ch>.
Hi Tom

you should succeed in looking up the ManagedConnectionFactory in the global
JNDI tree under "java:openejb/Resource/repository" (see also this 
http://markmail.org/thread/kp4wft7lnwq4sybh thread ).

Cheers, Christian.


ttsuchi wrote:
> 
> Hello,
> 
> I am also trying to use Jackrabbit via JCA.  I've placed the Jackrabbit
> RAR in the classpath and hard-coded some config-property-value in the
> META-INF/ra.xml file.  However, it's still not getting injected to my
> EJBs.  I tried
> 
> @Resource
> Repository repository;
> 
> ... but this is null. The log says:
> 
> INFO - Configuring Service(id=repositoryRA, type=Resource,
> provider-id=repositoryRA)
> INFO - Configuring Service(id=repository, type=Resource,
> provider-id=repository)
> DEBUG - [TransactionSupport=xa]
> DEBUG - [ResourceAdapter=repositoryRA]
> DEBUG - Using default 'openejb.validation.output.level=medium'.  Possible
> values are: terse, medium, verbose
> INFO - Enterprise application "classpath.ear" loaded.
> DEBUG - Starting ResourceAdapter(id=Default JMS Resource Adapter)
> DEBUG - LocalIntialContext.close()
> INFO - Assembling app: classpath.ear
> INFO - Using 'openejb.tempclassloader.skip=annotations'
> DEBUG - Starting ResourceAdapter(id=repositoryRA)
> WARN - Property "ResourceAdapter" not supported by "repository"
> ...
> WARN - Injection data not found in enc:
> jndiName='com.mycompany.SomeBean/repository', target=class
> com.mycompany.SomeBean/repository
> 
> Somehow I don't think the resource has been mapped in the JNDI tree to
> start with...  How is the JNDI name for the inbound resource configured in
> OpenEJB? Also, is there any documentation for JCA support in OpenEJB?
> 
> Thanks,
> Tom
> 
> 
> Philipp Bunge-2 wrote:
>> 
>> Hi David!
>> 
>>> I've been hacking on this and it looks like I'll need more changes that
>>> I
>>> anticipated -- some related code that really needs to be fixed up.
>>>
>>> In the meantime you can use the <config-property-value> element directly
>>> in
>>> the ra.xml file to setup Jackrabbit.
>> 
>> Thanks for looking in to it!
>> Yes, in the meantime I managed to work around it, so it's not as sexy
>> as it could be but at least my unit tests work. :-)
>> 
>> And thanks for all your work on OpenEJB! It's something we really
>> appreciate a lot!
>> 
>> Cheers,
>> Philipp
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Configuring-Resource-Adapter-tp26000024p26535010.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Configuring Resource Adapter

Posted by Philipp Bunge <bu...@crimson.ch>.
Hi Tom

> I am also trying to use Jackrabbit via JCA.  I've placed the Jackrabbit RAR
> in the classpath and hard-coded some config-property-value in the
> META-INF/ra.xml file.  However, it's still not getting injected to my EJBs.
> I tried
>
> @Resource
> Repository repository;
>
> ... but this is null.

I had that issue as well, but the problem was actually unrelated to
any JNDI issues. I had forgotten to create the Jackrabbit repository
directory and that's why the resource adapter wasn't working. Took me
a while to figure out though, as the errors didn't show up in my logs.
I only noticed once I stepped through with a debugger.

I also set the connector ID as Christian wrote, but more out of
cosmetic reasons. It didn't actually have an effect on the deployment
in my case.

Cheers,
Philipp

Re: Configuring Resource Adapter

Posted by ttsuchi <To...@hotmail.com>.
Hello,

I am also trying to use Jackrabbit via JCA.  I've placed the Jackrabbit RAR
in the classpath and hard-coded some config-property-value in the
META-INF/ra.xml file.  However, it's still not getting injected to my EJBs. 
I tried

@Resource
Repository repository;

... but this is null. The log says:

INFO - Configuring Service(id=repositoryRA, type=Resource,
provider-id=repositoryRA)
INFO - Configuring Service(id=repository, type=Resource,
provider-id=repository)
DEBUG - [TransactionSupport=xa]
DEBUG - [ResourceAdapter=repositoryRA]
DEBUG - Using default 'openejb.validation.output.level=medium'.  Possible
values are: terse, medium, verbose
INFO - Enterprise application "classpath.ear" loaded.
DEBUG - Starting ResourceAdapter(id=Default JMS Resource Adapter)
DEBUG - LocalIntialContext.close()
INFO - Assembling app: classpath.ear
INFO - Using 'openejb.tempclassloader.skip=annotations'
DEBUG - Starting ResourceAdapter(id=repositoryRA)
WARN - Property "ResourceAdapter" not supported by "repository"
...
WARN - Injection data not found in enc:
jndiName='com.mycompany.SomeBean/repository', target=class
com.mycompany.SomeBean/repository

Somehow I don't think the resource has been mapped in the JNDI tree to start
with...  How is the JNDI name for the inbound resource configured in
OpenEJB? Also, is there any documentation for JCA support in OpenEJB?

Thanks,
Tom


Philipp Bunge-2 wrote:
> 
> Hi David!
> 
>> I've been hacking on this and it looks like I'll need more changes that I
>> anticipated -- some related code that really needs to be fixed up.
>>
>> In the meantime you can use the <config-property-value> element directly
>> in
>> the ra.xml file to setup Jackrabbit.
> 
> Thanks for looking in to it!
> Yes, in the meantime I managed to work around it, so it's not as sexy
> as it could be but at least my unit tests work. :-)
> 
> And thanks for all your work on OpenEJB! It's something we really
> appreciate a lot!
> 
> Cheers,
> Philipp
> 
> 

-- 
View this message in context: http://old.nabble.com/Configuring-Resource-Adapter-tp26000024p26521977.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Configuring Resource Adapter

Posted by Philipp Bunge <bu...@crimson.ch>.
Hi David!

> I've been hacking on this and it looks like I'll need more changes that I
> anticipated -- some related code that really needs to be fixed up.
>
> In the meantime you can use the <config-property-value> element directly in
> the ra.xml file to setup Jackrabbit.

Thanks for looking in to it!
Yes, in the meantime I managed to work around it, so it's not as sexy
as it could be but at least my unit tests work. :-)

And thanks for all your work on OpenEJB! It's something we really
appreciate a lot!

Cheers,
Philipp