I have an application with JAX-WS client.
<jaxws:client name="http://XXXXXX"
wsdlLocation="YYYYY.wsdl"
createdFromAPI="true">
<jaxws:properties>
<entry key="ws-security.sts.client" value-ref="ZZZZZZZ" />
</jaxws:properties>
</jaxws:client>
When the application is started during the webservice downtime, the spring context fails and the application doesn't start at all.
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [XXXX]: Constructor threw exception; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'https://YYYYY.wsdl'.: java.net.UnknownHostException: YYYYY
Caused by: java.net.UnknownHostException: YYYYY
How to configure the application in such a way that it starts and the spring config doesn't fail.
I understand that the web service client won't work as long as the web service is down.
I need the application to start and use the web service once it is available.
You can put WSDL file to your classpath and locate it in wsdlLocation.
Like wsdlLocation="yyyyy.wsdl"
Or you can handle it programatically. Details here
Related
Hi i have a javaEE application with wildfly server i use the library jasypt to encrypt password and at the time to run my server app it throws me this jasypt.StrongPasswordEncryptor class not found exception and other exceptions, any ideas of what is this exception caused by? here's the
server output:
18:51:59,300 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."ProyectoServidor.ear"."ProyectoEJB-ejb.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."ProyectoServidor.ear"."ProyectoEJB-ejb.jar".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment "ProyectoEJB-ejb.jar" of deployment "ProyectoServidor.ear"
at org.jboss.as.server#18.1.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
at org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.fannog.proyectoservidor.utils.Encryptor with ClassLoader ModuleClassLoader for Module "deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar" from Service Module Loader
at org.jboss.as.server#18.1.0.Final//org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
at org.jboss.as.server#18.1.0.Final//org.jboss.as.server.deployment.reflect.ClassReflectionIndexUtil.findMethod(ClassReflectionIndexUtil.java:57)
at org.jboss.as.ejb3#26.1.0.Final//org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorMethodProcessor.handleStatelessSessionBean(DeploymentDescriptorMethodProcessor.java:99)
at org.jboss.as.ejb3#26.1.0.Final//org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorMethodProcessor.deploy(DeploymentDescriptorMethodProcessor.java:76)
at org.jboss.as.server#18.1.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
... 8 more
Caused by: java.lang.NoClassDefFoundError: org/jasypt/util/password/StrongPasswordEncryptor
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3297)
at java.base/java.lang.Class.getDeclaredFields(Class.java:2371)
at org.jboss.as.server#18.1.0.Final//org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
at org.jboss.as.server#18.1.0.Final//org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
... 12 more
Caused by: java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module "deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 17 more
Here is the wildfly server configuration (Standalone.xml) im using wildfly server wildfly-26.1.0.Final version
LINK: https://docs.google.com/document/d/1jBfLbo2Wm-3M8gR5Xw65zNyPBTQv-EynkvWb4gwVkQ4/edit?usp=sharing
I'm getting following exception in a project using OpenFeign. Please suggest how to resolve this issue.
Exception is given below:
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.seamless.ers.links.kyc.client.CustomerDetailsClient': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.openfeign.FeignClientFactoryBean] from ClassLoader [sun.misc.Launcher$AppClassLoader#18b4aac2]
at
...
Caused by: java.lang.ClassNotFoundException: feign.Feign$Builder
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_301]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_301]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_301]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_301]
... 25 common frames omitted
Below are the dependencies added:
spring-cloud-starter
spring-cloud-openfeign-core
spring-boot-starter-test
spring-boot-starter-web
Most famous class loading exception and indicates that compiler have difficulties to detect proper dependent class i.e provided the dependency at runtime, following are most healer to issue
Check the version and probably duplication of your maven artifact for spring-cloud-starter - spring-cloud-openfeign-core if you are not using spring boot parent and if the artifacts imported properly from firtplace,
Check the scope of the dependencies, for the current case in hand the will be provided to compile <scope>provided</scope>
Exclude the duplicate dependencies that they provide spring feign as transparent dependency .
I need to upload my web project to Wildfly 11. The first time I tried to upload my project without external libraries and it worked correctly, but when I add new libraries it no longer allows me to upload in wildfly 11. the project runs fine if I run it as java in the Eclipse IDE.I generated war with export project in eclipse, the error that comes out is the following.
21:22:43,137 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."ApiPolizaApesegTest.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ApiPolizaApesegTest.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "ApiPolizaApesegTest.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
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.RuntimeException: WFLYSRV0177: Error getting reflective information for class imp.ws.soatcimtc.rimac.soap.SOAPImpl with ClassLoader ModuleClassLoader for Module "deployment.ApiPolizaApesegTest.war" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
Caused by: java.lang.NoClassDefFoundError: com/amazonaws/Request
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
... 10 more
Caused by: java.lang.ClassNotFoundException: com.amazonaws.Request from [Module "deployment.ApiPolizaApesegTest.war" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 15 more
21:22:43,142 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 6) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "ApiPolizaApesegTest.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"ApiPolizaApesegTest.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"ApiPolizaApesegTest.war\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class imp.ws.soatcimtc.rimac.soap.SOAPImpl with ClassLoader ModuleClassLoader for Module \"deployment.ApiPolizaApesegTest.war\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: com/amazonaws/Request
Caused by: java.lang.ClassNotFoundException: com.amazonaws.Request from [Module \"deployment.ApiPolizaApesegTest.war\" from Service Module Loader]"}}
21:22:43,144 ERROR [org.jboss.as.server] (External Management Request Threads -- 6) WFLYSRV0021: Deploy of deployment "ApiPolizaApesegTest.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"ApiPolizaApesegTest.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"ApiPolizaApesegTest.war\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class imp.ws.soatcimtc.rimac.soap.SOAPImpl with ClassLoader ModuleClassLoader for Module \"deployment.ApiPolizaApesegTest.war\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: com/amazonaws/Request
Caused by: java.lang.ClassNotFoundException: com.amazonaws.Request from [Module \"deployment.ApiPolizaApesegTest.war\" from Service Module Loader]"}}
I think that I might not recognize the external libraries, I add the libraries by jar
You need to package your "external libraries" into your war and redeploy the application using the new war.
Also WildFly 11 is quite old, I would recommend to upgrade to WildFly 23.
I am deploying an ear file in web logic .
This ear file is a RMI client and uses some 3rd party jars .
These 3rd party jars need the following properties :
System.setProperty("java.naming.provider.url", "localhost:1099");
System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
The problem with these properties is that these mess up weblogic admin console.
The console no longer is accessible once the above two properties get fired .
when I try to access weblogic console after these properties are set I get the following exception :
<24/05/2019 5:23:34 PM EST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: java.io.IOException: Unable to create InitialContext: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
at weblogic.management.remote.wlx.ClientProvider.findRMIServer(ClientProvider.java:126)
at weblogic.management.remote.wlx.ClientProvider.newJMXConnector(ClientProvider.java:103)
at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:369)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:267)
at com.bea.console.utils.MBeanUtils.lookupMBeanServerConnection(MBeanUtils.java:3658)
at com.bea.console.utils.MBeanUtils.getDomainRuntimeMBeanServerConnection(MBeanUtils.java:1840)
at com.bea.console.utils.MBeanUtils.getDomainRuntimeServiceMBean(MBeanUtils.java:1916)
at com.bea.console.utils.MBeanUtilsInitializer.initMBeanUtils(MBeanUtilsInitializer.java:70)
at com.bea.console.utils.MBeanUtilsInitializer.access$000(MBeanUtilsInitializer.java:20)
at com.bea.console.utils.MBeanUtilsInitializer$1.run(MBeanUtilsInitializer.java:49)
at weblogic.work.ContextWrap.run(ContextWrap.java:40)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:548)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
at weblogic.management.remote.wlx.ClientProvider.findRMIServer(ClientProvider.java:124)
... 13 more
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:357)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:318)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:80)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:186)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:50)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
... 17 more
>
<24/05/2019 5:23:34 PM EST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: Error when initilize JMX connection>
<24/05/2019 5:23:37 PM EST> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: java.io.IOException: Unable to create InitialContext: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
at weblogic.management.remote.wlx.ClientProvider.findRMIServer(ClientProvider.java:126)
at weblogic.management.remote.wlx.ClientProvider.newJMXConnector(ClientProvider.java:103)
at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:369)
so clearly setting properties at System level is not a good idea and it is messing up web logic .
Since these properties are being used by 3rd party jars ( code which I cannot change ) how do I provide these properties to the jars without impacting web logic?
essentially these properties should be set specific to my application without interfering with web logic.
I wrote a spring boot application which was working fine without any issues. Then I changed pom and added activator class and make it a Felix OSGI bundle. Then I was able to install it with Felix console as well.
But when I start it with Felix controller, I was getting following error,
g! start 21
org.osgi.framework.BundleException: Activator start error in bundle company.iot.devops [21].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.gogo.command.Basic.start(Basic.java:739)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
at company.iot.devops.IOTMain.main(IOTMain.java:10)
at company.iot.devops.osgi.Activator.start(Activator.java:35)
Then I tried with
<Embed-Dependency>!company*;*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
In the POM and resolved that issue. But now I am getting different issue,
16:51:03.914 [Gogo shell] ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [company.iot.devops.IOTMain]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:182)
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:678)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataRea
....
org.osgi.framework.BundleException: Activator start error in bundle company.iot.devops [42].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2276)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
....
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/EnableAutoConfigurationImportSelector.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50)
I can see jar file spring-boot-autoconfigure-1.3.5.RELEASE.jar in the bundle and it reffered from "Embedded-Artifacts" in the MANIFEST.MF as well.
Not sure why Spring boot can't find this class.
Thanks