java.lang.ClassNotFoundException: javax.sql.rowset.RowSetProvider - java

I'm running a Gradle project in Docker and when I try to hit an endpoint through Postman I receive the following error. When I run it locally through Gradle it works fine and I can hit the endpoint no problem.
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax.sql.rowset.RowSetProvider] with root cause
java.lang.ClassNotFoundException: javax.sql.rowset.RowSetProvider
I've tried adding the Gradle dependency implementation 'javax.sql:rowset:1.0.1' but had no success as it throws a Gradle build error Could not find javax.sql.rowset:com.springsource.javax.sql.rowset:1.0.1.

Related

JAVA -Getting "Error 500: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet" while accessing swagger UI

refer this screenshot to see error** Java - Error 500: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet**
Getting this error while accessing the swagger UI. Earlier it was working fine but after upgrading Jackson-databind.jar along with its dependencies Jackson core and Jackson annotation jars from 2.10.5 to 2.13.4(also tried with versions 2.13.2.1 and 2.13.2.2)after this change unable to access swagger UI.
(I have installed my build using ocp setup so, there all the pods are up and running)
swagger jar version= 1.5.16
Logs:
[10/2/22 22:51:25:961 GMT] 00000041 com.ibm.ws.webcontainer.webapp E SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5117)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:316)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:281)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1184)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:453)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:412)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:566)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:500)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:360)
at com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete(HttpICLReadCallback.java:70)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:514)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:584)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:968)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1057)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:822)
Caused by: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:368)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:601)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:193)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:98)
at com.ibm.cdb.api.rest.config.RespHeaderAddFilter.doFilter(RespHeaderAddFilter.java:48)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:1002)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1140)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5059)
... 18 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJAXRSServerFactoryBean---1032362584': Invocation of init method failed; nested exception is java.util.ServiceConfigurationError: io.swagger.jaxrs.ext.SwaggerExtension: Provider org.apache.cxf.jaxrs.swagger.JaxRs2Extension could not be instantiated
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org
The swagger version was incompatible with Jackson-databind(2.13.2.1). So, updated the swagger version too.

Error creating bean with name 'armeriaServer' defined in com.linecorp.armeria.spring.ArmeriaAutoConfiguration

as I wanted to install a zipkin server I got this error message.
I just followed the quickstart of the zipkin website.
Here is the exception code:
2021-06-21 11:49:10.858 WARN [/] 43208 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'armeriaServer' defined in com.linecorp.armeria.spring.ArmeriaAutoConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.linecorp.armeria.server.Server]: Factory method 'armeriaServer' threw exception; nested exception is java.util.concurrent.CompletionException: java.lang.IllegalStateException: Armeria server failed to start
2021-06-21 11:49:10.867 INFO [/] 43208 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-06-21 11:49:10.897 ERROR [/] 43208 --- [ main] o.s.b.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'armeriaServer' defined in com.linecorp.armeria.spring.ArmeriaAutoConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.linecorp.armeria.server.Server]: Factory method 'armeriaServer' threw exception; nested exception is java.util.concurrent.CompletionException: java.lang.IllegalStateException: Armeria server failed to start
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.2.jar!/:5.3.2]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.2.jar!/:5.3.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.3.2.jar!/:5.3.2]
Thank you for helping,
Kind regards
I got the same error. That was due to incomplete installation in my case. I had zipkin already downloaded and ran $ curl -sSL https://zipkin.io/quickstart.sh | bash -s again but I stopped it in between.
Just deleting all the files and re downloading again solved my problem.
To download:
$ curl -sSL https://zipkin.io/quickstart.sh | bash -s
Run the jar now:
$ java -jar zipkin.jar
Another possible reasons:
If you have zipkin-dependencies jar installed, make sure both zipkin jar and zipkin-dependencies jar are of same version.
If you are trying to store traces in elastic search and getting this error:
then in elasticsearch.yml (ELASTICSEARCH_HOME > config > elasticsearch.yml), add this line action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml* this basically allows zipkin to create indices automatically in elasticsearch.

Unsatisfied link error for libvirt

I am trying to connect kvm through java using the code present at
https://libvirt.org/java.html
When I try to connect i receive the below error
2016-04-23 21:18:17.960 ERROR 6359 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory] with root cause
java.lang.UnsatisfiedLinkError: Unable to load library 'virt': libvirt.so: cannot open shared object file: No such file or directory
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166) ~[jna-3.3.0.jar!/:3.3.0 (b0)]
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239) ~[jna-3.3.0.jar!/:3.3.0 (b0)]
at com.sun.jna.Library$Handler.<init>(Library.java:140) ~[jna-3.3.0.jar!/:3.3.0 (b0)]
at com.sun.jna.Native.loadLibrary(Native.java:393) ~[jna-3.3.0.jar!/:3.3.0
I have libvirt installed on ubuntu
libvirtd --version
libvirtd (libvirt) 1.2.2
And my build.gradle is
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.libvirt:libvirt:0.5.1')
compile('net.java.dev.jna:jna:3.3.0')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Has anyone faced similar issue.
since you are on linux this exception is thrown when your application attempts to load a native library like .so.in this case JVM is looking in both the PATH environment variable and the java.library.path system property.
.to fix this exception you need to set path for that library u are trying to load. just like you set path for java.

Error OracleAS and Hibernate

I have an application that use Spring and Hibernate.
Originally, I thought that this application would deployed on Tomcat, but, by requirements of customer, now I need deploy on Oracle AS 10g.
First, appear me the famous error:
XML-24509: (Error) Definición duplicada para: 'xxx',
and I solved with this, I put this on VM of the Server:
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
but now I have the following error:
/Users/hlopez/SPRING/sts-3.1.0.RELEASE/plugins/org.eclipse.jst.server.generic.oc4j_1.5.206.v20090812/buildfiles/oracle.10.1.3.xml:74: Deploy error: Operation failed with error:
Error creating bean with name 'analyzerConfigDAOImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/spring/mvc/servlet-context.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
I read about this, and a lot of people typed that, this error is caused for some .jars of hibernate,
I removed the hibernate-jpa-2.0-api-1.0.1.Final, but this caused more errors,
I have these .jars on my server:
adf-connections.jar
adfmtl.jar
adfui.jar
​dc-adapters.jar
adfbinding.jar
​adfcm.jar
​adfm.jar
adfmweb.jar
adfshare.jar
​bc4jct.jar
​bc4jctejb.jar
​bc4jdomorcl.jar
​bc4jimdomains.jar
​bc4jmt.jar
​bc4jmtejb.jar
​collections.jar
​commons-cli-1.0.jar
jdev-cm.jar
​ojmisc.jar
​regexp.jar
​share.jar
​xmlef.jar
​xsqlserializers.jar
concurrent.jar
mdsrt.jar
ordhttp.jar
ordim.jar
Help please, Thanks.

I have changed the scope of my maven dependencies to provided

I have changed the scope of my maven dependencies to provided and manually copied to tomcat/lib (to reduce my war file size).
My app now fails to deploy with a dreaded out of memory error.
java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-3
It is a java/spring/hibernate app. Two itneresting errors on stacktrace
Dec 27, 2012 2:22:37 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [spring] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space] with root cause
java.lang.OutOfMemoryError: PermGen space
followed by
Dec 27, 2012 2:22:38 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [spring] in context with path [] threw exception [java.lang.ClassNotFoundException: org.apache.jsp.jsp.myLogin_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.jsp.myLogin_jsp
This is outside of my IDE, when I run using intellij it works fine ... ?
setting CATALINA_OPTS in my start up script fixes the problem, why ?
Add for example -XX:MaxPermSize=128M JVM parameter, and see what's happening.
There is one interesting of this what you did. It is descrebed here. Shortly, the war would be smaller, but runtime memory consumption would be higher.

Categories

Resources