You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Todd Nine <to...@gmail.com> on 2006/04/12 19:16:11 UTC

Unable to run unit tests with RMI connections

I'm unable to run any unit test that will connect to a remove JVM from my
Maven 2.0.2 unit tests.  I always receive either a
javax.naming.CommunicationException for Remote EJB's or
java.rmi.ConnectException for RMI connections.  The unit tests work in
Eclipse as well as from the command line, has anyone else experienced this
behavior?  If so how did you resolve it?  This seems like a security policy
problem with the VM that is used for unit testing, but I'm unsure how to fix
it.  Any advice would be greatly appreciated.

Thanks,
Todd

Re: Unable to run unit tests with RMI connections

Posted by Todd Nine <to...@gmail.com>.
No, no spaces, I eliminated them the first time.  They're a bad idea anyway
:).

Todd

On 4/27/06, Wayne Fay <wa...@gmail.com> wrote:
>
> Are you running on Windows? Many people have reported issues with RMI
> on Windows, but they are not Maven bugs, simply JVM/JDK issues.
>
> You should take a look at this thread from April 25:
> [M2] Problem running tests on Windows (white-space in repository?)
>
> And here's some text from that thread, quoting from Thorstein Heit:
>
> <quote>
> A couple of weeks ago there was a discussion that RMI tests fail if
> there are whitespace characters in the path name. As far as I remember
> this is because of some quite old bugs still contained even in the
> latest JDK; see also
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532
>
> Does your code reside in such a directory? If yes, could you move it to
> a different location that doesn't contain any whitespace in the paths
> and check again?
> </quote>
>
> Not sure if this helps, but search the Maven User email archive for
> "RMI" and you'll see a bunch of hits, and the general advice has been
> to move repositories and project files around until you have no spaces
> in any directory names.
>
> Wayne
>
> On 4/27/06, Todd Nine <to...@gmail.com> wrote:
> > Hi all, hopefully this thread is not dead.  I think the problem may be
> with
> > the classworlds code.  We recently tried to deploy the client with the
> > uberjar, and we are experiencing the same problem.  If I write a shell
> > script to add all the jars to the classpath from the extracted Uber jar,
> the
> > client works.  Does anyone have any idea why this would fail?
> >
> > Thanks,
> > Todd
> >
> > On 4/12/06, Wayne Fay <wa...@gmail.com> wrote:
> > >
> > > This has been discussed in the last month or two on the User list. Not
> > > sure if there was a solution. But search the Archives to find past
> > > email threads.
> > >
> > > Wayne
> > >
> > > On 4/12/06, Todd Nine <to...@gmail.com> wrote:
> > > > I'm unable to run any unit test that will connect to a remove JVM
> from
> > > my
> > > > Maven 2.0.2 unit tests.  I always receive either a
> > > > javax.naming.CommunicationException for Remote EJB's or
> > > > java.rmi.ConnectException for RMI connections.  The unit tests work
> in
> > > > Eclipse as well as from the command line, has anyone else
> experienced
> > > this
> > > > behavior?  If so how did you resolve it?  This seems like a security
> > > policy
> > > > problem with the VM that is used for unit testing, but I'm unsure
> how to
> > > fix
> > > > it.  Any advice would be greatly appreciated.
> > > >
> > > > Thanks,
> > > > Todd
> > > >
> > > >
> > >
> >
> >
>

Re: Unable to run unit tests with RMI connections

Posted by Wayne Fay <wa...@gmail.com>.
Are you running on Windows? Many people have reported issues with RMI
on Windows, but they are not Maven bugs, simply JVM/JDK issues.

You should take a look at this thread from April 25:
[M2] Problem running tests on Windows (white-space in repository?)

And here's some text from that thread, quoting from Thorstein Heit:

<quote>
A couple of weeks ago there was a discussion that RMI tests fail if
there are whitespace characters in the path name. As far as I remember
this is because of some quite old bugs still contained even in the
latest JDK; see also
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532

Does your code reside in such a directory? If yes, could you move it to
a different location that doesn't contain any whitespace in the paths
and check again?
</quote>

Not sure if this helps, but search the Maven User email archive for
"RMI" and you'll see a bunch of hits, and the general advice has been
to move repositories and project files around until you have no spaces
in any directory names.

Wayne

On 4/27/06, Todd Nine <to...@gmail.com> wrote:
> Hi all, hopefully this thread is not dead.  I think the problem may be with
> the classworlds code.  We recently tried to deploy the client with the
> uberjar, and we are experiencing the same problem.  If I write a shell
> script to add all the jars to the classpath from the extracted Uber jar, the
> client works.  Does anyone have any idea why this would fail?
>
> Thanks,
> Todd
>
> On 4/12/06, Wayne Fay <wa...@gmail.com> wrote:
> >
> > This has been discussed in the last month or two on the User list. Not
> > sure if there was a solution. But search the Archives to find past
> > email threads.
> >
> > Wayne
> >
> > On 4/12/06, Todd Nine <to...@gmail.com> wrote:
> > > I'm unable to run any unit test that will connect to a remove JVM from
> > my
> > > Maven 2.0.2 unit tests.  I always receive either a
> > > javax.naming.CommunicationException for Remote EJB's or
> > > java.rmi.ConnectException for RMI connections.  The unit tests work in
> > > Eclipse as well as from the command line, has anyone else experienced
> > this
> > > behavior?  If so how did you resolve it?  This seems like a security
> > policy
> > > problem with the VM that is used for unit testing, but I'm unsure how to
> > fix
> > > it.  Any advice would be greatly appreciated.
> > >
> > > Thanks,
> > > Todd
> > >
> > >
> >
>
>

Re: Unable to run unit tests with RMI connections

Posted by Todd Nine <to...@gmail.com>.
Hi all, hopefully this thread is not dead.  I think the problem may be with
the classworlds code.  We recently tried to deploy the client with the
uberjar, and we are experiencing the same problem.  If I write a shell
script to add all the jars to the classpath from the extracted Uber jar, the
client works.  Does anyone have any idea why this would fail?

Thanks,
Todd

On 4/12/06, Wayne Fay <wa...@gmail.com> wrote:
>
> This has been discussed in the last month or two on the User list. Not
> sure if there was a solution. But search the Archives to find past
> email threads.
>
> Wayne
>
> On 4/12/06, Todd Nine <to...@gmail.com> wrote:
> > I'm unable to run any unit test that will connect to a remove JVM from
> my
> > Maven 2.0.2 unit tests.  I always receive either a
> > javax.naming.CommunicationException for Remote EJB's or
> > java.rmi.ConnectException for RMI connections.  The unit tests work in
> > Eclipse as well as from the command line, has anyone else experienced
> this
> > behavior?  If so how did you resolve it?  This seems like a security
> policy
> > problem with the VM that is used for unit testing, but I'm unsure how to
> fix
> > it.  Any advice would be greatly appreciated.
> >
> > Thanks,
> > Todd
> >
> >
>

Re: Unable to run unit tests with RMI connections

Posted by Wayne Fay <wa...@gmail.com>.
This has been discussed in the last month or two on the User list. Not
sure if there was a solution. But search the Archives to find past
email threads.

Wayne

On 4/12/06, Todd Nine <to...@gmail.com> wrote:
> I'm unable to run any unit test that will connect to a remove JVM from my
> Maven 2.0.2 unit tests.  I always receive either a
> javax.naming.CommunicationException for Remote EJB's or
> java.rmi.ConnectException for RMI connections.  The unit tests work in
> Eclipse as well as from the command line, has anyone else experienced this
> behavior?  If so how did you resolve it?  This seems like a security policy
> problem with the VM that is used for unit testing, but I'm unsure how to fix
> it.  Any advice would be greatly appreciated.
>
> Thanks,
> Todd
>
>

Re: Unable to run unit tests with RMI connections

Posted by Todd Nine <to...@gmail.com>.
That has fixed my issue!  Thank you all for the help, it is very
appreciated.  If you read the last comment on this bug

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532

You will see that this bug affects the RMI Classloader, so this bug
obviously affects any remote EJB connectivity as well as POJO RMI
Invocations.

Thanks,
Todd

On 4/27/06, William Simons <wi...@childrens.harvard.edu> wrote:
>
> I had the same problem and it did not work under Cygwin.  Modifying the
> location of my repository to not include whitespace did fix it though.
>
>
>
> On 4/27/06 12:54 PM, "Wayne Fay" <wa...@gmail.com> wrote:
>
> > You can also try running Maven under Cygwin if you are on Windows.
> I've done
> > it and it runs fine, but never run into this RMI issue, so
> not sure if it
> > would help you.
>
> Wayne
>
> On 4/27/06, Tom Huybrechts <to...@gmail.com>
> > wrote:
> > Try moving your maven repository to a location without spaces (not
> >
> > below 'Documents and Settings'). There problem is that file URLs are
> > not
> > correctly encoded (space should become %20). This is a Java bug
> > that will
> > not be solved, see
> >
> > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532
> >
> > Tom
> >
> >
> >
> > On
> > 4/12/06, Todd Nine <to...@gmail.com> wrote:
> > > I'm unable to run any unit
> > test that will connect to a remove JVM from my
> > > Maven 2.0.2 unit tests.  I
> > always receive either a
> > > javax.naming.CommunicationException for Remote
> > EJB's or
> > > java.rmi.ConnectException for RMI connections.  The unit tests
> > work in
> > > Eclipse as well as from the command line, has anyone else
> > experienced this
> > > behavior?  If so how did you resolve it?  This seems like
> > a security policy
> > > problem with the VM that is used for unit testing, but
> > I'm unsure how to fix
> > > it.  Any advice would be greatly appreciated.
> > >
> >
> > > Thanks,
> > > Todd
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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: Unable to run unit tests with RMI connections

Posted by William Simons <wi...@childrens.harvard.edu>.
I had the same problem and it did not work under Cygwin.  Modifying the
location of my repository to not include whitespace did fix it though.
 


On 4/27/06 12:54 PM, "Wayne Fay" <wa...@gmail.com> wrote:

> You can also try running Maven under Cygwin if you are on Windows.
I've done
> it and it runs fine, but never run into this RMI issue, so
not sure if it
> would help you.

Wayne

On 4/27/06, Tom Huybrechts <to...@gmail.com>
> wrote:
> Try moving your maven repository to a location without spaces (not
>
> below 'Documents and Settings'). There problem is that file URLs are
> not
> correctly encoded (space should become %20). This is a Java bug
> that will
> not be solved, see
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532
>
> Tom
>
>
>
> On
> 4/12/06, Todd Nine <to...@gmail.com> wrote:
> > I'm unable to run any unit
> test that will connect to a remove JVM from my
> > Maven 2.0.2 unit tests.  I
> always receive either a
> > javax.naming.CommunicationException for Remote
> EJB's or
> > java.rmi.ConnectException for RMI connections.  The unit tests
> work in
> > Eclipse as well as from the command line, has anyone else
> experienced this
> > behavior?  If so how did you resolve it?  This seems like
> a security policy
> > problem with the VM that is used for unit testing, but
> I'm unsure how to fix
> > it.  Any advice would be greatly appreciated.
> >
>
> > Thanks,
> > Todd
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: Unable to run unit tests with RMI connections

Posted by Wayne Fay <wa...@gmail.com>.
You can also try running Maven under Cygwin if you are on Windows.
I've done it and it runs fine, but never run into this RMI issue, so
not sure if it would help you.

Wayne

On 4/27/06, Tom Huybrechts <to...@gmail.com> wrote:
> Try moving your maven repository to a location without spaces (not
> below 'Documents and Settings'). There problem is that file URLs are
> not correctly encoded (space should become %20). This is a Java bug
> that will not be solved, see
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532
>
> Tom
>
>
>
> On 4/12/06, Todd Nine <to...@gmail.com> wrote:
> > I'm unable to run any unit test that will connect to a remove JVM from my
> > Maven 2.0.2 unit tests.  I always receive either a
> > javax.naming.CommunicationException for Remote EJB's or
> > java.rmi.ConnectException for RMI connections.  The unit tests work in
> > Eclipse as well as from the command line, has anyone else experienced this
> > behavior?  If so how did you resolve it?  This seems like a security policy
> > problem with the VM that is used for unit testing, but I'm unsure how to fix
> > it.  Any advice would be greatly appreciated.
> >
> > Thanks,
> > Todd
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Unable to run unit tests with RMI connections

Posted by Tom Huybrechts <to...@gmail.com>.
Try moving your maven repository to a location without spaces (not
below 'Documents and Settings'). There problem is that file URLs are
not correctly encoded (space should become %20). This is a Java bug
that will not be solved, see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4273532

Tom



On 4/12/06, Todd Nine <to...@gmail.com> wrote:
> I'm unable to run any unit test that will connect to a remove JVM from my
> Maven 2.0.2 unit tests.  I always receive either a
> javax.naming.CommunicationException for Remote EJB's or
> java.rmi.ConnectException for RMI connections.  The unit tests work in
> Eclipse as well as from the command line, has anyone else experienced this
> behavior?  If so how did you resolve it?  This seems like a security policy
> problem with the VM that is used for unit testing, but I'm unsure how to fix
> it.  Any advice would be greatly appreciated.
>
> Thanks,
> Todd
>
>

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