You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ebmm_axis <tl...@myrealbox.com> on 2008/11/10 23:21:28 UTC
ServiceProvider Id in openejb.xml
I'm trying to use a different Resource Adapter than the
ActiveMqResourceAdapter.
I cannot get it to work.
The openejb.log reports the following:
"Cannot find the ServiceProvider id in the service-jar.xml. Check that
your configuration file is point(ed) at the right service provider id."
So, my question is: Where is this service-jar.xml file and how do I edit it
to put in a "ServiceProvider Id" so other resources besides the defaults can
be used?
--
View this message in context: http://www.nabble.com/ServiceProvider-Id-in-openejb.xml-tp20429295p20429295.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: ServiceProvider Id in openejb.xml
Posted by David Blevins <da...@visi.com>.
On Nov 10, 2008, at 6:02 PM, ebmm_axis wrote:
>
> So,I've been playing around witht his a little bit more, but I still
> can't
> get it to work...
>
>
> On the OpenEJB site it states the following:
>
>
> The service-jar.xml should be placed not in the META-INF but
> somewhere in
> your package hierarchy (ours is in /org/apache/openejb/service-
> jar.xml)
> which allows the services in your service-jar.xml to be referenced
> by name
> (such as DefaultStatefulContainer) or more specifically by package
> and id
> (such as org.apache.openejb#DefaultStatefulContainer).
>
> I have a jar that I have copied to the lib subdirectory with a file
> called
> service-jar.xml.
>
> I don'tknow if the syntax of the service-jar.xml is right or not,
> but this
> is what I've found around the net...
>
> <ServiceProvider
> id="myId"
> provider-type="Resource"
> class-name="org.myclass.myclass.TheClassIWantToUse">
> </ServiceProvider>
>
> In my openejb-jar.xml config file I have the following:
>
> <Resource id="defaultResource" type="TheClassIWantToUse"
> provider="myId">
> </Resource>
This is really close, you just need to add the package part to the
'provider' attribute. So if you put it at META-INF/com.foo/service-
jar.xml, the provider id would be "com.foo#myId".
That said, there might be a simpler way to do what you want overall.
The service-jar.xml stuff is really geared towards plugging in
something that needs to be configurable. If you simply want an
instance of a specific class injected you can create a property editor
for it as described here: http://openejb.apache.org/3.0/custom-injection.html
.
Let us know if that helps. Also, feel free to go into detail on the
kind of thing you're looking to add to the system as we definitely use
that feedback to drive features. We've talked about enhancements to
the service-jar.xml/openejb.xml functionality as well as specific
enhancements for j2ee connector configuration and more.
-David
Re: ServiceProvider Id in openejb.xml
Posted by ebmm_axis <tl...@myrealbox.com>.
So,I've been playing around witht his a little bit more, but I still can't
get it to work...
On the OpenEJB site it states the following:
The service-jar.xml should be placed not in the META-INF but somewhere in
your package hierarchy (ours is in /org/apache/openejb/service-jar.xml)
which allows the services in your service-jar.xml to be referenced by name
(such as DefaultStatefulContainer) or more specifically by package and id
(such as org.apache.openejb#DefaultStatefulContainer).
I have a jar that I have copied to the lib subdirectory with a file called
service-jar.xml.
I don'tknow if the syntax of the service-jar.xml is right or not, but this
is what I've found around the net...
<ServiceProvider
id="myId"
provider-type="Resource"
class-name="org.myclass.myclass.TheClassIWantToUse">
</ServiceProvider>
In my openejb-jar.xml config file I have the following:
<Resource id="defaultResource" type="TheClassIWantToUse" provider="myId">
</Resource>
When I start up the server this is the error I get:
org.apache.openejb.OpenEJBException: Failed Configuring
Service(id=defaultResource): Cannot find the ServiceProvider id myId in the
service-jar.xml at myId. Check that your OpenEJB configuration file is point
to the right ServiceProvider id."
Anybody know what I'm doing wrong. It's a simple configuratin issue, I
know, but I just cannot find the correct syntax and/or placement of the
references.
Thanx ahead of time.
--
View this message in context: http://www.nabble.com/ServiceProvider-Id-in-openejb.xml-tp20429295p20432135.html
Sent from the OpenEJB User mailing list archive at Nabble.com.