RMI ClassNotFoundException - java

I have problem with rmiregistry. I'm getting below error:
Cannot bind to URL [rmi://........]: javax.naming.NamingException [Root exception is java.rmi.UnexpectedException: undeclared checked exception; nested exception is:
java.lang.ClassNotFoundException: Could not find class (javax.management.remote.rmi.RMIServerImpl_Stub) at codebase ()]
I checked, class exist in the classpath.
I used java 1.6 on linux. I started rmiregistry 6667.
Has anyone met with this error?

class exist in the classpath.
In your JVM's classpath. It is also needed on the Registry's classpath, and the client's.

Related

NoClassDefFoundError error message in eclipse

I am running a program on eclipse and I keep getting this error:
Unable to initialize main class com.logic.AddProduct
Caused by: java.lang.NoClassDefFoundError: org/hibernate/Session
Any explainations?
Hibernate JAR (hibernate-core i suppose) or onr of its dependencies is probably not in your runtime classpath.

ASM ClassReader failed to parse class file

My spring application compiled with java 1.8 in local system where it's working fine without any issues, but when I deploy the application on the server where java-11 configured, giving an error message in server start-up
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem:
Failed to read candidate component class: URL
[jar:file:/app/apache-tomcat-9.0.46/webapps/planDeTravail/WEB-INF/lib/rna-1.20.jar!/com/DoRnaHistory.class];
nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file -
probably due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class];
nested exception is java.lang.IllegalArgumentException
Offending resource: class path resource [META-INF/spring/rna-spring-context.xml]; nested exception
is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably
due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class];
nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68
My spring application running in 3.2.16.RELEASE
Could anyone please help me to find the root cause and solution of the issue?
I changed my JRE version back to 8 when using <org.springframework.version>5.2.0.RELEASE</org.springframework.version>
In Intellij i also changed the app configuration to run with JRE 8.

SQLException stack trace

So I got sort of strange situation. I have Spring webapp and in it I have JNDI datasource that I have defined in tomcat's server.xml to connect to mysql database
I have mysql-connector-java 5.1.2 in my Maven pom.
Application works when I start it from localhost, but when I deploy it to remote tomcat it is not getting the call to the database.
This Exception occurs :
Couldnt execute sql CALL shareholders_company_list(?)
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Unable to create correct SQLException class instance, error class/codes may be incorrect. Reason:
** BEGIN NESTED EXCEPTION **
java.sql.SQLException
MESSAGE: Can't instantiate required class due to java.lang.ClassNotFoundException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
STACKTRACE:
java.sql.SQLException: Can't instantiate required class due to java.lang.ClassNotFoundException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException
Is there away to avoid this ClassNotFoundException, so that I can get full stack trace, since it seems that explicit error why this happens is in MySQLNonTransientConnectionException, and I can't seem to reach it.
import required version(if you don't have any preference go for latest) of mysql-connector-java-latestVersion.jar under tomcat\lib

ClassCastException b/w IBMorb and jacorb jars in WAS 8.5.5

I have an application which is using jacorb.jar (org.omg.orb.ORB.class). When i deploying my war file in WAS 8.5.5, I am getting classcast exceptions with ibmorb located at openJdk/jre/lib/ibmorb.jar file. Could anyone help me in using jacorb.jar and resolving errors.
Error:
[3/3/15 5:30:51:863 PST] 00000001 ActivityServi E WACT0001E: The method pre_init(ORBInitInfo) in class com.ibm.ws.activity.remote.cos.ActivityServiceClientInterceptor received an unexpected exception;
the exception stack trace follows: java.lang.ClassCastException: org.jacorb.orb.portableInterceptor.ORBInitInfoImpl incompatible with com.ibm.CORBA.iiop.ExtendedORBInitInfo
at com.ibm.ws.activity.remote.cos.ActivityServiceClientInterceptor.pre_init(ActivityServiceClientInterceptor.java:219)
at org.jacorb.orb.ORB.interceptorPreInit(Unknown Source)
at org.jacorb.orb.ORB.internalInit(Unknown Source)
at org.jacorb.orb.ORB.set_parameters(Unknown Source)
at org.omg.CORBA.ORB.init(ORB.java:371)
Caused by: java.lang.ClassCastException: org.jacorb.orb.ORB incompatible with com.ibm.CORBA.iiop.ORB
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:179)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:83)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:59)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:102)
IBM doesn't support third party ORB as it provides its own ORB. You can find the orb.properties with default properties in IBM JAVA jre folder. If you want to add anything related to ORB that need to inform JRE , we can add an entry in this property folder.
I have completely removed the JacORB from my code and used IBM ORB. They wont be any problem if you compile your code with JacORB and to use the same in IBM websphere as the package structure and method signature wont change. I have tested this practically.
Refer to this thread for more information in creating a corba name space and using it in code. If you follow those, you wont need to add jacorb jars in IBM websphere.
Corba NameService configuration in Websphere 8.5.5

Yahoo BOSS Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/ILoggerFactory

I am trying to run this Java example but I am receiving the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/ILoggerFactory.
you need to set the CLASSPATH variable in your system to include the current directory or the location of your class
NoClassDefFoundError
It can't find the class. Have you imported the required libraries and included it in your classpath?

Categories

Resources