I have a project which was on WebSphere 7.0.
Currently I am carrying it to EAP 6.4.
Java version is 1.6.
DB2 is the database I use. And the same driver that I used earlier in websphere is set under modules of jboss. Database connection is OK. But after Executequery method run I get the error
JBWEB000289: Servlet InitServlet threw load() exception:
java.lang.ClassNotFoundException: sun.io.ByteToCharConverter from
I googled it a lot and the only solution I found that I tried is setting
-Ddb2.jcc.charsetDecoderEncoder=3
I set this under VM arguments of runtime, jboss eap 6.4.
I also tried to set this prop to properties that I set before database execution.
props.setProperty("db2.jcc.charsetDecoderEncoder", "3");
But problem still exists.
This is the error message that I get. And it still exists.
JBWEB000289: Servlet InitServlet threw load() exception:
java.lang.ClassNotFoundException: sun.io.ByteToCharConverter from
Here is the full log:
14:41:38,389 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cantekWeb]] (ServerService Thread Pool -- 62)
JBWEB000289: Servlet InitServlet threw load() exception: java.lang.ClassNotFoundException: sun.io.ByteToCharConverter from
[Module "deployment.cantek.ear.cantekWeb.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
at com.ibm.db2.jcc.b.r.a(r.java:157) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.d.a(d.java:986) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.fb.a(fb.java:1723) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.fb.a(fb.java:1651) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.fb.n(fb.java:570) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.fb.j(fb.java:257) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.fb.c(fb.java:57) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.s.c(s.java:42) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.c.wb.h(wb.java:169) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.b.id.p(id.java:1246) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.b.jd.a(jd.java:2275) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.b.jd.V(jd.java:505) [db2jcc-0.0.1.jar:]
at com.ibm.db2.jcc.b.jd.executeQuery(jd.java:488) [db2jcc-0.0.1.jar:]
at com.cimmy.service.data.Talep.loadSikayetKonular(Talep.java:138) [classes:]
at com.cimmy.service.servlet.InitServlet.sikayetKonulari(InitServlet.java:472) [classes:]
at com.cimmy.service.servlet.InitServlet.load(InitServlet.java:412) [classes:]
at com.cimmy.service.servlet.InitServlet.init(InitServlet.java:220) [classes:]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1100) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3593) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_211]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_211]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_211]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_211]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
You should never use sun.* packages in your code. Not only are they not guaranteed to get carried over with new versions of Java, but as you noticed, some web containers will even prevent them being accessed at all.
I understand that in this case, the problem might be with the driver itself and not the code that you yourself have written. However, the above still applies. If the driver is open-source, you might want to tweak with the code, however, you might also upgrade to a newer version of the driver. You can find more details here:
NoClassDefFoundError sun/io/ByteToCharConverter with InterBase JDBC driver
or here:
https://www-01.ibm.com/support/docview.wss?uid=swg1IC74895
(the resolution suggests "Fixed in DB2 V9.7 FP5 JDBC drivers.")
I made all the above changes which are also needed. But the real problem I faced was related to JBoss EAP 6.4 JRE settings. It was using 1.8 and since this version does not have needed classes in it it was throwing this error. So I made changes on that setting and made it to look at 1.7. After that this problem is solved.
Thanks for the help.
Related
When I try to deploy Dep.ear it is throwing below error:
<Deployer> <BEA-149205> <Failed to initialize the application "Dep" due to error java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
at weblogic.application.utils.annotation.ClassInfoImpl.<init>(ClassInfoImpl.java:41)
at weblogic.application.utils.annotation.ClassfinderClassInfos.polulateOneClassInfo(ClassfinderClassInfos.java:240)
at weblogic.application.utils.annotation.ClassfinderClassInfos.populateClassInfos(ClassfinderClassInfos.java:193)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException
at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
at com.bea.objectweb.asm.ClassReader.<init>(Unknown Source)
at weblogic.application.utils.annotation.ClassInfoImpl.<init>(ClassInfoImpl.java:41)
at weblogic.application.utils.annotation.ClassfinderClassInfos.polulateOneClassInfo(ClassfinderClassInfos.java:240)
at weblogic.application.utils.annotation.ClassfinderClassInfos.populateClassInfos(ClassfinderClassInfos.java:193)
Weblogic version: 12.1.3.0.0 & OpenJDK version "1.8.0_275".
Please help me with troubleshooting this issue. TIA!
That issue happens when you have a class compiled with a newer JDK version, in your case > 1.8
Probably one of your libraries inside Dep.ear has the culprit.
more details:
https://devwebcl.blogspot.com/2019/01/weblogic-log4j2-asm.html
We are try to migrate from Spring 3.1.2 to Spring 4.1.2
After migration, when running tomcat we are facing below exception,
This issue is caused by our spring-jms dependency.
As per my knowledge, this class "MappingJacksonMessageConverter" is available only in spring 3, in spring 4 the class is MappingJackson2MessageConverter.
I'm not sure which part of spring code is loading this class MappingJacksonMessageConverter.
java.lang.NoClassDefFoundError: org/springframework/jms/support/converter/MappingJacksonMessageConverter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3116)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1344)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1825)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
at org.springframework.core.type.classreading.AnnotationReadingVisitorUtils.convertClassValues(AnnotationReadingVisitorUtils.java:73)
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:134)
at org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor.getAnnotationAttributes(AnnotationMetadataReadingVisitor.java:49)
at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:280)
at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:276)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:263)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:231)
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:509)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:277)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:231)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:190)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:173)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:321)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:674)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:519)
at com.walmart.platform.config.PlatformContextLoaderListener.configureAndRefreshWebApplicationContext(PlatformContextLoaderListener.java:64)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at com.walmart.platform.config.PlatformContextLoaderListener.contextInitialized(PlatformContextLoaderListener.java:74)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.jms.support.converter.MappingJacksonMessageConverter
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
... 38 more
Maybe you have a wrong version of some dependencies, maybe they are not migrated, so you have to see the dependencies table of the Spring 4.1.2 in the maven central, this table contains the lowest version compatible with the Spring version you want.
I have developed an app and now am trying to deployed it on Tomcat. when I start start.bat file in Tomcat directory. My console doesn't display any errors and when I open log files, I see this error:
java.lang.ClassNotFoundException: com.sun.xmk.ws.transport.http.servlet.WSServletContextListener
On many forums people say that I didn't add jaxws-rt.jar lib. But I have added it. First I added it as a dependency in maven. After that I deleted the dependency and downloaded the library from official site and added it to my lib folder. This too didn't help. So how can I fix this error?
UPDATE
full stacktrace
SEVERE: Error configuring application listener of class
com.sun.xmk.ws.transport.http.servlet.WSServletContextListener
java.lang.ClassNotFoundException: com.sun.xmk.ws.transport.http.servlet.WSServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
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)
Instead of putting the jars in your app's WEB-INF/lib dir, put it under the lib dir under Tomcat install directory. That should fix the error.
Our project is in Jetty server and work completely then this project is deployed in Jboss 7 server, but there are some errors.
I make war file and copy and past in E:\jboss-as-7.1.1.Final\standalone\deployments folder and auto-deploy become start and give this error :
java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
but in \WEB-INF\lib I have mail.jar file ..
So how to remove this error?
Detail Error :
15:34:02,245 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-4) Context initialization failed: org.springframework.beans.factor
y.BeanCreationException: Error creating bean with name 'log4jInitialization' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocati
on of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) [org.s
pringframework.beans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [org.spri
ngframework.beans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.spring
framework.beans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [org.springframework.beans-3.1.0.M1.jar:
3.1.0.M1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [org.springframework.
beans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [org.springframework.beans-3.1.0.M1.jar:3.
1.0.M1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [org.springframework.beans-3.1.0.M1.jar:3.1.
0.M1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563) [org.springfr
amework.beans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:900) [org.springf
ramework.context-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:455) [org.springframework.context-3.1.0.M
1.jar:3.1.0.M1]
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:294) [org.springframework.web-3.1.0.M1.jar:3.1.0.M1
]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:215) [org.springframework.web-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [org.springframework.web-3.1.0.M1.jar:3.
1.0.M1]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_01]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_01]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]
Caused by: java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_01]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) [rt.jar:1.7.0_01]
at java.lang.Class.getConstructor0(Class.java:2714) [rt.jar:1.7.0_01]
at java.lang.Class.newInstance0(Class.java:343) [rt.jar:1.7.0_01]
at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.7.0_01]
at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:336) [log4j-1.2.16.jar:]
at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:123) [log4j-1.2.16.jar:]
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:752) [log4j-1.2.16.jar:]
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735) [log4j-1.2.16.jar:]
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615) [log4j-1.2.16.jar:]
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502) [log4j-1.2.16.jar:]
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547) [log4j-1.2.16.jar:]
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:415) [log4j-1.2.16.jar:]
at org.springframework.util.Log4jConfigurer.initLogging(Log4jConfigurer.java:72) [org.springframework.core-3.1.0.M1.jar:3.1.0.M1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_01]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_01]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_01]
at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_01]
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273) [org.springframework.core-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.config.MethodInvokingFactoryBean.doInvoke(MethodInvokingFactoryBean.java:162) [org.springframework.beans-3.1.0
.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:152) [org.springframework.b
eans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479) [or
g.springframework.beans-3.1.0.M1.jar:3.1.0.M1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) [org.s
pringframework.beans-3.1.0.M1.jar:3.1.0.M1]
... 20 more
Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressException from [Module "org.apache.log4j:main" from local module loader #1da817b (r
oots: E:\jboss-as-7.1.1.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 43 more
So please help , how to remove this error ?
Thanks,
kamlesh
JBoss AS 7 comes with isolated class-loading, so you should carefully configure your project dependencies. Details are here.
In your case I see that Spring refers to Log4j, which is provided by JBossAS: Module "org.apache.log4j:main", and tries to configure it to do something unusual (possibly, tries to make logging go over e-mail). The problem is that mail-api is not accessible to log4j module, so it complains.
Now you have at least 3 solutions:
Make Spring just use log4j without trying to configure it. Instead configure log4j at app-server level. See this. Ask Spring experts how to do it :)
Put log4j.jar in your /WEB-INF/lib and do not expose Module "org.apache.log4j" to your webapp.
Expose mail-api to log4j module and delete /WEB-INF/lib/mail.jar from you app. You will have to edit jboss-as-7.1.1.Final/modules/org/apache/log4j/main/module.xml to include a dependency on mail-api:
<dependencies>
<module name="org.dom4j" optional="true"/>
<module name="javax.api"/>
<module name="javax.mail.api" export="true"/>
</dependencies>
I am unable to create a Web Service Client in my NetBeans Web Application when xercesImpl.jar is included as a library.
Using NetBeans 6.9 and GlassFish 3.0.1:
1.) Create new Web Application
2.) Create a new Web Service
3.) Add a new operation to the created web service (just let it return null - the implementation isn't important)
4.) Deploy web service to GlassFish (works fine)
5.) Add xercesImpl.jar (I'm using version 2.9.1) as a library to the web service (I need xerces for a third-party library that I'm using)
6.) Stop Glassfish.
7.) Clean and Build the project.
8.) Run the project. Test that the Web Service still works (it does).
9.) Create a new Web Service Client. Point it at a WSDL (I'm using http://www.webservicex.com/CurrencyConvertor.asmx?wsdl just as a test).
10.) Stop Glassfish.
11.) Clean and Build the project.
Error message is shown:
C:\NetBeansProjects\WSTest\nbproject\jaxws-build.xml:43:
Error starting wsimport: BUILD FAILED
(total time: 1 second)
Line 43 is:
<wsimport sourcedestdir="${build.generated.dir}/jax-wsCache/CurrencyConvertor"
destdir="${build.generated.dir}/jax-wsCache/CurrencyConvertor" wsdl=
"${basedir}/${conf-dir}xml-resources/web-service-references/
CurrencyConvertor/wsdl/www.webservicex.com/CurrencyConvertor.asmx.wsdl"
catalog="catalog.xml" extension="true" verbose="true"
wsdlLocation="http://www.webservicex.com/CurrencyConvertor.asmx?wsdl"
xnocompile="true" xendorsed="true">
12.) Restart NetBeans.
13.) Clean and Build the project. (The build now works)
14.) Run the project. GlassFish starts up fine except for this one-line error message:
SEVERE: Error in resolving the catalog
15.) Loading the Web Service Tester page produces the following exception in the GlassFish log:
WARNING: Servlet web service endpoint 'NewWebService' failure
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2085)
at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1018)
at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1255)
at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:238)
at com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog(Catalog.java:680)
at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:270)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:405)
at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:264)
at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:99)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
WARNING: StandardWrapperValve[NewWebService]: PWC1382: Allocate exception for servlet NewWebService
javax.servlet.ServletException
at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:271)
at org.glassfish.webservices.JAXWSServlet.init(JAXWSServlet.java:99)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1060)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2085)
at org.glassfish.web.loader.WebappClassLoader.findResource(WebappClassLoader.java:1018)
at org.glassfish.web.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1255)
at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
at com.sun.org.apache.xml.internal.resolver.readers.SAXCatalogReader.readCatalog(SAXCatalogReader.java:238)
at com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog(Catalog.java:680)
at com.sun.xml.ws.util.xml.XmlUtil.createEntityResolver(XmlUtil.java:270)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at org.glassfish.webservices.JAXWSServlet.registerEndpoint(JAXWSServlet.java:405)
at org.glassfish.webservices.JAXWSServlet.doInit(JAXWSServlet.java:264)
... 26 more
Any ideas on what I can do to fix this? Note that it only happens after I create a new Web Service Client/Reference. Even if someone could suggest which project I should be creating a bug against (i.e. is it a NetBeans fault? A Glassfish fault? A JAX-WS fault? etc.), that would be good.
Well I've finally found a solution:
http://forums.java.net/jive/thread.jspa?threadID=59445
What I needed to do was to remove these files from the xercesImpl.jar file:
META-INF/services/javax.xml.parsers.DocumentBuilderFactory
META-INF/services/javax.xml.parsers.SAXParserFactory
When the modified JAR file is included in my project it no longer causes any issues.
If anyone has a neater solution, please let me know.
I found the solution for my problem which is similar with yours.
I added inside my jar the following file:
META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration
The content of this file is just :
org.apache.xerces.parsers.XML11Configuration
Regards.