java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException - java

I am trying to build my Java project with Ant.
But I am getting java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException while executing the cleintgen Ant task.
I am not sure if I am missing any jar. I have added jars mentioned below in taskdef classpath attribute-
weblogic-classes.jar
wlthint3client.jar
wlfullclient.jar
xmlbeans-1.0.jar
Error at line -
<clientgenSRF wsdl="D:/POC/Code/WSDLs/Update_V3.wsdl"
destFile="D:/POC/Code/SRF/clientstubs/newjar/createTroubleTicket_client.jar" />

Possibly missing in older version.
Upgrade xmlbeans-1.0.jar to xmlbeans-2.6.0.jar will be advantages.

Related

Jboss patch to eap 7.0.,5 | java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider

i am getting below error while doing log in to my application which uses Java 8 and Jboss 7.0.5 (just patched from 7.0.4 to 7.0.5) :
11:57:19,190 ERROR [stderr] (default task-7) Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider 2018-01-02 11:57:19,190 [default task-7] ERROR stderr - Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
This error has been occuring after applying patch
any help valuable suggestions would be really appriciated!!!
Jboss 7 looks for dependencies in the modules folder. You can't just go in the modules.xml file and add new modules if they don't actually exist.
What you need to do is find out whether there is a jar containing the missing class, if it exist then you need to add a reference to that module from your project, if does not exist, you need to manually download it and copy it to the modules directory and then reference it.
You have several ways you can reference it:
Add a classpath entry to your manifest file: Classpath: com.sun.net
Add a global reference to that module in your standalone.xml by adding a Global module.
For more details, look here.

org.apache.cxf.bus.extension.ExtensionException in WAS9 server

Can you please help me with following error I'm facing in WAS9 environment:
In order to resolve the import
org.apache.cxf.binding.soap.SoapHeader
I added the following dependencies in my pom.xml:
cxf-api-2.7.7
cxf-rt-bindings-soap-2.7.7
But when I'm trying to run my application, I'm getting the following error.
Default Executor-thread-7] ([ ]) Controllerclass - org.apache.cxf.bus.extension.ExtensionException
at org.apache.cxf.bus.extension.Extension.load(Extension.java:222)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:199)
at org.apache.cxf.bus.extension.ExtensionManagerImpl.initialize(ExtensionManagerImpl.java:118)
at org.apache.cxf.bus.extension.ExtensionManagerBus.doInitializeInternal(ExtensionManagerBus.java:147)
at org.apache.cxf.bus.CXFBusImpl.initialize(CXFBusImpl.java:191)
at com.ibm.ws.jaxws.bus.LibertyApplicationBusFactory.createBus(LibertyApplicationBusFactory.java:119)
at com.ibm.ws.jaxws.bus.LibertyApplicationBusFactory.createClientScopedBus(LibertyApplicationBusFactory.java:86)
at com.ibm.ws.jaxws.metadata.JaxWsClientMetaData.<init>(JaxWsClientMetaData.java:28)
at com.ibm.ws.jaxws.metadata.JaxWsModuleMetaData.getClientMetaData(JaxWsModuleMetaData.java:123)
at com.ibm.ws.jaxws.support.JaxWsMetaDataManager.getJaxWsClientMetaData(JaxWsMetaDataManager.java:84)
at com.ibm.ws.jaxws.support.JaxWsMetaDataManager.getJaxWsClientMetaData(JaxWsMetaDataManager.java:123)
at com.ibm.ws.jaxws.client.LibertyProviderImpl.createServiceDelegate(LibertyProviderImpl.java:56)
at javax.xml.ws.Service.<init>(Service.java:57)
Caused by: java.lang.InstantiationException:org.apache.cxf.bus.osgi.OSGIBusListener
at java.lang.Class.newInstance(Class.java:427)
at org.apache.cxf.bus.extension.Extension.load(Extension.java:218)
Caused by: java.lang.NoSuchMethodException:org.apache.cxf.bus.osgi.OSGIBusListener.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
The server where your WAS9 has been deployed has different version of the above jar file. You need to have same version of jar files both in your eclipse where you have developed your codes and the server where you are deploying the war or ear.
mavan dependency file pom.xml is used during your project compilation. It might add the jar in your binary under lib folder as well. But WAS9 might considering the one which is in server's CLASSPATH. Hence check your class path and replace that jar with the one which you have mentioned in your pom.xml file. Hope that will fix your issue.
We can eliminate this exception by adding webProfile-7.0 in our server.xml, but how ever this is not working with javaee-7.0 not sure, if one knows about how to handle this in javaee-7.0 please share your approach.

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Files.newReaderSupplier(Ljava/io/File;Ljava/nio/charset/Charset;)

I am getting the following exception from one private library:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.io.Files.newReaderSupplier(Ljava/io/File;Ljava/nio/charset/Charset;)Lcom/google/common/io/InputSupplier;
After researching it seems the issue is with a google guava jar.
I am using google guava jar version 17.0 and tried changing the version also.But was not able to figure out the specific jar version that will resolve the issue.
Please help.
The issue was with Weblogic 12c which adds Guava 17.0 jar internally.So it ignores the Guava jar in the maven pom.xml .
To solved this issue add weblogic.xml in the application/war and mention the packages that needs to be excluded.

Datanucleus RDBMS JPA jar-with-dependencues

I configured and I use Datanucleus JPA to connect to MySQL. I compile the classes and enhanced entities with datanucleus-enhancer-plugin. I can run my app using mvn exec:java and I can also run it after I create an archive with lib (jar dependencies).
The problem appears when I create a jar (jar-with-dependencies). I get this error:
javax.persistence.PersistenceException: Explicit persistence provider error(s) occurred for "mysql" after trying the following discovered implementations: org.datanucleus.api.jpa.PersistenceProviderImpl from provider: org.datanucleus.api.jpa.PersistenceProviderImpl
at javax.persistence.Persistence.createPersistenceException(Persistence.java:244)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:186)
at cantina.crawler.util.JpaUtil.getRdbmsEntityManager(JpaUtil.java:29)
at cantina.crawler.bolt.SiteDetectorBolt.prepare(SiteDetectorBolt.java:32)
at backtype.storm.daemon.executor$fn__4050$fn__4059.invoke(executor.clj:610)
at backtype.storm.util$async_loop$fn__465.invoke(util.clj:375)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.datanucleus.exceptions.NucleusException: Error creating handler of type "persistence" for metadata parsing : MetaData handler plugin "persistence" was not found. Please check your CLASSPATH and plugin specification.
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:269)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaDataParser.java:137)
at org.datanucleus.metadata.MetaDataUtils.parsePersistenceFiles(MetaDataUtils.java:956)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:342)
at org.datanucleus.api.jpa.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:91)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:152)
... 6 more
Caused by: org.datanucleus.exceptions.NucleusUserException: MetaData handler plugin "persistence" was not found. Please check your CLASSPATH and plugin specification.
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:263)
... 11 more
I unziped the jar and the datanucleus-core files are there. I can not figure out what is happening.
You've not bothered looking after MANIFEST.MF and plugin.xml files when you changed the jar(s). DataNucleus jars are packaged to allow the (OSGi-based) plugin mechanism to identify plugins and capabilities. You've disabled that by playing around with those jars, so get the consequences.
Solution : either use the jars as provided, or merge them correctly (in which case it's your responsibility)

maven - strange class not found exception

Hy,
I have a maven project.
mvn clean install
works perfect.
When deploying on my jboss server i receive this strange error:
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: javax.ws.rs.core.Response
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 93 more
I've checked if artifact exists and it's there.
C:\Users\Cristian.m2\repository\org\jboss\resteasy\jaxrs-api\2.0-beta-4\
Does anyone have a work-around for this problem?
Your dependecy isn't in the deployed application. You may have to change the "provided" scope to "compile"
Resources :
Maven - Dependecy scope

Categories

Resources