You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thorsten Heit <th...@gmx.de> on 2007/04/02 16:12:30 UTC

Re: eclipse and maven discrepancies

Hi Rolf,


> this is not a junit test but a testng.
> Transactions are handled in the testmethods themselves.
> The error messages are not describing the real error.
> The problem is that for some reason during the maven execution of the
> test.
> Testng and the embeddable ejb container  have some conflicts but  I don't
> see why
> I  know this only by looking at the first  error  and  having commented
> out
> a line in the second test (transaction.begin) than the second test fails
> by
> stating that a session bean was not bound/found.

Sorry, but I don't know TestNG, only JUnit... According to the exception I'd assume that there _is_ a problem with correctly opening and closing the transaction. If not, then at least with the initialization and/or shutdown of your test class / test method...

Without knowing your source I'm wondering whether your failing test class can run standalone or relies on others for doing its checks, for example via static initializers, during init/shutdown etc. Have you checked that?


Cheers

Thorsten

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


Re: eclipse and maven discrepancies

Posted by Rolf Strijdhorst <ro...@gmail.com>.
Yes I've read the conversation. and it works.
I can finally go on with cavaeatemptor



On 4/5/07, Wayne Fay <wa...@gmail.com> wrote:
>
> I actually sent another email to the list with some more details:
>         date            Apr 3, 2007 10:25 AM
>         subject         Surefire TestNG troubles
>
> Mark D. responded that TestNG's API changed so they break Surefire,
> but this is currently being worked on, so hopefully we'll get some
> working releases soon.
>
> He suggested using the latest TestNG Ant plugin with Antrun if you
> need functionality in v5.2+.
>
> Wayne
>
> On 4/4/07, Rolf Strijdhorst <ro...@gmail.com> wrote:
> > Hi Wayne,
> >
> > I have the tests working in eclipse, but not in maven.
> > And even then eclipse and maven need to work together because of some
> > problems in project building with eclipse.
> >
> > As I've stated before for some reason my maven build fails with testng
> > because surefire and testng and the embedded container do not work well
> > together.
> >
> > in the log I see that jboss finds the sessionbeans I've created. but
> when I
> > do a lookup the only thing I am able to retrieve is the user
> transaction.
> > every other object (entitymanagerfactory, sessionbeans) could not be
> > retrieved from jndi
> >
> > any clue?
> > Rolf
> >
> > On 4/2/07, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > Rolf, just wondering how far along you got in converting the
> > > CaveatEmptor JPA/EJB3/Hibernate app from Ant to Maven... I've been
> > > working on this myself some this morning.
> > >
> > > Were you ever 100% successful? Assuming you were, we should send your
> > > modified zip to Hibernate for inclusion on their download page.
> > >
> > > Also, why is the JBoss stuff only available on the Andromda repo? I'd
> > > hope JBoss would host it, or perhaps even Central.
> > >
> > > Wayne
> > >
> > > On 4/2/07, Thorsten Heit <th...@gmx.de> wrote:
> > > > Hi Rolf,
> > > >
> > > >
> > > > > this is not a junit test but a testng.
> > > > > Transactions are handled in the testmethods themselves.
> > > > > The error messages are not describing the real error.
> > > > > The problem is that for some reason during the maven execution of
> the
> > > > > test.
> > > > > Testng and the embeddable ejb container  have some conflicts
> but  I
> > > don't
> > > > > see why
> > > > > I  know this only by looking at the first  error  and  having
> > > commented
> > > > > out
> > > > > a line in the second test (transaction.begin) than the second test
> > > fails
> > > > > by
> > > > > stating that a session bean was not bound/found.
> > > >
> > > > Sorry, but I don't know TestNG, only JUnit... According to the
> exception
> > > I'd assume that there _is_ a problem with correctly opening and
> closing the
> > > transaction. If not, then at least with the initialization and/or
> shutdown
> > > of your test class / test method...
> > > >
> > > > Without knowing your source I'm wondering whether your failing test
> > > class can run standalone or relies on others for doing its checks, for
> > > example via static initializers, during init/shutdown etc. Have you
> checked
> > > that?
> > > >
> > > >
> > > > Cheers
> > > >
> > > > Thorsten
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > 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: eclipse and maven discrepancies

Posted by Wayne Fay <wa...@gmail.com>.
I actually sent another email to the list with some more details:
	date		Apr 3, 2007 10:25 AM	
	subject		Surefire TestNG troubles

Mark D. responded that TestNG's API changed so they break Surefire,
but this is currently being worked on, so hopefully we'll get some
working releases soon.

He suggested using the latest TestNG Ant plugin with Antrun if you
need functionality in v5.2+.

Wayne

On 4/4/07, Rolf Strijdhorst <ro...@gmail.com> wrote:
> Hi Wayne,
>
> I have the tests working in eclipse, but not in maven.
> And even then eclipse and maven need to work together because of some
> problems in project building with eclipse.
>
> As I've stated before for some reason my maven build fails with testng
> because surefire and testng and the embedded container do not work well
> together.
>
> in the log I see that jboss finds the sessionbeans I've created. but when I
> do a lookup the only thing I am able to retrieve is the user transaction.
> every other object (entitymanagerfactory, sessionbeans) could not be
> retrieved from jndi
>
> any clue?
> Rolf
>
> On 4/2/07, Wayne Fay <wa...@gmail.com> wrote:
> >
> > Rolf, just wondering how far along you got in converting the
> > CaveatEmptor JPA/EJB3/Hibernate app from Ant to Maven... I've been
> > working on this myself some this morning.
> >
> > Were you ever 100% successful? Assuming you were, we should send your
> > modified zip to Hibernate for inclusion on their download page.
> >
> > Also, why is the JBoss stuff only available on the Andromda repo? I'd
> > hope JBoss would host it, or perhaps even Central.
> >
> > Wayne
> >
> > On 4/2/07, Thorsten Heit <th...@gmx.de> wrote:
> > > Hi Rolf,
> > >
> > >
> > > > this is not a junit test but a testng.
> > > > Transactions are handled in the testmethods themselves.
> > > > The error messages are not describing the real error.
> > > > The problem is that for some reason during the maven execution of the
> > > > test.
> > > > Testng and the embeddable ejb container  have some conflicts but  I
> > don't
> > > > see why
> > > > I  know this only by looking at the first  error  and  having
> > commented
> > > > out
> > > > a line in the second test (transaction.begin) than the second test
> > fails
> > > > by
> > > > stating that a session bean was not bound/found.
> > >
> > > Sorry, but I don't know TestNG, only JUnit... According to the exception
> > I'd assume that there _is_ a problem with correctly opening and closing the
> > transaction. If not, then at least with the initialization and/or shutdown
> > of your test class / test method...
> > >
> > > Without knowing your source I'm wondering whether your failing test
> > class can run standalone or relies on others for doing its checks, for
> > example via static initializers, during init/shutdown etc. Have you checked
> > that?
> > >
> > >
> > > Cheers
> > >
> > > Thorsten
> > >
> > > ---------------------------------------------------------------------
> > > 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: eclipse and maven discrepancies

Posted by Jeremy Whiting <wh...@hotmail.com>.
Hi,
  I had the same problem running caveat emptor in eclipse. The explanation
was touched on earlier in this thread but not identified as the reason.

 The compiled classes have been placed alongside the source file folders in
Eclipse. And this means the class files cannot be loaded for the TestNG
framework because the classes are expected to be in the default place for a
Maven enabled project

test/classes

  To things working uncheck the checkbox called "Allow output folders for
source folders". This will copy the compiled classes (and resource) put into
test/classes.
  You can find the "Allow output folders for source folders" checkbox in  >
Java Build Path > Source (tab)

 And make sure the output folder is:
yourprojectname/target/classes

  Good luck.

Regards,
Jeremy


rolfst wrote:
> 
> Hi Wayne,
> 
> I have the tests working in eclipse, but not in maven.
> And even then eclipse and maven need to work together because of some
> problems in project building with eclipse.
> 
> As I've stated before for some reason my maven build fails with testng
> because surefire and testng and the embedded container do not work well
> together.
> 
> in the log I see that jboss finds the sessionbeans I've created. but when
> I
> do a lookup the only thing I am able to retrieve is the user transaction.
> every other object (entitymanagerfactory, sessionbeans) could not be
> retrieved from jndi
> 
> any clue?
> Rolf
> 
> On 4/2/07, Wayne Fay <wa...@gmail.com> wrote:
>>
>> Rolf, just wondering how far along you got in converting the
>> CaveatEmptor JPA/EJB3/Hibernate app from Ant to Maven... I've been
>> working on this myself some this morning.
>>
>> Were you ever 100% successful? Assuming you were, we should send your
>> modified zip to Hibernate for inclusion on their download page.
>>
>> Also, why is the JBoss stuff only available on the Andromda repo? I'd
>> hope JBoss would host it, or perhaps even Central.
>>
>> Wayne
>>
>> On 4/2/07, Thorsten Heit <th...@gmx.de> wrote:
>> > Hi Rolf,
>> >
>> >
>> > > this is not a junit test but a testng.
>> > > Transactions are handled in the testmethods themselves.
>> > > The error messages are not describing the real error.
>> > > The problem is that for some reason during the maven execution of the
>> > > test.
>> > > Testng and the embeddable ejb container  have some conflicts but  I
>> don't
>> > > see why
>> > > I  know this only by looking at the first  error  and  having
>> commented
>> > > out
>> > > a line in the second test (transaction.begin) than the second test
>> fails
>> > > by
>> > > stating that a session bean was not bound/found.
>> >
>> > Sorry, but I don't know TestNG, only JUnit... According to the
>> exception
>> I'd assume that there _is_ a problem with correctly opening and closing
>> the
>> transaction. If not, then at least with the initialization and/or
>> shutdown
>> of your test class / test method...
>> >
>> > Without knowing your source I'm wondering whether your failing test
>> class can run standalone or relies on others for doing its checks, for
>> example via static initializers, during init/shutdown etc. Have you
>> checked
>> that?
>> >
>> >
>> > Cheers
>> >
>> > Thorsten
>> >
>> > ---------------------------------------------------------------------
>> > 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/eclipse-and-maven-discrepancies-tp9733929p23197348.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: eclipse and maven discrepancies

Posted by Rolf Strijdhorst <ro...@gmail.com>.
Hi Wayne,

I have the tests working in eclipse, but not in maven.
And even then eclipse and maven need to work together because of some
problems in project building with eclipse.

As I've stated before for some reason my maven build fails with testng
because surefire and testng and the embedded container do not work well
together.

in the log I see that jboss finds the sessionbeans I've created. but when I
do a lookup the only thing I am able to retrieve is the user transaction.
every other object (entitymanagerfactory, sessionbeans) could not be
retrieved from jndi

any clue?
Rolf

On 4/2/07, Wayne Fay <wa...@gmail.com> wrote:
>
> Rolf, just wondering how far along you got in converting the
> CaveatEmptor JPA/EJB3/Hibernate app from Ant to Maven... I've been
> working on this myself some this morning.
>
> Were you ever 100% successful? Assuming you were, we should send your
> modified zip to Hibernate for inclusion on their download page.
>
> Also, why is the JBoss stuff only available on the Andromda repo? I'd
> hope JBoss would host it, or perhaps even Central.
>
> Wayne
>
> On 4/2/07, Thorsten Heit <th...@gmx.de> wrote:
> > Hi Rolf,
> >
> >
> > > this is not a junit test but a testng.
> > > Transactions are handled in the testmethods themselves.
> > > The error messages are not describing the real error.
> > > The problem is that for some reason during the maven execution of the
> > > test.
> > > Testng and the embeddable ejb container  have some conflicts but  I
> don't
> > > see why
> > > I  know this only by looking at the first  error  and  having
> commented
> > > out
> > > a line in the second test (transaction.begin) than the second test
> fails
> > > by
> > > stating that a session bean was not bound/found.
> >
> > Sorry, but I don't know TestNG, only JUnit... According to the exception
> I'd assume that there _is_ a problem with correctly opening and closing the
> transaction. If not, then at least with the initialization and/or shutdown
> of your test class / test method...
> >
> > Without knowing your source I'm wondering whether your failing test
> class can run standalone or relies on others for doing its checks, for
> example via static initializers, during init/shutdown etc. Have you checked
> that?
> >
> >
> > Cheers
> >
> > Thorsten
> >
> > ---------------------------------------------------------------------
> > 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: eclipse and maven discrepancies

Posted by Wayne Fay <wa...@gmail.com>.
Rolf, just wondering how far along you got in converting the
CaveatEmptor JPA/EJB3/Hibernate app from Ant to Maven... I've been
working on this myself some this morning.

Were you ever 100% successful? Assuming you were, we should send your
modified zip to Hibernate for inclusion on their download page.

Also, why is the JBoss stuff only available on the Andromda repo? I'd
hope JBoss would host it, or perhaps even Central.

Wayne

On 4/2/07, Thorsten Heit <th...@gmx.de> wrote:
> Hi Rolf,
>
>
> > this is not a junit test but a testng.
> > Transactions are handled in the testmethods themselves.
> > The error messages are not describing the real error.
> > The problem is that for some reason during the maven execution of the
> > test.
> > Testng and the embeddable ejb container  have some conflicts but  I don't
> > see why
> > I  know this only by looking at the first  error  and  having commented
> > out
> > a line in the second test (transaction.begin) than the second test fails
> > by
> > stating that a session bean was not bound/found.
>
> Sorry, but I don't know TestNG, only JUnit... According to the exception I'd assume that there _is_ a problem with correctly opening and closing the transaction. If not, then at least with the initialization and/or shutdown of your test class / test method...
>
> Without knowing your source I'm wondering whether your failing test class can run standalone or relies on others for doing its checks, for example via static initializers, during init/shutdown etc. Have you checked that?
>
>
> Cheers
>
> Thorsten
>
> ---------------------------------------------------------------------
> 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