cancel
Showing results for 
Search instead for 
Did you mean: 

Err using JMX api: NoClassDefFoundError while getting mbeanserverconnection

Former Member
0 Kudos

Hello All,

I am trying to connect to connect to a remote mbeanserver using the procedure outlined in http://help.sap.com/saphelp_nw04/helpdata/en/64/617cfb94845d468b0498b4b2c53d74/content.htm

When I execute my java program from the box where NetWeaver is installed, I am able to successfully establish connection and get an mbeanserverconnection object.

However, when I try to execute the same code from a different machine in my network, I get a noclassdeffounderror. I have included all the jars mentioned for external clients in http://help.sap.com/saphelp_nw04/helpdata/en/f6/c9bb997ca1d446a3a176d519ab59a8/content.htm in my classpath variable. Here is the exception stack trace:

java.lang.NoClassDefFoundError: com/sap/engine/services/security/server/AuthenticationContextImpl

at com.sap.engine.services.security.login.SecuritySession.expire(SecuritySession.java:236)

at com.sap.engine.services.security.login.SecuritySession.setExpirationPeriod(SecuritySession.java:316)

at com.sap.engine.services.security.login.TicketGenerator.getSecuritySession(TicketGenerator.java:127)

at com.sap.engine.services.security.login.SecurityContext.load(SecurityContext.java:234)

at com.sap.engine.services.rmi_p4.Message.loadContextObject(Message.java:343)

at com.sap.engine.services.rmi_p4.Message.parseMessage(Message.java:239)

at com.sap.engine.services.rmi_p4.Message.getByteArrayInputStream(Message.java:314)

at com.sap.engine.services.rmi_p4.Call.getResultStream(Call.java:183)

at com.sap.engine.services.security.remote.login.RemoteLoginContextHelper_Stub.login(RemoteLoginContextHelper_Stub.java:126)

at com.sap.engine.services.security.remote.login.RemoteLoginContext.login(RemoteLoginContext.java:140)

at com.sap.engine.services.jndi.implclient.LoginHelper.clientSideLogin(LoginHelper.java:79)

at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:403)

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 com.sap.engine.services.jmx.connector.p4.P4ConnectorClient.<init>(P4ConnectorClient.java:69)

at com.sap.engine.services.jmx.connector.p4.ConnectorFactory.getJmxConnector(ConnectorFactory.java:31)

at com.sap.jmx.remote.JmxConnectionFactory.getConnector(JmxConnectionFactory.java:191)

at com.sap.jmx.remote.JmxConnectionFactory.getMBeanServerConnection(JmxConnectionFactory.java:92)

at MySapWasTests.appServerConnect(MySapWasTests.java:252)

......

......

What am I doing wrong? Am I missing any jars in my classpath? Why is this not working when I'm trying to connect from an external machine (in the same network/domain) but works from the same machine where NetWeaver is installed? I even added the ip-hostname combination in the windows hosts file of the remote machine but I'm still getting the same exception. Please help. Thanks in advance!

-Arvind

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Ok. This was because of a time issue at the server and it had fallen behind. So, security session was not successfully established as the authenticationcontextimpl object was getting expired as soon as it was getting created. When I accessed the server from a client in the server box, the client and server are always in the same (faulty) time and this issue did not arise.