geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xypher <r.rosenb...@sdbn.de>
Subject Re: Geronimo 2 EJB3 Remote Access Example
Date Thu, 24 Jan 2008 12:48:43 GMT

Hi, 

thanks a lot, now it works. But not completely ....

When I'm trying the following code:

public class TestClient {

	public static void main(String[] args) {

		Context context;
		Properties properties = new Properties();
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
        properties.setProperty(Context.PROVIDER_URL,
"ejbd://localhost:4201");
		properties.put("java.naming.security.principal", "system");
		properties.put("java.naming.security.credentials", "manager");

		try {
			context = new InitialContext(properties);
			
			IProjectDSP projectDSP = (IProjectDSP)
context.lookup("ProjectDSPRemote");
//			Project p1 = new Project();
//			p1.setName("Test");
//			projectDSP.createProject(p1);
		} catch (NamingException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}
}

I'm getting this exception:

javax.naming.AuthenticationException: This principle is not authorized.
	at org.apache.openejb.client.JNDIContext.authenticate(JNDIContext.java:150)
	at
org.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:122)
	at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
	at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
	at javax.naming.InitialContext.init(Unknown Source)
	at javax.naming.InitialContext.<init>(Unknown Source)
	at TestClient.main(TestClient.java:24)
Exception in thread "main" java.lang.RuntimeException:
javax.naming.AuthenticationException: This principle is not authorized.
	at TestClient.main(TestClient.java:32)
Caused by: javax.naming.AuthenticationException: This principle is not
authorized.
	at org.apache.openejb.client.JNDIContext.authenticate(JNDIContext.java:150)
	at
org.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:122)
	at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
	at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
	at javax.naming.InitialContext.init(Unknown Source)
	at javax.naming.InitialContext.<init>(Unknown Source)
	at TestClient.main(TestClient.java:24)

When I don't use a principal, I'm getting this error:

Exception in thread "main" java.lang.RuntimeException:
javax.naming.NamingException: Cannot lookup '/ProjectDSPRemote'. [Root
exception is java.rmi.RemoteException: Cannot read the response from the
server (OEJP/2.0) : org.apache.openejb.client.EJBMetaDataImpl; local class
incompatible: stream classdesc serialVersionUID = 2128092884552388429, local
class serialVersionUID = -7734383756981201981; nested exception is: 
	java.io.InvalidClassException: org.apache.openejb.client.EJBMetaDataImpl;
local class incompatible: stream classdesc serialVersionUID =
2128092884552388429, local class serialVersionUID = -7734383756981201981]
	at TestClient.main(TestClient.java:32)
Caused by: javax.naming.NamingException: Cannot lookup '/ProjectDSPRemote'.
[Root exception is java.rmi.RemoteException: Cannot read the response from
the server (OEJP/2.0) : org.apache.openejb.client.EJBMetaDataImpl; local
class incompatible: stream classdesc serialVersionUID = 2128092884552388429,
local class serialVersionUID = -7734383756981201981; nested exception is: 
	java.io.InvalidClassException: org.apache.openejb.client.EJBMetaDataImpl;
local class incompatible: stream classdesc serialVersionUID =
2128092884552388429, local class serialVersionUID = -7734383756981201981]
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:203)
	at javax.naming.InitialContext.lookup(Unknown Source)
	at TestClient.main(TestClient.java:26)
Caused by: java.rmi.RemoteException: Cannot read the response from the
server (OEJP/2.0) : org.apache.openejb.client.EJBMetaDataImpl; local class
incompatible: stream classdesc serialVersionUID = 2128092884552388429, local
class serialVersionUID = -7734383756981201981; nested exception is: 
	java.io.InvalidClassException: org.apache.openejb.client.EJBMetaDataImpl;
local class incompatible: stream classdesc serialVersionUID =
2128092884552388429, local class serialVersionUID = -7734383756981201981
	at org.apache.openejb.client.Client.processRequest(Client.java:197)
	at org.apache.openejb.client.Client.request(Client.java:43)
	at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:74)
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:197)
	... 2 more
Caused by: java.io.InvalidClassException:
org.apache.openejb.client.EJBMetaDataImpl; local class incompatible: stream
classdesc serialVersionUID = 2128092884552388429, local class
serialVersionUID = -7734383756981201981
	at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
	at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at
org.apache.openejb.client.JNDIResponse.readExternal(JNDIResponse.java:64)
	at org.apache.openejb.client.Client.processRequest(Client.java:192)
	... 5 more

Normaly the system user should work. 

Any idea?

Thanks

-- 
View this message in context: http://www.nabble.com/Geronimo-2-EJB3-Remote-Access-Example-tp15053984s134p15063643.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message