You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Fred59 <fr...@atosorigin.com> on 2008/09/18 12:21:32 UTC

Problem during deployment with ejb-jar.xml

Hi all,

I'm using OpenEJB 3.0. I try to override a persistence context defined in a
session. Hereafter the ejb-jar.xml content

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar 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/ejb-jar_3_0.xsd"
	version="3.0">
<enterprise-beans>
    <session>
	<ejb-name>MySessionImpl</ejb-name>
            <persistence-context-ref>
               
<persistence-context-ref-name>core.impl.MySessionImpl/em</persistence-context-ref-name>
                <persistence-unit-name>myDomainExt</persistence-unit-name>
            </persistence-context-ref>
    </session>
</enterprise-beans>
</ejb-jar> 


When I start OpenEJB I get the following stacktrace :
http://www.nabble.com/file/p19549842/ejb-jarTrace.txt ejb-jarTrace.txt 

When I don't implement ejb-jar.xml, everything is fine. Could you tell me,
what am I doing wrong ?
Thanks for your answer.

Fred.


-- 
View this message in context: http://www.nabble.com/Problem-during-deployment-with-ejb-jar.xml-tp19549842p19549842.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Problem during deployment with ejb-jar.xml

Posted by Fred59 <fr...@atosorigin.com>.
Hello David,

Thanks for the answer.
In fact The "MySessionImpl" bean is packaged in a EJB-JAR located in the
classpath of an other EJB project. I want to override its persistence
context in order to use it with the persistence unit of the second project.
I don't know if it helps....

Anyway if I add an <ejb-class> tag and I don't get the exception anymore.
I still continue my work on that case. Thanks again.

Fred


David Blevins wrote:
> 
> On Sep 18, 2008, at 3:21 AM, Fred59 wrote:
> 
>>
>> Hi all,
>>
>> I'm using OpenEJB 3.0. I try to override a persistence context  
>> defined in a
>> session. Hereafter the ejb-jar.xml content
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ejb-jar 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/ejb-jar_3_0.xsd"
>> 	version="3.0">
>> <enterprise-beans>
>>    <session>
>> 	<ejb-name>MySessionImpl</ejb-name>
>>            <persistence-context-ref>
>>
>> <persistence-context-ref-name>core.impl.MySessionImpl/em</ 
>> persistence-context-ref-name>
>>                <persistence-unit-name>myDomainExt</persistence-unit- 
>> name>
>>            </persistence-context-ref>
>>    </session>
>> </enterprise-beans>
>> </ejb-jar>
>>
> 
> It's fine to leave the <ejb-class> tag off as the annotated bean with  
> the same name can fill in that data, but in this case it looks like  
> there is no bean with the ejb-name MySessionImpl and therefore it  
> isn't overriding anything.
> 
> -David
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-during-deployment-with-ejb-jar.xml-tp19549842p19567786.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Problem during deployment with ejb-jar.xml

Posted by David Blevins <da...@visi.com>.
On Sep 18, 2008, at 3:21 AM, Fred59 wrote:

>
> Hi all,
>
> I'm using OpenEJB 3.0. I try to override a persistence context  
> defined in a
> session. Hereafter the ejb-jar.xml content
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ejb-jar 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/ejb-jar_3_0.xsd"
> 	version="3.0">
> <enterprise-beans>
>    <session>
> 	<ejb-name>MySessionImpl</ejb-name>
>            <persistence-context-ref>
>
> <persistence-context-ref-name>core.impl.MySessionImpl/em</ 
> persistence-context-ref-name>
>                <persistence-unit-name>myDomainExt</persistence-unit- 
> name>
>            </persistence-context-ref>
>    </session>
> </enterprise-beans>
> </ejb-jar>
>

It's fine to leave the <ejb-class> tag off as the annotated bean with  
the same name can fill in that data, but in this case it looks like  
there is no bean with the ejb-name MySessionImpl and therefore it  
isn't overriding anything.

-David