You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Snehal Maniar (JIRA)" <ji...@codehaus.org> on 2006/04/28 01:00:19 UTC

[jira] Created: (MNG-2249) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
------------------------------------------------------------------------------------

         Key: MNG-2249
         URL: http://jira.codehaus.org/browse/MNG-2249
     Project: Maven 2
        Type: Bug

  Components: General  
    Versions: 2.0.4    
 Environment: JBoss 4.0.1
JDK 1.5

    Reporter: Snehal Maniar
    Priority: Critical


For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;

import junit.framework.TestCase;

public class TestJBossJNDI extends TestCase {

	public void testBindingCtx() throws Exception {
		Properties p = new Properties();
		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
				"org.jnp.interfaces.NamingContextFactory");
		p.setProperty(Context.URL_PKG_PREFIXES,
				"org.jboss.naming:org.jnp.interfaces");
		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
		try {
			InitialContext ctx = new InitialContext(p);
			Object o = ctx.lookup("ConnectionFactory");
			System.out.println("Found Object = " + o.getClass().getName());
		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}
}

I get following exception/error....

[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
[INFO]    task-segment: [test]
[INFO] ----------------------------------------------------------------------------
[INFO] resources:resources
[INFO] Using default encoding to copy filtered resources.
[INFO] compiler:compile
[INFO] Nothing to compile - all classes are up to date
[INFO] resources:testResources
[INFO] Using default encoding to copy filtered resources.
[INFO] compiler:testCompile
Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
[INFO] surefire:test
[INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.net.MalformedURLException: no protocol: and]
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
	at javax.naming.InitialContext.lookup(InitialContext.java:351)
	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.net.MalformedURLException: no protocol: and
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
	at sun.rmi.transport.Transport$1.run(Transport.java:153)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
	at java.lang.Thread.run(Thread.java:595)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
	... 41 more
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.net.MalformedURLException: no protocol: and
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
	at sun.rmi.transport.Transport$1.run(Transport.java:153)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.MalformedURLException: no protocol: and
	at java.net.URL.<init>(URL.java:567)
	at java.net.URL.<init>(URL.java:464)
	at java.net.URL.<init>(URL.java:413)
	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
	at javax.naming.CompoundName.readObject(CompoundName.java:554)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
[surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 

	at java.lang.reflect.Method.invoke(Method.java:585)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
Results :
[surefire] Tests run: 1, Failures: 1, Errors: 0

[ERROR] mojo-execute : surefire:test
Diagnosis: There are some test failure.
FATAL ERROR: Error executing Maven for a project
[ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
Diagnosis: There are some test failure.
FATAL ERROR: Error executing Maven for a project
org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
	... 8 more

	... 6 more

If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).

pom.xml is listed below:
<?xml version="1.0" encoding="UTF-8"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>middleware</groupId>
  <artifactId>TestMVN</artifactId>
  <version>0.0.1</version>
  <description></description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Maven Repository Switchboard</name>
      <url>http://www.ibiblio.org/maven2</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Maven Repository Switchboard</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
    </dependency>
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jbossall-client</artifactId>
      <version>4.0.1</version>
    </dependency>
  </dependencies>
</project>

Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MNG-2249) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Carlos Sanchez (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2249?page=all ]
     
Carlos Sanchez closed MNG-2249:
-------------------------------

     Assign To: Carlos Sanchez
    Resolution: Duplicate

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MNG-2249
>          URL: http://jira.codehaus.org/browse/MNG-2249
>      Project: Maven 2
>         Type: Bug

>   Components: General
>     Versions: 2.0.4
>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Assignee: Carlos Sanchez
>     Priority: Critical

>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MNG-2249) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Snehal Maniar (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2249?page=comments#action_65387 ] 

Snehal Maniar commented on MNG-2249:
------------------------------------

From: Mark Holster [mailto:m.holster@anva.nl] 
Sent: Friday, May 12, 2006 4:51 AM
To: Maniar, Snehal
Subject: JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Hello Snehal,
 
I've noticed your bug report on jira when i was looking for a solutiion for the same problem I had with Jboss 4.0.4. First of all the issue isn't a duplicate of MSUREFIRE-93. That issue reports a socket timeout. Ow b.t.w. i'm not to familiar to jira, so I decided to mail you. 
 
I couldn't found a solution, but I did found the cause. The stacktrace complains about a protocol called "and" ( java.net.MalformedURLException: no protocol: and). This "and" protocol obviously comes from "Documents and settings". The only thing I used from documents and settings is the maven repository.
So I've tried to run the tests with a repository in a path without spaces: "mvn "-Dmaven.repo.local=file:///d:/temp/repo" clean test" and bingo, everything work just fine.
 
Could you confirm this "solution" and post it on Jira?
 
Regards,
Mark


> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MNG-2249
>          URL: http://jira.codehaus.org/browse/MNG-2249
>      Project: Maven 2
>         Type: Bug

>   Components: General
>     Versions: 2.0.4
>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Assignee: Carlos Sanchez
>     Priority: Critical

>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Michael Rimov (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=comments#action_67655 ] 

Michael Rimov commented on MSUREFIRE-110:
-----------------------------------------

NanoContainer Remoting test suites under Maven 2 also fail with the same error:  standard Win JDK 1.5, standard Sun RMI.  ForkMode = perTest

org.nanocontainer.remoting.rmi.NanoNamingTestCase

Caused by: java.net.MalformedURLException: no protocol: and
	at java.net.URL.<init>(Unknown Source)
	at java.net.URL.<init>(Unknown Source)
	at java.net.URL.<init>(Unknown Source)
	at sun.rmi.server.LoaderHandler.pathToURLs(Unknown Source)
	at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
	at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
	at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)


Since MSUREFIRE-83 was closed with cannot reproduce,  perhaps that project could be a place to compare notes.  The test cases work fine in-IDE and in Maven-1.

HTH!
-Mike (R)


> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-110
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Priority: Critical
>  Attachments: booter-url-patch.txt
>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Kevin McKee (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=comments#action_70826 ] 
            
Kevin McKee commented on MSUREFIRE-110:
---------------------------------------

Getting same error. Has anyone come up with a way around this until a patch comes out?

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>                 Key: MSUREFIRE-110
>                 URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>             Project: Maven 2.x Surefire Plugin
>          Issue Type: Bug
>         Environment: JBoss 4.0.1
> JDK 1.5
>            Reporter: Snehal Maniar
>            Priority: Critical
>         Attachments: booter-url-patch.txt
>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=all ]

Brett Porter closed MSUREFIRE-110.
----------------------------------

      Assignee: Brett Porter
    Resolution: Duplicate

dupe o MSUREFIRE-148

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>                 Key: MSUREFIRE-110
>                 URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>             Project: Maven 2.x Surefire Plugin
>          Issue Type: Bug
>         Environment: JBoss 4.0.1
> JDK 1.5
>            Reporter: Snehal Maniar
>         Assigned To: Brett Porter
>            Priority: Critical
>         Attachments: booter-url-patch.txt
>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Moved: (SUREFIRE-211) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter moved MSUREFIRE-110 to SUREFIRE-211:
-------------------------------------------------

        Key: SUREFIRE-211  (was: MSUREFIRE-110)
    Project: Maven Surefire  (was: Maven 2.x Surefire Plugin)

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-211
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-211
>             Project: Maven Surefire
>          Issue Type: Bug
>         Environment: JBoss 4.0.1
> JDK 1.5
>            Reporter: Snehal Maniar
>         Assigned To: Brett Porter
>            Priority: Critical
>         Attachments: booter-url-patch.txt
>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Andreas Rudolf (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=comments#action_65510 ] 

Andreas Rudolf commented on MSUREFIRE-110:
------------------------------------------

Hi, I test it with surefire 2.2 and get the same error. It works with -Dmaven.repo.local=file:///d:/<path without spaces>.

So the bug is still present in 2.2

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-110
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Priority: Critical

>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Mark Holster (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=comments#action_72961 ] 
            
Mark Holster commented on MSUREFIRE-110:
----------------------------------------

I noticed MSUREFIRE-148 duplicates this issue. That issue is solved so I think this one can be closed too. Only difference is that in MSUREFIRE-148 is patched for jdk 1.3, but the documentation (http://maven.apache.org/download.html#Requirements) says maven needs jdk 1.4.

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>                 Key: MSUREFIRE-110
>                 URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>             Project: Maven 2.x Surefire Plugin
>          Issue Type: Bug
>         Environment: JBoss 4.0.1
> JDK 1.5
>            Reporter: Snehal Maniar
>            Priority: Critical
>         Attachments: booter-url-patch.txt
>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=comments#action_65420 ] 

Brett Porter commented on MSUREFIRE-110:
----------------------------------------

does this work unmodified with surefire 2.2?

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-110
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Priority: Critical

>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (MSUREFIRE-110) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Mark Holster (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSUREFIRE-110?page=all ]

Mark Holster updated MSUREFIRE-110:
-----------------------------------

    Attachment: booter-url-patch.txt

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MSUREFIRE-110
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-110
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Priority: Critical
>  Attachments: booter-url-patch.txt
>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (MNG-2249) JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI

Posted by "Carlos Sanchez (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2249?page=all ]
     
Carlos Sanchez reopened MNG-2249:
---------------------------------

     Assign To:     (was: Carlos Sanchez)

Reopened per user comment

> JUnit test case fails with Maven 2 when looking up an Object in the JBoss using JNDI
> ------------------------------------------------------------------------------------
>
>          Key: MNG-2249
>          URL: http://jira.codehaus.org/browse/MNG-2249
>      Project: Maven 2
>         Type: Bug

>   Components: General
>     Versions: 2.0.4
>  Environment: JBoss 4.0.1
> JDK 1.5
>     Reporter: Snehal Maniar
>     Priority: Critical

>
>
> For a sample JUnit test case trying to lookup an Object in the JBoss registry using JNDI as shown below
> import java.util.Properties;
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import junit.framework.TestCase;
> public class TestJBossJNDI extends TestCase {
> 	public void testBindingCtx() throws Exception {
> 		Properties p = new Properties();
> 		p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> 				"org.jnp.interfaces.NamingContextFactory");
> 		p.setProperty(Context.URL_PKG_PREFIXES,
> 				"org.jboss.naming:org.jnp.interfaces");
> 		p.setProperty(Context.PROVIDER_URL, "jnp://sdv01:1399");
> 		try {
> 			InitialContext ctx = new InitialContext(p);
> 			Object o = ctx.lookup("ConnectionFactory");
> 			System.out.println("Found Object = " + o.getClass().getName());
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 			fail();
> 		}
> 	}
> }
> I get following exception/error....
> [INFO] ----------------------------------------------------------------------------
> [INFO] Building Unnamed - middleware:TestMVN:jar:0.0.1
> [INFO]    task-segment: [test]
> [INFO] ----------------------------------------------------------------------------
> [INFO] resources:resources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:compile
> [INFO] Nothing to compile - all classes are up to date
> [INFO] resources:testResources
> [INFO] Using default encoding to copy filtered resources.
> [INFO] compiler:testCompile
> Compiling 1 source file to C:\dev_corner\eclipse\workspaceII\TestMVN\target\test-classes
> [INFO] surefire:test
> [INFO] Setting reports dir: C:\dev_corner\eclipse\workspaceII\TestMVN\target/surefire-reports
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and]
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
> 	at TestJBossJNDI.testBindingCtx(TestJBossJNDI.java:21)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:154)
> 	at junit.framework.TestCase.runBare(TestCase.java:127)
> 	at junit.framework.TestResult$1.protect(TestResult.java:106)
> 	at junit.framework.TestResult.runProtected(TestResult.java:124)
> 	at junit.framework.TestResult.run(TestResult.java:109)
> 	at junit.framework.TestCase.run(TestCase.java:118)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:208)
> 	at junit.framework.TestSuite.run(TestSuite.java:203)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:230)
> 	at org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:204)
> 	at org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:217)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:165)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:89)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.maven.surefire.SurefireBooter.runTestsInProcess(SurefireBooter.java:246)
> 	at org.apache.maven.surefire.SurefireBooter.run(SurefireBooter.java:195)
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:366)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
> 	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> 	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
> 	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
> 	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
> 	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
> 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
> 	... 41 more
> Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
> 	java.net.MalformedURLException: no protocol: and
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
> 	at sun.rmi.transport.Transport$1.run(Transport.java:153)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
> 	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
> 	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.MalformedURLException: no protocol: and
> 	at java.net.URL.<init>(URL.java:567)
> 	at java.net.URL.<init>(URL.java:464)
> 	at java.net.URL.<init>(URL.java:413)
> 	at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
> 	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
> 	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
> 	at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:74)
> 	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
> 	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
> 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at javax.naming.CompoundName.readObject(CompoundName.java:554)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[surefire] Running com.sabre.middleware.TestJBossJNDI
> [surefire] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 24.788 sec <<<<<<<< FAILURE !! 
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
> 	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
> 	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
> Results :
> [surefire] Tests run: 1, Failures: 1, Errors: 0
> [ERROR] mojo-execute : surefire:test
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> [ERROR] project-execute : middleware:TestMVN:jar:0.0.1 (  task-segment: [test] )
> Diagnosis: There are some test failure.
> FATAL ERROR: Error executing Maven for a project
> org.apache.maven.lifecycle.LifecycleExecutionException: There are some test failure.
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:556)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:472)
> 	at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:413)
> 	at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
> Caused by: org.apache.maven.plugin.MojoExecutionException: There are some test failure.
> 	at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java:384)
> 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
> 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
> 	... 8 more
> 	... 6 more
> If the test case is ran outside of Maven 2 (mvn test), it runs just fine (no errors/exceptions).
> pom.xml is listed below:
> <?xml version="1.0" encoding="UTF-8"?><project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>middleware</groupId>
>   <artifactId>TestMVN</artifactId>
>   <version>0.0.1</version>
>   <description></description>
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <source>1.5</source>
>           <target>1.5</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <repositories>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://www.ibiblio.org/maven2</url>
>     </repository>
>     <repository>
>       <snapshots>
>         <enabled>false</enabled>
>       </snapshots>
>       <id>central</id>
>       <name>Maven Repository Switchboard</name>
>       <url>http://repo1.maven.org/maven2</url>
>     </repository>
>   </repositories>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>     </dependency>
>     <dependency>
>       <groupId>org.jboss</groupId>
>       <artifactId>jbossall-client</artifactId>
>       <version>4.0.1</version>
>     </dependency>
>   </dependencies>
> </project>
> Any prompt response to this issue is greatly appreciated...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira