java.lang.ClassNotFoundException: org.eclipse.osgi.framework.internal.core.BundleHost - eclipse

After moving to the osgi version org.eclipse.osgi_3.10.1.v20140909-1633.jar,the following exception is thrown
java.lang.ClassNotFoundException: org.eclipse.osgi.framework.internal.core.BundleHost
I use this class to check if a bundle is instance of BundleHost.

Related

Exception while building a war file via (maven install) for a spring boot project with mongodb

I am trying to build a spring-boot application with mongodb. I excluded the spring-boot-starter-data-mongodb dependency and using mongodb-driver 3.12.5.
My application.properties file contains only spring.data.mongodb.uri=connection _string.
With this above configuration I am unable to build a war file to deploy in server. It is giving the following error.
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongo' defined in class path resource [org/springframework/boot/autoconfigure/mongo/MongoAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.NoClassDefFoundError: com/mongodb/connection/DefaultClusterFactory
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.NoClassDefFoundError: com/mongodb/connection/DefaultClusterFactory
Caused by: java.lang.NoClassDefFoundError: com/mongodb/connection/DefaultClusterFactory
Caused by: java.lang.ClassNotFoundException: com.mongodb.connection.DefaultClusterFactory
please help, thanks.
This is issue was solved by replacing the mongodb-driver dependency with mongodb-java-driver dependency
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.6.3</version>
</dependency>
as for the situation i faced i did not add a dependency that i am using in the application. that was the mistake.

Solving Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream

I'm using Jetbrains IntelliJ IDEA with the Scala plugin and I'm trying to execute some code that uses Apache Spark. However whenever I try to run it, the code doesn't execute properly because of the exception
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
at org.apache.spark.SparkConf.loadFromSystemProperties(SparkConf.scala:76)
at org.apache.spark.SparkConf.<init>(SparkConf.scala:71)
at org.apache.spark.SparkConf.<init>(SparkConf.scala:58)
at KMeans$.main(kmeans.scala:71)
at KMeans.main(kmeans.scala)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FSDataInputStream
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more
Running spark-shell from terminal doesn't give me any problems, the warning unable to load native-hadoop library for your platform doesn't appear to me.
I've read some questions similar to mine, but in those cases they had problems with spark-shell or with cluster configuration.
I was using spark-core_2.12-2.4.3.jar without the dependencies. I solved the issue by adding spark-core library through Maven, which automatically added all the dependencies.

jpa project deployment to Jboss gives Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/ext/ExceptionMapper

I am deploying my JPA project to wildfly 8.2 server. its giving me exception
Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/ext/ExceptionMapper
Can someone put some light on it..
i have created Provider
#Provider
public class EJBExceptionMapper implements ExceptionMapper<Exception>
{
public Response toResponse(Exception exception) {
return Response.status(500).build();
}
}
But still the error is there.
I was using WildFly 8.2.0 with EclipseLink 2.5.2
That's why it was causing..
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.ext.ExceptionMapper from [Module "org.eclipse.persistence:main"
To solve this line
<module name="javax.ws.rs.api"/>
needs to be included in Wildfly installation modules/system/layers/base/org/eclipse/persistence/main/module.xml file..
This solved the problem for me..
https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide#JPAReferenceGuide-UsingEclipseLink
check this below link may be will helpful for you:
http://howtodoinjava.com/2013/06/03/exception-handling-in-jax-rs-resteasy-with-exceptionmapper/

Libraries of Tomcat 7.0 in conflict with httpcore-4.3.2.jar

I created dynamic web project in eclipse and want to add httpcore-4.3.2.jar lib. Every time I try to add it, Tomcat stops working. I have to use HttpClient and I can't use anything else.
How to resolve this problem?
this is the error message:
Grave: Exception starting Context with name [/FitsInterface]
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/FitsInterface]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3954)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
....
....
Caused by: java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
....
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpEntity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 22 more
I found a solution: you have to deploy the libraries you included in the project build path.
If you are using eclipse, then: Properties > Deployment Assembly > add libraries from build path

NoClassDefFoundError: org/codehaus/jdt/groovy/integration/LanguageSupport after launching Eclipse

I get these exceptions when opening Groovy files:
org.osgi.framework.BundleException: Exception in org.codehaus.groovy.eclipse.refactoring.Activator.start() of bundle org.codehaus.groovy.eclipse.refactoring.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
...
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jdt/groovy/integration/LanguageSupport
or
java.lang.NoClassDefFoundError: org/codehaus/groovy/eclipse/refactoring/formatter/GroovyIndentationService
at org.codehaus.groovy.eclipse.editor.GroovyAutoIndentStrategy.<init>(GroovyAutoIndentStrategy.java:50)
at org.codehaus.groovy.eclipse.editor.GroovyConfiguration.getAutoEditStrategies(GroovyConfiguration.java:181)
...
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.codehaus.groovy.eclipse.refactoring (47).
...
Caused by: org.osgi.framework.BundleException: Exception in org.codehaus.groovy.eclipse.refactoring.Activator.start() of bundle org.codehaus.groovy.eclipse.refactoring.
...
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jdt/groovy/integration/LanguageSupport
Caused by: java.lang.ClassNotFoundException: org.codehaus.jdt.groovy.integration.LanguageSupport
Groovy needs a special version of the org.eclipse.jdt.core plugin.
For 3.7, the original plugin has the version 3.7.3.v2012... but you need 3.7.3.xx-2013*
If you start Eclipse via an "Eclipse Application" launch config, open it in the "Run Configurations" dialog. In the "Plug-ins" tab, search for "jdt.core" and activate the correct plugin.
If it's not there, remove and install the Groovy feature again.