ElasticSearch java.lang.IllegalStateException: jar hell - java

I was able to run my application previously but since today when i tried some experiments it gives me jar hell error out of sudden. Which I have no idea what this exception about, and now my project couldn't work anymore. This is the error causes:
44 [main] DEBUG org.elasticsearch.bootstrap - examining jar: /usr/local/apache-tomcat-7.0.62/lib/annotations-api.jar
55 [main] DEBUG org.elasticsearch.bootstrap - examining jar: /usr/local/apache-tomcat-7.0.62/lib/catalina-ant.jar
57 [main] DEBUG org.elasticsearch.bootstrap - examining jar: /usr/local/apache-tomcat-7.0.62/lib/catalina-ha.jar
59 [main] DEBUG org.elasticsearch.bootstrap - examining jar: /usr/local/apache-tomcat-7.0.62/lib/catalina-tribes.jar
62 [main] DEBUG org.elasticsearch.bootstrap - examining jar: /usr/local/apache-tomcat-7.0.62/lib/catalina.jar
Exception in thread "main" java.lang.IllegalStateException: failed to load bundle [] due to jar hell
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:338)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:109)
at org.elasticsearch.node.Node.<init>(Node.java:146)
at org.elasticsearch.node.Node.<init>(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at com.elastic.Main.main(Main.java:38)
Caused by: java.lang.IllegalStateException: jar hell!
class: org.apache.catalina.util.Base64
jar1: /usr/local/apache-tomcat-7.0.62/lib/catalina-ant.jar
jar2: /usr/local/apache-tomcat-7.0.62/lib/catalina.jar
at org.elasticsearch.bootstrap.JarHell.checkClass(JarHell.java:280)
at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:186)
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:336)
... 5 more
Why is the jar hell occurring? I never seen this before in my developer life and my application was workable before today. Am I missing something important to implement elasticsearch? Here is my code snippet.
Settings.Builder settings = Settings.settingsBuilder();
settings.put("path.home", Paths.get("").toAbsolutePath().toString() + File.separator + "resource" + File.separator + "elasticsearch-2.1.2");
settings.put("cluster.name","mySearch");
Node node = NodeBuilder.nodeBuilder().settings(settings).build().start();
Client client = node.client();
Any helps or clues are welcome and greatly appreciate
EDIT 1:
I was not using VM argument to determine the ES home path as I need to take the project into different paths and platforms when I transferring project.
EDIT 2:
I tried to change my project with elastic home path in VM argument also won't work anymore because I did following the solution that mentioned with this link, but error still raise.

Try to use:
-Dtests.jarhell.check=false
Remark: It works with my Elasticsearch 2.4. I saw comments, that it is not available in all Elasticsearch versions (see Elasticsearch jar hell when writing integration tests)

I got the same error message with catalina.jar conflicting with catalina-ant.jar. So, the quick fix was to rename catalina-ant.jar to catalina-ant.jar.orig in the $TOMCAT/lib folder.
Tomcat is still running for me, even with the one library missing.

Related

Websphere Error SRVE0206E SRVE0187E SRVE0234I SRVE0266E

I'm currently wasting my time trying to figure out why WAS won't load my EAR and why said EAR have problem.
Context:
One of my colleague updated a version of a jar and then my m2e seem to have not picked up and was giving thousand of error (was working fine before)
I tried to check if it was Nexus (work fine). My encrypted password in the setting.xml (work fine).
I decided to try maven from the command line, everything worked fine there to.
When I tried again in RAD (IBM eclipse) everything was now ok, no more error.
I then proceeded to put the generated EAR in my websphere server via add and remove project and I get multiple error when I try to start the server with that ear. (see below)
I though that because it was compiled via maven cmd prompt, I might have compiled with the wrong jvm or something so I deleted my maven repo (.m2 in the user) and try to get the jar via m2e in RAD only.
It's worked until I started the server with the new EAR and got the same set of error.
Any idea on what to do to get rid of these error and have a healthy server.
Here some of the error:
[11/10/17 12:08:51:994 EST] 00000075 annotation W
com.ibm.ws.webcontainer.annotation.WASAnnotationHelper collectClasses
SRVE8000W: Skipped class that failed to initialize for annotation
scanning.
java.lang.ClassNotFoundException: org.springframework.web.servlet.tags.form.SelectTag at
java.lang.Class.forNameImpl(Native Method) at
java.lang.Class.forName(Class.java:219) ...
[11/10/17 12:09:00:282 EST] 00000075 wtp W
org.eclipse.jst.j2ee.commonarchivecore.internal.strategy.TempZipFile
clearTempFile Failed to delete temporary file [
C:\IBM\WebSphere\AppServer-x86\profiles\chris_pro\wstemp\appdepl15fa68a2a21\AuthRenfClientWeb-2.0.26.war2406380505527260260.tmp
] [11/10/17 12:09:00:433 EST] 00000075 SinglePathCla E WSVR0120E: An
error occurred processing com.mycom.bla.testalive.TestAliveServlet
java.io.FileNotFoundException:
C:\IBM\WebSphere\AppServer-x86\profiles\chris_pro\wstemp\appdepl15fa68a2a21\Client-1.61.5-SNAPSHOT.jar6655053587500024283.tmp
(The system cannot find the file specified.) ...
SRVE0266E: Error occured while initializing servlets: {0}
javax.servlet.UnavailableException: SRVE0203E: Servlet [SecurityManager]:
com.mycom.bla.pres.request.http.HttpSecurityManagerServlet was found,
but is missing another required class. SRVE0206E: This error typically
implies that the servlet was originally compiled with classes which
cannot be located by the server. SRVE0187E: Check your class path to
ensure that all classes required by the servlet are present.SRVE0210I:
This problem can be debugged by recompiling the servlet using only the
classes in the application's runtime class path SRVE0234I: Application
class

Exception in thread "main" java.lang.NoSuchFieldError: ruleMemo

I am following a nice openArchitectureWare tutorial (It is about code generation with oAW from EMF models using Xpand).
At the final code generation step, when it is supposed to generate the code (when running workflow.oaw after defining the Root.xpt template), I get this error:
0 INFO WorkflowRunner - --------------------------------------------------------------------------------------
9 INFO WorkflowRunner - openArchitectureWare 4.3.1, Build 20090107-2000PRD
9 INFO WorkflowRunner - (c) 2005-2008 openarchitectureware.org and contributors
10 INFO WorkflowRunner - --------------------------------------------------------------------------------------
11 INFO WorkflowRunner - running workflow: workflow.oaw
11 INFO WorkflowRunner -
Exception in thread "main" java.lang.NoSuchFieldError: ruleMemo
at org.openarchitectureware.xpand2.parser.XpandParser.<init>(XpandParser.java:63)
at org.openarchitectureware.xpand2.parser.XpandParser.<init>(XpandParser.java:74)
at org.openarchitectureware.xpand2.parser.XpandLocationAddingParser.<init>(XpandLocationAddingParser.java:32)
at org.openarchitectureware.xpand2.parser.XpandParseFacade$2.<init>(XpandParseFacade.java:52)
at org.openarchitectureware.xpand2.parser.XpandParseFacade.getParser(XpandParseFacade.java:52)
at org.openarchitectureware.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:34)
at org.openarchitectureware.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:21)
at org.openarchitectureware.xpand2.Generator.getStatement(Generator.java:457)
at org.openarchitectureware.xpand2.Generator.checkConfigurationInternal(Generator.java:497)
at org.openarchitectureware.workflow.lib.AbstractWorkflowComponent2.checkConfiguration(AbstractWorkflowComponent2.java:42)
at org.openarchitectureware.workflow.container.CompositeComponent.checkConfiguration(CompositeComponent.java:169)
at org.openarchitectureware.workflow.WorkflowRunner.prepare(WorkflowRunner.java:310)
at org.openarchitectureware.workflow.WorkflowRunner.run(WorkflowRunner.java:258)
at org.openarchitectureware.workflow.WorkflowRunner.main(WorkflowRunner.java:213)
I searched a lot for the solution. Most of them say that it is an incompatibility issue, for example having several versions of a special jar file in the class path but I can`t find any duplicate jar files at eclipse plugins folder. Is it really the cause? If so, what are the duplicate jar files in my case? and if not, any other solution?
(I have installed oAW 4.3.1 and Xpand 1.4.0 on eclipse-java-kepler-R-win32-x86_64)
Xpand was originally developed as part of openArchitectureWare project. But now, it is an independent component under eclipse and there is no need to install oaw first. So, Changing the whole idea and using this newer tutorial
brought the satisfaction :)

API analysis aborted in Eclipse due to incomplete build path

I am attempting to build the lttng portion of linuxtools by source. I downloaded and extracted the linuxtools-2.0.0 tarball. I imported the lttng subfolder to my workspace. This consisted of 28 separate projects:
org.eclipse.linuxtools.ctf
org.eclipse.linuxtools.ctf.core
org.eclipse.linuxtools.ctf.core.tests
org.eclipse.linuxtools.ctf.parser
org.eclipse.linuxtools.gdbtrace
org.eclipse.linuxtools.gdbtrace.core
org.eclipse.linuxtools.gdbtrace.core.tests
org.eclipse.linuxtools.gdbtrace.help
org.eclipse.linuxtools.gdbtrace.ui
org.eclipse.linuxtools.gdbtrace.ui.tests
org.eclipse.linuxtools.lttng.help
org.eclipse.linuxtools.lttng.releng-site
org.eclipse.linuxtools.lttng2
org.eclipse.linuxtools.lttng2.core
org.eclipse.linuxtools.lttng2.core.tests
org.eclipse.linuxtools.lttng2.kernel
org.eclipse.linuxtools.lttng2.kernel.core
org.eclipse.linuxtools.lttng2.kernel.core.tests
org.eclipse.linuxtools.lttng2.kernel.ui
org.eclipse.linuxtools.lttng2.kernel.ui.tests
org.eclipse.linuxtools.lttng2.ui
org.eclipse.linuxtools.lttng2.ui.tests
org.eclipse.linuxtools.tmf
org.eclipse.linuxtools.tmf.core
org.eclipse.linuxtools.tmf.core.tests
org.eclipse.linuxtools.tmf.help
org.eclipse.linuxtools.tmf.ui
org.eclipse.linuxtools.tmf.ui.tests
In the Problems view I am getting the following error:
API analysis aborted for 'org.eclipse.linuxtoosl.ctf.core' since its build path is incomplete
This occurs for all projects EXCEPT:
org.eclipse.linuxtools.ctf
org.eclipse.linuxtools.gdbtrace
org.eclipse.linuxtools.gdbtrace.help
org.eclipse.linuxtools.lttng.help
org.eclipse.linuxtools.lttng.releng-site
org.eclipse.linuxtools.lttng2
org.eclipse.linuxtools.lttng2.core
org.eclipse.linuxtools.lttng2.core.tests
org.eclipse.linuxtools.lttng2.kernel
org.eclipse.linuxtools.tmf
org.eclipse.linuxtools.tmf.help
Any suggestions as to why this is happening?
The same thing happened to me today and here is how it was resolved (after spending 3 hours on solving it):
Deleted all the binaries manually (from the problematic plugins),
Update the target definition,
Debug Configurations->Plug-ins->Select all->Apply->Debug
Hope that helps!

tortoise svn fails to import to repository due to Inconsistent line ending style

I was very excited to see that there is a check-style like plugin called CheckStyle-IDEA plugin for IntelliJ that i can enforce code style on the source.
I installed it using the IDE plugin repository, restarted it.
Unfortunately After pressing the check this file or check project I got the an exception (see log below).
I am using windows 7 pro,
IDEA 10.0.3 build #103.255 Build on April 2011
JDK 1.6.0_21
did anyone encountered this problem?
is there any other tool to do this job through the intelliJ IDE?
Thanks
2011-05-05 11:41:56,723 [1300492] INFO - ea.checkstyle.CheckStylePlugin - Scanning current file(s).
2011-05-05 11:41:56,727 [1300496] ERROR - style.checker.CheckFilesThread - An error occurred while scanning a file.
org.infernus.idea.checkstyle.exception.CheckStylePluginException: An error occurred during a file scan.
at org.infernus.idea.checkstyle.CheckStylePlugin.processError(CheckStylePlugin.java:409)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:72)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.charAt(String.java:686)
at java.util.regex.Matcher.appendReplacement(Matcher.java:703)
at java.util.regex.Matcher.replaceAll(Matcher.java:813)
at java.lang.String.replaceAll(String.java:2189)
at org.infernus.idea.checkstyle.util.ScannableFile.parentDirFor(ScannableFile.java:72)
at org.infernus.idea.checkstyle.util.ScannableFile.createTemporaryFileFor(ScannableFile.java:58)
at org.infernus.idea.checkstyle.util.ScannableFile.(ScannableFile.java:40)
at org.infernus.idea.checkstyle.checker.CreateScannableFileAction.run(CreateScannableFileAction.java:60)at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:757) at org.infernus.idea.checkstyle.checker.FileScanner.createTemporaryFile(FileScanner.java:228)
at org.infernus.idea.checkstyle.checker.FileScanner.checkPsiFile(FileScanner.java:167)
at org.infernus.idea.checkstyle.checker.FileScanner.run(FileScanner.java:80)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:770) at org.infernus.idea.checkstyle.checker.CheckFilesThread.runFileScanner(CheckFilesThread.java:39) at org.infernus.idea.checkstyle.checker.AbstractCheckerThread.processFilesForModuleInfoAndScan(AbstractCheckerThread.java:132)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:57)
Checkstyle-idea plugin is sadly rather buggy :(
You can post or view issues at http://code.google.com/p/checkstyle-idea/ and get much faster support than here.

Deploying WAR with CXF in Glassfish V3

I'm trying to deploy a WAR in GF V3 that has CXF as a dependency and I get the following exception:
[#|2011-02-08T07:34:15.736-0800|WARNING|oracle-glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=32;_ThreadName=http-thread-pool-8080-(2);|StandardWrapperValve[MyServlet]: PWC1406: Servlet.service() for servlet MyServlet threw exception
com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.pipe.TransportPipeFactory: Provider com.sun.enterprise.jbi.serviceengine.bridge.transport.JBITransportPipeFactory is specified in bundle://254.0:0/META-INF/services/com.sun.xml.ws.api.pipe.TransportPipeFactory but not found
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:241)
at com.sun.xml.ws.util.ServiceFinder.access$100(ServiceFinder.java:141)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:376)
at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java:129)
at com.sun.xml.ws.transport.DeferredTransportPipe.<init>(DeferredTransportPipe.java:82)
at com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext.createTransportTube(ClientTubeAssemblerContext.java:311)
at com.sun.xml.ws.assembler.jaxws.TransportTubeFactory.createTube(TransportTubeFactory.java:62)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:77)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:121)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:224)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:201)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:174)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:81)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:602)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:308)
at javax.xml.ws.Service.getPort(Service.java:99)
at com.mycompany.myapp.webserviceclient.SomeWebserviceService.getSomeWebservicePort(SomeWebserviceService.java:58)
This sorta indicates to me that there is a bundle in my WAR\lib directory that is causing problems, but when I expand the WAR and do a search on META-INF\services I do not find anything that is close what is outlined in the exception.
I originally had CXF and it's transitive dependencies in the war\lib dir, but I've since removed that and still encounter the same error.
Nothing useful comes up when searching google and I'm at a loss here.
Does anyone know what might be going on here?
EDIT #1
Another symptom of this is that the tester pages for deployed web services will not work properly.
I had a similar problem with my glassfish3.1. Below is a stack trace
Caused by: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.pipe.TransportPipeFactory: Provider com.sun.enterprise.jbi.serviceengine.bridge.transport.JBITransportPipeFactory is specified in bundle://96.0:0/META-INF/services/com.sun.xml.ws.api.pipe.TransportPipeFactory but not found
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:245)
at com.sun.xml.ws.util.ServiceFinder.access$100(ServiceFinder.java:145)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:380)
at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java:133)
at com.sun.xml.ws.transport.DeferredTransportPipe.<init>(DeferredTransportPipe.java:86)
at com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext.createTransportTube(ClientTubeAssemblerContext.java:315)
at com.sun.xml.ws.assembler.jaxws.TransportTubeFactory.createTube(TransportTubeFactory.java:67)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:228)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:205)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:178)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:85)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:608)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:348)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312)
at javax.xml.ws.Service.getPort(Service.java:134)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:563)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:169)
at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:104)
at org.glassfish.webservices.EjbWebServiceServlet.service(EjbWebServiceServlet.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at com.sun.grizzly.http.servlet.ServletAdapter$FilterChainImpl.doFilter(ServletAdapter.java:1002)
... 20 more
The problem was traced to the conflicting mappings for "com.sun.xml.ws.api.pipe.TransportPipeFactory" inside two different modules.
prompt> grep -rl com.sun.xml.ws.api.pipe.TransportPipeFactory /usr/local/glassfish-3.1/glassfish/domains/modules*
modules/webservices-osgi.jar
modules/sun-javaee-engine.jar
prompt> grep -rl com.sun.enterprise.jbi.serviceengine.bridge.transport.JBITransportPipeFactory /usr/local/glassfish-3.1/glassfish/domains/modules/*
modules/sun-javaee-engine.jar
Clearly, the required file was sitting in the wrong jar "sun-javaee-engine.jar".
Above, "sun-javaee-engine.jar" is loaded by the "Java EE Service Engine Module". Once I removed the module (using glassfish update tool) everything started working fine.
EDIT #1:
Here is how to remove the module using the update tool on the Unix command line:
sudo ./pkg uninstall sun-javaee-engine

Categories