java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory - eclipse

I am using jdk 1.6.31 and when i add a server (WSO2 Carbon 3.0.1 based server) in eclipse and try to start the server it gives me the following error in the console:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.wso2.carbon.server.Main.<clinit>(Main.java:38)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
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)
... 1 more
Exception in thread "main"
WSO2 Carbon 3.2 based server gets started but with this in the console:
No properties path set - looking for transactions.properties in classpath...
Using init file: /D:/naveenraj/wso2/Training%20Workouts/wso2esb-4.0.3/lib/transactions.properties
Is this a vital error?
I am new to WSO2 ESB.

I'm not sure if this could help but make sure you defined JAVA_HOME and CARBON_HOME before starting the server
Good luck
Christophe

Related

ClassNotFound on CloudFoundry push of alp server directory, but not on push of EAR :-?

I am currently trying to deploy a Java Application into IBM Liberty for Cloud Foundry. The Application is a Spring-Boot application. The deployment works perfect when pushing the EAR itself. But I need to amend the server.xml of the Liberty server. Thus I now push a defaultServer directory containing the server.xml and my EAR.
For now I have copied the server.xml from the profile in the cloud when it is successfully deployed via push EAR. So I expect the server.xml to be working. But when I now deploy the defaultServer I suddenly get a ClassNotFoundException on server start.
What is going wrong? Why does it suddenly not find its dependencies event though the EAR is pretty much the same.
------Start of DE processing------ = [4/15/19 21:12:17:313 UTC]
Exception = java.util.ServiceConfigurationError
Source = com.ibm.ws.webcontainer.osgi.DynamicVirtualHost
probeid = startWebApp
Stack Dump = java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializer could not be instantiated
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers(WebApp.java:2453)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:995)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6594)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:467)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:462)
at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1140)
at com.ibm.ws.webcontainer.osgi.WebContainer.access$000(WebContainer.java:110)
at com.ibm.ws.webcontainer.osgi.WebContainer$3.run(WebContainer.java:952)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:239)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org.springframework.context.ApplicationContextInitializer
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at com.ibm.ws.classloading.internal.AppClassLoader.definePackageAndClass(AppClassLoader.java:357)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:281)
at java.lang.ClassLoader.loadClassHelper(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:522)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers(WebApp.java:2453)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:482)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializer.<clinit>(AutoReconfigurationServletContainerInitializer
.java:33)
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Unknown Source)
... 17 more
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextInitializer
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:544)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:286)
at java.lang.ClassLoader.loadClassHelper(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:522)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:482)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
I would expect that the application starts the same way as with only pushing the EAR so that I can go on manipulating the server.xml as needed.
Thanks,
Alex

Unable to find NodeJSInstalls for Parsing TypeScript file using Eclipse plugin

i'm facing below issue while parsing TypeScript files in the Eclipse plugin project. Following are log details:
INFO [main] (GeneratorMain.java:178) - Start generate model STST0101_swap_js.xbl
java.lang.NullPointerException
at ts.eclipse.ide.internal.core.Trace.trace(Trace.java:89)
at ts.eclipse.ide.internal.core.Trace.trace(Trace.java:61)
at ts.eclipse.ide.internal.core.nodejs.NodejsInstallManager.loadNodejsInstalls(NodejsInstallManager.java:109)
at ts.eclipse.ide.internal.core.nodejs.NodejsInstallManager.getNodejsInstalls(NodejsInstallManager.java:68)
at com.sample.ts.nodejs.NodeJSProcess.getNodeJsPath(NodeJSProcess.java:125)
at com.sample.ts.nodejs.NodeJSProcess.startServer(NodeJSProcess.java:198)
at com.sample.ts.nodejs.NodeJSProcess.ensureRunning(NodeJSProcess.java:85)
at com.sample.ts.tsparser.ScriptParserClient.executeRequest(ScriptParserClient.java:43)
at com.sample.ts.tsparser.ScriptParserClient.parseString(ScriptParserClient.java:100)
at com.sample.ts.tsparser.ScriptParser.parse(ScriptParser.java:73)
at com.sample.ts.ast.AST.parseString(AST.java:163)
at com.sample.nmc.ts.generator.GeneratorBase.findClass(GeneratorBase.java:302)
at com.sample.nmc.ts.generator.GeneratorBase.ensureClass(GeneratorBase.java:115)
at com.sample.nmc.ts.generator.EventActionGenerator.doGenerate(EventActionGenerator.java:37)
at com.sample.nmc.ts.generator.GeneratorBase.generate(GeneratorBase.java:58)
at com.sample.nmc.ts.GeneratorMain.generateXbl(GeneratorMain.java:198)
at com.sample.nmc.ts.GeneratorMain.generateFunctionUnit(GeneratorMain.java:168)
at com.sample.nmc.ts.GeneratorMain.execute(GeneratorMain.java:66)
at com.sample.nmc.ts.GeneratorMain.main(GeneratorMain.java:43)
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.sample.ts.tsparser.ScriptParserClient.executeRequest(ScriptParserClient.java:52)
at com.sample.ts.tsparser.ScriptParserClient.parseString(ScriptParserClient.java:100)
at com.sample.ts.tsparser.ScriptParser.parse(ScriptParser.java:73)
at com.sample.ts.ast.AST.parseString(AST.java:163)
at com.sample.nmc.ts.generator.GeneratorBase.findClass(GeneratorBase.java:302)
at com.sample.nmc.ts.generator.GeneratorBase.ensureClass(GeneratorBase.java:115)
at com.sample.nmc.ts.generator.EventActionGenerator.doGenerate(EventActionGenerator.java:37)
at com.sample.nmc.ts.generator.GeneratorBase.generate(GeneratorBase.java:58)
at com.sample.nmc.ts.GeneratorMain.generateXbl(GeneratorMain.java:198)
at com.sample.nmc.ts.GeneratorMain.generateFunctionUnit(GeneratorMain.java:168)
at com.sample.nmc.ts.GeneratorMain.execute(GeneratorMain.java:66)
at com.sample.nmc.ts.GeneratorMain.main(GeneratorMain.java:43)
The plugin project runs perfectly fine if executed as Eclipse plugin. I face above error if i try executing it as Runnable JAR file.
Kindly provide necessary help

Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\Neo4jCommunity

I'm facing a problem which blocks me. I work on a project with Neo4j Database Graphs.
My problem is when i run java application, it displays me in console :
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\Neo4jCommunity
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:358)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:90)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:199)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:70)
at HelloWorld.createDataBase(HelloWorld.java:35)
at HelloWorld.main(HelloWorld.java:28)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions#1304421' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:489)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:72)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:106)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:335)
... 6 more
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/store/Directory
at org.neo4j.kernel.api.impl.index.DirectoryFactory.<clinit>(DirectoryFactory.java:53)
at org.neo4j.kernel.api.impl.index.LuceneKernelExtensions.directoryFactory(LuceneKernelExtensions.java:36)
at org.neo4j.kernel.api.impl.index.LuceneLabelScanStoreExtension.newKernelExtension(LuceneLabelScanStoreExtension.java:71)
at org.neo4j.kernel.api.impl.index.LuceneLabelScanStoreExtension.newKernelExtension(LuceneLabelScanStoreExtension.java:39)
at org.neo4j.kernel.extension.KernelExtensions.init(KernelExtensions.java:104)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:483)
... 9 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Directory
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)
... 15 more
I don't know where the problem comes from, knowing that I install all NEO4j jars needed.
enter code here
Thank you all

Stubborn ClassNotFoundException for org.apache.commons.io.output.ByteArrayOutputStream

I have been running the same web application from within eclipse for some time, and heavily using org.apache.commons.io.output.ByteArrayOutputStream.
Out of the blue, the project is now throwing ClassNotFoundException although commons-io-2.4.jar is included in the build path and marked as exported.
This very class has been used for some time, hence the puzzle
What can I do better to make sure the class is found?
Edit: I have two servers configured Tomcat 7.0.40 and Tomcat 6.0.33
The problem only shows on Tomcat 7.
Note: The following workarounds have been attempted:
Restarting Eclipse.
Cleanup project
Remove and add back commons-io-2.4.jar
Stack Trace:
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebApp]]
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebApp]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/io/output/ByteArrayOutputStream
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.output.ByteArrayOutputStream
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 21 more
The problem has been fixed by removing the Tomcat 7.0 instance from Eclipse and and add it back
I can only guess Servers configuration can get corrupted from time to time

Driver not found Exception in Web Service example

Hi
I am creating a web service and web service client in Eclipse IDE.
From the client I am able to access the methods of the web service, but when I write some code related to database( in the method of web service), I get Error that It is unable to locate the driver, But I have set the related jar file in the class path of the web service project.
After the above error I get the following Error:
[INFO] Unable to sendViaPost to url[http://localhost:5050/NewOracleMod1/services/Account.AccountHttpSoap11Endpoint/]
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:557)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at package1.AccountStub.updateAccount(AccountStub.java:202)
at package1.TestClient11.main(TestClient11.java:14)
org.apache.axis2.AxisFault: Connection refused: connect
I am new to Web services as well as to Eclipse IDE.
Please help me to come out of this problem.
Thanks
I need to put the jars in the lib of the project too. and the problem is solved