You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Richard Wallace <rw...@thewallacepack.net> on 2005/11/12 00:02:35 UTC

Testing with EJB3

Hey everyone,

I'm trying to build an application using Jboss and their EJB3 
implementation.  Their EJB3 implementation comes with an embeddable EJB3 
container that can be used for, among other things, testing.  I'm trying 
to get this working with m2, but there are no EJB3 jars from jboss in 
the central maven repo.  Does anyone know of a more frequently updated 
repo for jboss jars?

If not. does anyone have any suggestions or know someone who knows 
someone that knows someone that can put the jboss 4.0.3 and the latest 
EJB3 jars up on ibiblio?

If not, I may have to bite the bullet and go with ant for now, which I 
am loathe to do because maven is so dang cool.

Thanks,
Rich

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Testing with EJB3

Posted by Richard Wallace <rw...@thewallacepack.net>.
Sorry it took so long to get back, but I've been side-tracked this past 
week.  The test I'm trying to run is:

import java.util.Hashtable;

import javax.naming.InitialContext;
import javax.persistence.EntityManager;
import javax.transaction.TransactionManager;

import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;

import com.contentconnections.revman.book.Publisher;

import junit.framework.TestCase;

public class PublisherPersistenceTest
        extends TestCase {

    public void setUp () {
        EJB3StandaloneBootstrap.boot (null);
        EJB3StandaloneBootstrap.scanClasspath ();
    }

    public void tearDown () {
        EJB3StandaloneBootstrap.shutdown ();
    }

    public void testAdd ()
            throws Exception {
        EntityManager em = (EntityManager) getInitialContext().lookup 
("java:/EntityManagers/revman");
        TransactionManager tm = (TransactionManager) 
getInitialContext().lookup ("java:/TransactionManager");

        tm.begin();

        Publisher publisher = new Publisher ();
        publisher.setName ("Prentice Hall");
        publisher.setAbbreviation ("PH");
        em.persist (publisher);

        tm.commit ();
    }

    public static InitialContext getInitialContext() throws Exception {
       Hashtable props = getInitialContextProperties ();
       return new InitialContext (props);
    }

    private static Hashtable getInitialContextProperties () {
       Hashtable<String, String> props = new Hashtable<String, String>();
       props.put ("java.naming.factory.initial", 
"org.jnp.interfaces.LocalOnlyContextFactory");
       props.put ("java.naming.factory.url.pkgs", 
"org.jboss.naming:org.jnp.interfaces");
       return props;
    }
}

Any suggestions?

Thanks,
Rich

Tanju Erinmez wrote:
> I haven't noticed the error you mention. What I usually get is a
> "JBossMXServerConfig" exception whenever I run surefire with mvn test.
> That's not nice but it isn't a problem either because the test cases are run
> anyway.
>  How do you execute the container?
>  - Tanju
>
>  On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
>   
>> Ya, the other problem I found is trying to track down the proper
>> versions of all the 3rd party libs. I thought about making one big jar,
>> but was hoping to find a way around that. Now that I've done it, I'm
>> glad I did cause it works out pretty nicely. Only thing I'm running
>> into now is that when I go to start the embedded container I get the
>> following exception:
>>
>> 2005-11-12 14:05:08,936 128 ERROR [main] org.jboss.xb.binding.Util
>> (Util.java:419) - Failed to create schema loader.
>> java.lang.ClassCastException:
>> org.apache.xerces.dom.DOMXSImplementationSourceImpl
>> at
>> org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(Unknown
>> Source)
>> at org.jboss.xb.binding.Util.getXSImplementation(Util.java:414)
>> at org.jboss.xb.binding.Util.loadSchema(Util.java:269)
>> at
>> org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java
>> :100)
>> at
>> org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java
>> :87)
>> at
>> org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.readXsd(
>> BeanSchemaBinding.java:997)
>> at
>> org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.getSchemaBinding
>> (BeanSchemaBinding.java:211)
>> at
>> org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.<init>(
>> BeanXMLDeployer.java:34)
>> at
>> org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(
>> EJB3StandaloneBootstrap.java:209)
>>
>> I'm guessing it could have something to do with an incompatibility in
>> the versions of the xerces that the embedded ejb3 container comes with
>> and the one that maven uses. Did you run into this at all? How did you
>> solve it?
>>
>> Thanks,
>> Rich
>>
>> Tanju Erinmez wrote:
>>     
>>> The problem deployment wise with the JBoss EJB3 alpha 3 release is that
>>>       
>> the
>>     
>>> 3rd party libs are not pruned (reduced to the necessary ones). So you
>>>       
>> might
>>     
>>> find yourself doing some unnecessary work.
>>> What I did for the time being and not waste too much time on infra was
>>>       
>> to
>>     
>>> simply jar everything up and install this single jar as a 3rd party jar
>>>       
>> (as
>>     
>>> described before). This works for me because I don't import anything
>>>       
>> else
>>     
>>> into the ejb3 project.
>>> HTH,
>>> Tanju
>>> On 11/12/05, Brett Porter <br...@gmail.com> wrote:
>>>
>>>       
>>>> You can request them to be uploaded. You can also install them in a
>>>> local repository yourself (much like working with Ant).
>>>>
>>>>
>>>>         
>> http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html
>>     
>>>> http://maven.apache.org/guides/mini/guide-ibiblio-upload.html
>>>>
>>>> - Brett
>>>>
>>>>
>>>>
>>>> On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
>>>>
>>>>         
>>>>> Hey everyone,
>>>>>
>>>>> I'm trying to build an application using Jboss and their EJB3
>>>>> implementation. Their EJB3 implementation comes with an embeddable
>>>>>           
>> EJB3
>>     
>>>>> container that can be used for, among other things, testing. I'm
>>>>>           
>> trying
>>     
>>>>> to get this working with m2, but there are no EJB3 jars from jboss in
>>>>> the central maven repo. Does anyone know of a more frequently updated
>>>>> repo for jboss jars?
>>>>>
>>>>> If not. does anyone have any suggestions or know someone who knows
>>>>> someone that knows someone that can put the jboss 4.0.3 and the latest
>>>>> EJB3 jars up on ibiblio?
>>>>>
>>>>> If not, I may have to bite the bullet and go with ant for now, which I
>>>>> am loathe to do because maven is so dang cool.
>>>>>
>>>>> Thanks,
>>>>> Rich
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>>         
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Testing with EJB3

Posted by Tanju Erinmez <ta...@gmail.com>.
I haven't noticed the error you mention. What I usually get is a
"JBossMXServerConfig" exception whenever I run surefire with mvn test.
That's not nice but it isn't a problem either because the test cases are run
anyway.
 How do you execute the container?
 - Tanju

 On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
>
> Ya, the other problem I found is trying to track down the proper
> versions of all the 3rd party libs. I thought about making one big jar,
> but was hoping to find a way around that. Now that I've done it, I'm
> glad I did cause it works out pretty nicely. Only thing I'm running
> into now is that when I go to start the embedded container I get the
> following exception:
>
> 2005-11-12 14:05:08,936 128 ERROR [main] org.jboss.xb.binding.Util
> (Util.java:419) - Failed to create schema loader.
> java.lang.ClassCastException:
> org.apache.xerces.dom.DOMXSImplementationSourceImpl
> at
> org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(Unknown
> Source)
> at org.jboss.xb.binding.Util.getXSImplementation(Util.java:414)
> at org.jboss.xb.binding.Util.loadSchema(Util.java:269)
> at
> org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java
> :100)
> at
> org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java
> :87)
> at
> org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.readXsd(
> BeanSchemaBinding.java:997)
> at
> org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.getSchemaBinding
> (BeanSchemaBinding.java:211)
> at
> org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.<init>(
> BeanXMLDeployer.java:34)
> at
> org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(
> EJB3StandaloneBootstrap.java:209)
>
> I'm guessing it could have something to do with an incompatibility in
> the versions of the xerces that the embedded ejb3 container comes with
> and the one that maven uses. Did you run into this at all? How did you
> solve it?
>
> Thanks,
> Rich
>
> Tanju Erinmez wrote:
> > The problem deployment wise with the JBoss EJB3 alpha 3 release is that
> the
> > 3rd party libs are not pruned (reduced to the necessary ones). So you
> might
> > find yourself doing some unnecessary work.
> > What I did for the time being and not waste too much time on infra was
> to
> > simply jar everything up and install this single jar as a 3rd party jar
> (as
> > described before). This works for me because I don't import anything
> else
> > into the ejb3 project.
> > HTH,
> > Tanju
> > On 11/12/05, Brett Porter <br...@gmail.com> wrote:
> >
> >> You can request them to be uploaded. You can also install them in a
> >> local repository yourself (much like working with Ant).
> >>
> >>
> http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html
> >> http://maven.apache.org/guides/mini/guide-ibiblio-upload.html
> >>
> >> - Brett
> >>
> >>
> >>
> >> On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
> >>
> >>> Hey everyone,
> >>>
> >>> I'm trying to build an application using Jboss and their EJB3
> >>> implementation. Their EJB3 implementation comes with an embeddable
> EJB3
> >>> container that can be used for, among other things, testing. I'm
> trying
> >>> to get this working with m2, but there are no EJB3 jars from jboss in
> >>> the central maven repo. Does anyone know of a more frequently updated
> >>> repo for jboss jars?
> >>>
> >>> If not. does anyone have any suggestions or know someone who knows
> >>> someone that knows someone that can put the jboss 4.0.3 and the latest
> >>> EJB3 jars up on ibiblio?
> >>>
> >>> If not, I may have to bite the bullet and go with ant for now, which I
> >>> am loathe to do because maven is so dang cool.
> >>>
> >>> Thanks,
> >>> Rich
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Testing with EJB3

Posted by Richard Wallace <rw...@thewallacepack.net>.
Ya, the other problem I found is trying to track down the proper 
versions of all the 3rd party libs.  I thought about making one big jar, 
but was hoping to find a way around that.  Now that I've done it, I'm 
glad I did cause it works out pretty nicely.  Only thing I'm running 
into now is that when I go to start the embedded container I get the 
following exception:

2005-11-12 14:05:08,936 128  ERROR [main] org.jboss.xb.binding.Util  
(Util.java:419) - Failed to create schema loader.
java.lang.ClassCastException: 
org.apache.xerces.dom.DOMXSImplementationSourceImpl
        at 
org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(Unknown Source)
        at org.jboss.xb.binding.Util.getXSImplementation(Util.java:414)
        at org.jboss.xb.binding.Util.loadSchema(Util.java:269)
        at 
org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:100)
        at 
org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:87)
        at 
org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.readXsd(BeanSchemaBinding.java:997)
        at 
org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding.getSchemaBinding(BeanSchemaBinding.java:211)
        at 
org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.<init>(BeanXMLDeployer.java:34)
        at 
org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:209)

I'm guessing it could have something to do with an incompatibility in 
the versions of the xerces that the embedded ejb3 container comes with 
and the one that maven uses.  Did you run into this at all?  How did you 
solve it?

Thanks,
Rich

Tanju Erinmez wrote:
> The problem deployment wise with the JBoss EJB3 alpha 3 release is that the
> 3rd party libs are not pruned (reduced to the necessary ones). So you might
> find yourself doing some unnecessary work.
> What I did for the time being and not waste too much time on infra was to
> simply jar everything up and install this single jar as a 3rd party jar (as
> described before). This works for me because I don't import anything else
> into the ejb3 project.
>  HTH,
> Tanju
>  On 11/12/05, Brett Porter <br...@gmail.com> wrote:
>   
>> You can request them to be uploaded. You can also install them in a
>> local repository yourself (much like working with Ant).
>>
>> http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html
>> http://maven.apache.org/guides/mini/guide-ibiblio-upload.html
>>
>> - Brett
>>
>>
>>
>> On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
>>     
>>> Hey everyone,
>>>
>>> I'm trying to build an application using Jboss and their EJB3
>>> implementation. Their EJB3 implementation comes with an embeddable EJB3
>>> container that can be used for, among other things, testing. I'm trying
>>> to get this working with m2, but there are no EJB3 jars from jboss in
>>> the central maven repo. Does anyone know of a more frequently updated
>>> repo for jboss jars?
>>>
>>> If not. does anyone have any suggestions or know someone who knows
>>> someone that knows someone that can put the jboss 4.0.3 and the latest
>>> EJB3 jars up on ibiblio?
>>>
>>> If not, I may have to bite the bullet and go with ant for now, which I
>>> am loathe to do because maven is so dang cool.
>>>
>>> Thanks,
>>> Rich
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Testing with EJB3

Posted by Tanju Erinmez <ta...@gmail.com>.
The problem deployment wise with the JBoss EJB3 alpha 3 release is that the
3rd party libs are not pruned (reduced to the necessary ones). So you might
find yourself doing some unnecessary work.
What I did for the time being and not waste too much time on infra was to
simply jar everything up and install this single jar as a 3rd party jar (as
described before). This works for me because I don't import anything else
into the ejb3 project.
 HTH,
Tanju
 On 11/12/05, Brett Porter <br...@gmail.com> wrote:
>
> You can request them to be uploaded. You can also install them in a
> local repository yourself (much like working with Ant).
>
> http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html
> http://maven.apache.org/guides/mini/guide-ibiblio-upload.html
>
> - Brett
>
>
>
> On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
> > Hey everyone,
> >
> > I'm trying to build an application using Jboss and their EJB3
> > implementation. Their EJB3 implementation comes with an embeddable EJB3
> > container that can be used for, among other things, testing. I'm trying
> > to get this working with m2, but there are no EJB3 jars from jboss in
> > the central maven repo. Does anyone know of a more frequently updated
> > repo for jboss jars?
> >
> > If not. does anyone have any suggestions or know someone who knows
> > someone that knows someone that can put the jboss 4.0.3 and the latest
> > EJB3 jars up on ibiblio?
> >
> > If not, I may have to bite the bullet and go with ant for now, which I
> > am loathe to do because maven is so dang cool.
> >
> > Thanks,
> > Rich
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Testing with EJB3

Posted by Brett Porter <br...@gmail.com>.
You can request them to be uploaded. You can also install them in a
local repository yourself (much like working with Ant).

http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html
http://maven.apache.org/guides/mini/guide-ibiblio-upload.html

- Brett



On 11/12/05, Richard Wallace <rw...@thewallacepack.net> wrote:
> Hey everyone,
>
> I'm trying to build an application using Jboss and their EJB3
> implementation.  Their EJB3 implementation comes with an embeddable EJB3
> container that can be used for, among other things, testing.  I'm trying
> to get this working with m2, but there are no EJB3 jars from jboss in
> the central maven repo.  Does anyone know of a more frequently updated
> repo for jboss jars?
>
> If not. does anyone have any suggestions or know someone who knows
> someone that knows someone that can put the jboss 4.0.3 and the latest
> EJB3 jars up on ibiblio?
>
> If not, I may have to bite the bullet and go with ant for now, which I
> am loathe to do because maven is so dang cool.
>
> Thanks,
> Rich
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org