I'm getting this error continuously...Eclips IDE with appach tomcat
root cause
java.lang.ClassNotFoundException: org.hibernate.HibernateException
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
com.rmi.servlet.ProvinceServlet.doPost(ProvinceServlet.java:59)
javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
You need to add Hibernate dependency to your project.
Basically, you need to add one of these jars:
http://www.jarfinder.com/index.php/java/info/org.hibernate.HibernateException
Here is how to do it from Eclipse:
http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)
Related
I am using Eclipse and I have configured all the jars required for Spring Framework, it don't show any compilation error. But, when I run my main function(Test Class) it populates me this error. Am I missing something here? Please help me, could not find the actual solution to solve this problem.
Feb 27, 2017 1:15:20 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
at org.springframework.context.support.AbstractApplicationContext.prepareBeanFactory(AbstractApplicationContext.java:481)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:398)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.javatpoint.Test.main(Test.java:14)
Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more
Some dependencies are not required at compile time but just at runtime.
The missing class is contained in the spring-expression jar. You can download it and add it to Eclipse too.
this issue drives me crazy
recently i configured hibernate to work with infinispan 8.1
and just worked fine in debug mode with eclipse
the problem when tried to deploy my application war on apache tomcat6
i get this exception
Caused by: org.hibernate.cache.CacheException: Unable to start region factory
at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:415)
at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:49)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:46)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)
... 86 more
Caused by: org.infinispan.commons.CacheConfigurationException: Unable to instantiate class org.infinispan.remoting.transport.jgroups.JGroupsTransport
at org.infinispan.commons.util.Util.loadClass(Util.java:103)
at org.infinispan.commons.util.Util.getInstance(Util.java:258)
at org.infinispan.configuration.global.TransportConfigurationBuilder.defaultTransport(TransportConfigurationBuilder.java:207)
at org.infinispan.configuration.parsing.Parser72.parseJGroups(Parser72.java:405)
at org.infinispan.configuration.parsing.Parser72.readElement(Parser72.java:93)
at org.infinispan.configuration.parsing.ParserRegistry.parseElement(ParserRegistry.java:151)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:131)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:118)
at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:105)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.parseWithOverridenClassLoader(InfinispanRegionFactory.java:518)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.access$000(InfinispanRegionFactory.java:81)
at org.hibernate.cache.infinispan.InfinispanRegionFactory$1.doWork(InfinispanRegionFactory.java:484)
at org.hibernate.cache.infinispan.InfinispanRegionFactory$1.doWork(InfinispanRegionFactory.java:470)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.workWithClassLoader(ClassLoaderServiceImpl.java:342)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.createCacheManager(InfinispanRegionFactory.java:469)
at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:380)
... 91 more
Caused by: java.lang.ClassNotFoundException: org.infinispan.remoting.transport.jgroups.JGroupsTransport
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.infinispan.commons.util.Util.loadClassStrict(Util.java:158)
at org.infinispan.commons.util.Util.loadClass(Util.java:101)
... 106 more
This exception clearly shows that jar is not present on class path. For web project see if that jar is present inside lib folder of your war.
I am trying to get started with Drools 6x, and in eclipse, I have created a Drools project, which creates the boilerplate code to run a simple drl.
I have the drools runtime installed via Eclipse.
I have drools libraries, drools-core-5.0.1.jar,kie-api-6.0.0.beta4.jar,kie-internal-6.0.0.beta2.jar as External jars in my project.
Yet, when I try to run the following, I get the following error:
java.lang.ExceptionInInitializerError
at com.sample.PetStoreExample.init(PetStoreExample.java:78)
at com.sample.PetStoreExample.main(PetStoreExample.java:67) Caused by: java.lang.RuntimeException: Unable to instance KieServices
at org.kie.api.KieServices$Factory.<clinit>(KieServices.java:137)
... 1 more Caused by: java.lang.ClassNotFoundException:org.drools.compiler.kie.builder.impl.KieServicesImpl at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.kie.api.KieServices$Factory.<clinit>(KieServices.java:165)
... 1 more
If you downloaded the zip of Jars from http://www.drools.org/, you're going to want to include every jar from /binaries in your project. Even the ones that seem like you won't use.
I had this same problem too because I assumed I only needed to use a few Jars, but it turns out they all depend on classes from the other jars in that zip folder.
I had this problem because I had both kie-api and kie-ci as dependencies in my pom file. I removed the kie-ci dependency and I'm not getting this issue any more.
I'm using org.json.JSONObject to pass the parameters to the server. And I'm using Eclipse IDE. I have already added the java-json.jar file to the build path of the project. but still I'm getting the below exception while running the code and no compilation error is displayed. I did clean the project and refreshed several times but still I end up with exception. is there anything missing?
Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.json.JSONObject
Download the Json jar from here and add it to the classpath. If its a web application then add its under lib's.
I have added the same java-json.jar file to the Run configuration's class path of the particular java file. And now it's working absolutely fine. thanks everyone!!!
Add maven dependency in pom.xml
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
I want to create Web service in eclipse + Tomcate v7 and use pipeline I created in Gate in Ubuntu 12.04 32 bit
but I get this error:
can you help me for solving this error??
INFO: Exception:
java.lang.NoClassDefFoundError: gate/Resource
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:142)
at org.apache.axis.utils.cache.ClassCache.lookup(ClassCache.java:85)
at org.apache.axis.providers.java.JavaProvider.getServiceClass(JavaProvider.java:428)
at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:461)
at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:286)
at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:500)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.java:427)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
Caused by: java.lang.ClassNotFoundException: gate.Resource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
... 53 more
Add all jar files in following folders in your build path:
.../GATE_Developer_7.1/bin/
.../GATE_Developer_7.1/lib/
Maybe my answer is a bit late, but I had the same error and found that it's due to the use of '~' for $HOME.
Changing ~/Gate/bin/gate.jar with /home/user/Gate/bin/gate.jar solved the problem for me.