"Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/stream/buffer/XMLStreamBuffer" - wsdl

I created jax-ws service and it worked succesfly with tomcat then i install wildfly 8 for another project and it does not work and ı got "Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/stream/buffer/XMLStreamBuffer" error message when i run it.How can i solve this problem?

Related

Grails 4: Micronaut fails with NoClassDefFoundError: javax/annotation/PreDestroy

I migrated a Grails 3.3.10 application to Grails 4.0.0, moving from Java 8 to OpenJDK 11. After some work to make the tests and application run on my development environment ( a windows 10 machine ), I packaged my executable war in a docker adoptopenjdk/openjdk11:alpine. The docker's entrypoint just runs the app:
java <some options> -jar /app/application.war
The docker when run however gives an error when initializing Micronaut:
java.util.ServiceConfigurationError: Error loading service
[org.grails.databinding.converters.$DefaultConvertersConfigurationDefinitionClass]:
javax/annotation/PreDestroy
at io.micronaut.core.io.service.DefaultServiceDefinition.lambda$load$0(DefaultServiceDefinition.java:71)
...
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
...
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy
I tried to add compile 'javax.annotation:javax.annotation-api:1.3.2' in my gradle dependencies, without success.
What's missing to make my application run?
Java 11 no longer ships with some of the javax libraries.
Following the instruction from https://blog.codefx.org/java/java-11-migration-guide/#Migrating-From-Java-8-To-Java-11 solved the issue.

Getting java.lang.NoClassDefFoundError: javax/el/ELResolver while running struts junit

I am writing junits for struts action class and using org.apache.struts2.StrutsTestCase, while running the test cases I am getting below exception.
java.lang.NoClassDefFoundError: javax/el/ELResolver
at org.apache.struts2.tiles.StrutsTilesInitializer.createContainerFactory(StrutsTilesInitializer.java:58)
at org.apache.tiles.startup.AbstractTilesInitializer.createContainer(AbstractTilesInitializer.java:123)
at org.apache.tiles.startup.AbstractTilesInitializer.initialize(AbstractTilesInitializer.java:70)
at org.apache.tiles.web.startup.AbstractTilesListener.contextInitialized(AbstractTilesListener.java:62)
at com.dmainc.agora.action.test.SetupStrutsTestCase.setUp(SetupStrutsTestCase.java:261)
so I added el-api.jar in the run config , then again ran the test, but started getting another exception i.e
java.lang.NoSuchMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
at org.apache.tiles.el.JspExpressionFactoryFactory.getExpressionFactory(JspExpressionFactoryFactory.java:61)
at org.apache.struts2.tiles.StrutsTilesContainerFactory.createELEvaluator(StrutsTilesContainerFactory.java:251)
at org.apache.struts2.tiles.StrutsTilesContainerFactory.createAttributeEvaluatorFactory(StrutsTilesContainerFactory.java:198)
at org.apache.tiles.factory.BasicTilesContainerFactory.createContainer(BasicTilesContainerFactory.java:106)
at org.apache.tiles.startup.AbstractTilesInitializer.createContainer(AbstractTilesInitializer.java:124)
at org.apache.tiles.startup.AbstractTilesInitializer.initialize(AbstractTilesInitializer.java:70)
at org.apache.tiles.web.startup.AbstractTilesListener.contextInitialized(AbstractTilesListener.java:62)
I guess this is happening due to some jar/jar version has conflict, but could not figure out why?
Any suggestions will be highly appreciated.
Solution 1:
Inner of the apache-tomcat-x.x.xx\lib folder
el-api.jar file set classpath environment variable.
Solution 2:
copy apache-tomcat-x.x.xx\lib\el-api.jar file in to jreX.X.X_XXX\lib\ext\ folder.
because it is used to preload tomcat server start
Run again your test case.

Issue with C# sonarqube plugin

I have a SonarQube 5.6 installed since a year now, It's integrated with TFS. Installed with few additional plugins, C#, dependency-check, fxcop, java, Checkmarx, scm-cvs, scm-git, scm-svn and scm-tfvc.
everything was working fine. Today it's started failing build with error
2017-06-26T17:54:22.7387533Z Downloading SonarQube.MSBuild.Runner.Implementation.zip from http://xxxxxxx:9000/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip to E:\agnt\_work\41\.sonarqube\bin\SonarQube.MSBuild.Runner.Implementation.zip
2017-06-26T17:54:22.7397520Z ##[error]Could not find a file on the SonarQube server. Url: http://xxxxxxxxxx:9000/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip
2017-06-26T17:54:22.7407523Z ##[error]Failed to update the SonarQube Scanner for MSBuild binaries. Check the server url, verify that the C# plugin is correctly installed on the SonarQube server and that the SonarQube server has been restarted.
2017-06-26T17:54:22.7417526Z ##[error]Pre-processing failed. Exit code: 1
2017-06-26T17:54:22.8678238Z ##[error]System.Exception: Unexpected exit code received from batch file: 1
2017-06-26T17:54:22.8698250Z ##[error] at Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeBatchScriptCmdlet.ProcessRecord()
2017-06-26T17:54:22.8708248Z ##[error] at System.Management.Automation.CommandProcessor.ProcessRecord()
From the error, I can it's something related to C# plugin. I checked that plugin under /extensions/plugins and it's there. I thought it can be something compatibility issue, I tried to upgrade it to latest one 6.0
After installing 6.0 tried again and got the same error.
I also tried with old version of same plugins. tried 5.3, 5.0. After manually copied jar file under /plugins. Tried to restart the sonar server and it didn't started successfully. I got the error as below,
2017.06.26 18:31:11 ERROR web[o.s.s.p.Platform] Fail to stop server - ignored
java.lang.IllegalStateException: Cannot stop. Current container state was: CONSTRUCTED at org.picocontainer.lifecycle.DefaultLifecycleState.stopping(DefaultLifecycleState.java:72) ~[picocontainer-2.15.jar:na] at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:794) ~[picocontainer-2.15.jar:na]
2017.06.26 18:31:11 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Fail to load plugin FxCop [fxcop] at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:74) ~[sonar-server-5.6.jar:na] at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:691) ~[sonar-server-5.6.jar:na] at org.sonar.server.platform.Platform.start(Platform.java:216) ~[sonar-server-5.6.jar:na]
Caused by: java.lang.IllegalStateException: Unable to register extension org.sonar.api.config.PropertyDefinition at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:248) ~[sonar-core-5.6.jar:na] at org.sonar.server.plugins.ServerExtensionInstaller.installExtension(ServerExtensionInstaller.java:111) ~[sonar-server-5.6.jar:na] at org.sonar.server.plugins.ServerExtensionInstaller.installExtensions(ServerExtensionInstaller.java:66) ~[sonar-server-5.6.jar:na]
Caused by: org.picocontainer.PicoCompositionException: Duplicate Keys not allowed. Duplicate for 'org.sonar.api.config.PropertyDefinition-sonar.cs.fxcop.timeoutMinutes'at org.picocontainer.DefaultPicoContainer.addAdapterInternal(DefaultPicoContainer.java:438) ~[picocontainer-2.15.jar:na]
2017.06.26 18:31:11 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file 2017.06.26 18:31:11 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors
2017.06.26 18:31:11 WARN web[o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread
2017.06.26 18:31:11 WARN web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.6.jar:na]at org.sonar.server.app.WebServer.isUp(WebServer.java:47) [sonar-server-5.6.jar:na]at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.6.jar:na]at org.sonar.server.app.WebServer.main(WebServer.java:68) [sonar-server5.6.jar:na]
can someone please help to fix this issue?
You need to update the Scanner for MsBuild as well. The old versions are not compatible with SonarC# 6+.
I fixed this issue by removing FxCop plugin. Somehow that plugin stopped working. can be the version what i was using that was not compatible with C# plugin. I installed C# plugin version 5.0 (latest is 6.0)
as mentioned above, if i want to use C# latest version, i need to update sonar scanner for MSBuild.

Issues in connecting to Neo4j from linux

Trying to connect to Neo4j from java I get the following error:
Exception in thread "main" java.lang.RuntimeException: Error starting
org.neo4j.kernel.EmbeddedGraphDatabase, /data/graph.db
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:323)
at org.neo4j.kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.java:100)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:92)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:197)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69)
at .....
Caused by: org.neo4j.kernel.lifecycle.LifecycleException:
Component
'org.neo4j.kernel.impl.transaction.XaDataSourceManager#4514ba77' was
successfully initialized, but failed to start. Please see attached
cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:300)
... 7 more Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component
'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#2c86c977' was
successfully initialized, but failed to start. Please see attached
cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:165)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)
... 9 more Caused by: java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider
found. Kernel extensions available on classpath:
Class path entries: /...../java/....xyz.jar
at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:136)
at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:128)
at org.neo4j.kernel.extension.KernelExtensions.resolveDependency(KernelExtensions.java:207)
at org.neo4j.kernel.InternalAbstractGraphDatabase$DependencyResolverImpl.resolveDependency(InternalAbstractGraphDatabase.java:1403)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:311)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)
... 12 more
I am using Ne04j-2.0.0-M05 version, running the java code under Java 7 in a linux machine. The same jar files and java code works good though in a windows machine. The web admin interface works well (hence path to db may not be a issue since I ve given the same path in org.neo4j.server.database.location and org.neo4j.server.webadmin.data.uri),
The java code I used to connect is :
String dbpath = "/NEO4J_HOME/data/graph.db/";
graphdb = new GraphDatabaseFactory().newEmbeddedDatabase(dbpath);
Can you tell what might cause the java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider found
Looks like you're lacking neo4j-lucene-index on your classpath. If that hint does not help provide a list of jars being on the classpath.
Keep Neo4j related jars seperate, i.e do not bundle them inside the jar you create. Instead just make use of class path option to point Neo4j libraries in run time.
I got the same error, and finally fount it's the different version of neo4j and neo4j-lucene-index which caused the error. They need to keep in the same version. Still not sure which version of lucene it depends on, but 3.6.2 can survive the compile. Thanks Stefan. It's hard to find the latest version of everything neo4j depends on.
compile "org.neo4j:neo4j-kernel:2.0.0-RC1"
compile "org.apache.lucene:lucene-core:3.6.2"
compile "org.neo4j:neo4j-lucene-index:2.0.0-RC1"
This fixed my error.

STS2.6 grails error : unrecognized Windows Sockets error: 10106: create

grails project,
work fine at SpringSource Tool Suite 2.5.1.RELEASE
got problem at SpringSource Tool Suite 2.6.0 RELEASE
error message:
Running Grails application..
2011-03-29 10:29:45,140 [main] ERROR http11.Http11Protocol - Error initializing endpoint
java.net.SocketException: Unrecognized Windows Sockets error: 10106: create
This could possibly be a problem with the Java executable that you are using. See this thread:
http://forum.springsource.org/showthread.php?t=106504&highlight=Unrecognized+Windows+Sockets+error
The poster worked around the problem by adding the following line to the buildConfig.groovy file:
grails.server.port.http=9080
If this doesn't work for you, I'd recommend following up on the STS forum:
http://forum.springsource.org/forumdisplay.php?f=32
(you can even post to the thread above)

Resources