Hi am upgrading hazelcast from 3.6.5 to 3.7.4 followed the instructions from hazelcast doc.
am getting an exception like:
java.lang.ClassCastException: com.hazelcast.spi.impl.UnmodifiableLazyList cannot be cast to java.util.ArrayList
i just upgraded hazelcast jar do i need to do any other jar upgrade?
stacktrace follows:
2017-01-24 11:33:44 ERROR error:162 - Exception occurred in class com.rathish.test.services.authentication.impl.LocalClient the exception details are: Exception:
[errorCode = 504,
errorMessage = Failure - Unable to retrieve entity from database
Detailed exception trace =
java.lang.ClassCastException: com.hazelcast.spi.impl.UnmodifiableLazyList cannot be cast to java.util.ArrayList
at com.rathish.test.services.authentication.dao.RoleDao.getRoleByUserId(RoleDao.java:367)
at com.rathish.test.services.authentication.impl.LocalClient.authorizeCredentials(LocalClient.java:108)
at com.rathish.test.services.authentication.AuthValidation.validateAuthorization(AuthValidation.java:420)
at com.rathish.test.services.authentication.AuthValidation.loginValidation(AuthValidation.java:104)
at com.rathish.test.services.authentication.AuthenticationService.login(AuthenticationService.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:141)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.process(ProxyServlet.java:74)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.doFilter(ProxyServlet.java:291)
at org.eclipse.equinox.servletbridge.BridgeServlet.process(BridgeServlet.java:149)
at org.eclipse.equinox.servletbridge.BridgeFilter.doFilter(BridgeFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.rathish.test.web.filter.SessionValidationFilter.doFilter(SessionValidationFilter.java:105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: com.hazelcast.spi.impl.UnmodifiableLazyList cannot be cast to java.util.ArrayList
at com.rathish.test.services.authentication.dao.RoleDao.getRoleByUserId(RoleDao.java:367)
... 56 more
using along with maven
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>3.7.4</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-client</artifactId>
<version>3.7.4</version>
</dependency>
Based entirely on your stacktrace, your RoleDao class on line 367 is something like the following (variable and method names are entirely arbitrary):
ArrayList<Baz> foo = (ArrayList<Baz>)hazelCast.findById(bar);
This presumably worked before since the actual type returned was ArrayList. However it has since changed to UnmodifiableLazyList.
Solution is to always program to interfaces, and change the code to
List<Baz> foo = hazelCast.findById(bar);
(or Collection<Baz>, depending on what the API states as the return type).
Are you sure it used to work in 3.6.x?
I'm looking at the history in github and it always used to extend the java.util.AbstractList like this:
public class UnmodifiableLazyList<E> extends AbstractList<E> implements DataSerializable {
So it never used to extend ArrayList
Related
How can I properly add external .jar to libraries is NetBeans 8.2?
I'm doing a web application made using .jsp files, run on Tomcat server (locally so far). I'm using Maven and I think I have a problem with all 3rd party JARs, because I tried also adding JSON libraries and it didn't work neither. I also tried adding those libraries via Tools->Libraries->Add JAR/Folder etc. and NetBeans shows they are added, but the error still occures during instantiating the ojdbc driver in my Java code.
The way I'm doing it using other answers in similiar question don't work for me and I reveive errors:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.mycompany.project1.ConnectionToOracle.getConnection(ConnectionToOracle.java:47)
at org.apache.jsp.mainPage_jsp._jspService(mainPage_jsp.java:151)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
In case someone could struggle with this like me...
Just remember to add dependency to your pom.xml file (it is not mentioned in answers to other questions on StackOverflow):
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>{your numer of ojdbc6 version}</version>
</dependency>
I have use guacamole for three years, begin at 0.9.13.
extensions contain "auth-jdbc-mysql" and "auth-cas"
I had an upgrade to 1.1.0 and all work right,but when I update to 1.2.0, It can't work, if I use MySQL to auth, it also works well, but use cas1.2, I get a whiteboard at login, so I check the logs, The error is as follows(from logs/localhost.2020-11-24.log), I don't know Java, It may be very easy, help me thanks. if I replace use cas1.1 replace cas1.2 and the others remain unchanged
it also works well
24-Nov-2020 01:20:32.804 SEVERE [http-nio-8080-exec-7] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [default] in context with path [] threw exception
java.lang.NullPointerException
at java.io.SequenceInputStream.nextStream(SequenceInputStream.java:112)
at java.io.SequenceInputStream.read(SequenceInputStream.java:211)
at java.io.InputStream.read(InputStream.java:101)
at org.apache.guacamole.resource.ResourceServlet.doGet(ResourceServlet.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
When the common redirect field was implemented in 1.2.0, several components were left in the CAS module that are causing errors trying to download the app.js file when the module is enabled.
https://issues.apache.org/jira/browse/GUACAMOLE-1120
Does anyone know what is the issue with this exception.
I get the error just exactly when I call the method jws.getCompactSerialization();
I downloaded the jose4j-0.5.2. I added this library to Build Path and Deployment Assembly and I copied the jar in the WEB-INF folder.
I'm not using Servlet or any other framework like Spring. Just Jersey 2.23.2, Moxy 2.23.2 and java_json_1.0. I don't use jackson.
These are is my claims
JwtClaims claims = new JwtClaims();
claims.setIssuer("demo.com");
claims.setExpirationTimeMinutesInTheFuture(10);
claims.setGeneratedJwtId();
claims.setIssuedAtToNow();
claims.setNotBeforeMinutesInThePast(2);
claims.setSubject("username");
Then the signature
JsonWebSignature jws = new JsonWebSignature();
jws.setPayload(claims.toJson());
jws.setKeyIdHeaderValue(senderJwk.getKeyId());
jws.setKey(senderJwk.getPrivateKey());
jws.setAlgorithmHeaderValue(AlgorithmIdentifiers.RSA_USING_SHA256);
Then immediately I call the method
jwt = jws.getCompactSerialization();
I cleaned my server, published and applied Run again.
The first error I get is
java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
I didn't download it and I don't use slf4j logger, so right after I the method is called I got the exception. Does the jose library need the slf4j library???
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Demo Service] in context with path [/Demo] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory] with root cause
java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1313)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1164)
at org.jose4j.jwa.AlgorithmFactoryFactory.<clinit>(AlgorithmFactoryFactory.java:34)
at org.jose4j.jws.JsonWebSignature.getAlgorithm(JsonWebSignature.java:140)
at org.jose4j.jws.JsonWebSignature.sign(JsonWebSignature.java:94)
at org.jose4j.jws.JsonWebSignature.getCompactSerialization(JsonWebSignature.java:73)
at com.demo.service.AuthenticationService(AuthenticationService.java:82)
at com.demo.rest.AuthenticationController.authenticate(AuthenticationController.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Then if I try to run it again I don't get the error slf4j. Now directly to this error without pointing to slf4j.???
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Demo Service] in context with path [/Demo] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.jose4j.jwa.AlgorithmFactoryFactory] with root cause
java.lang.NoClassDefFoundError: Could not initialize class org.jose4j.jwa.AlgorithmFactoryFactory
at org.jose4j.jws.JsonWebSignature.getAlgorithm(JsonWebSignature.java:140)
at org.jose4j.jws.JsonWebSignature.sign(JsonWebSignature.java:94)
at org.jose4j.jws.JsonWebSignature.getCompactSerialization(JsonWebSignature.java:73)
at com.demo.service.AuthenticationService(AuthenticationService.java:82)
at com.demo.rest.AuthenticationController.authenticate(AuthenticationController.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Is it possible that Tomcat is caching something or what library am I missing?
MY APOLOGIES!!!
I needed the slf4j *.jar
So I added it to my project and it worked.
Jose4j Website
Dependencies
Jose4j is compiled with/for Java 7 and will also run on Java 8.
The jose.4.j library relies on the Simple Logging Facade for Java (SLF4J). Prior to v0.4.4 Appache Commons Logging was used.
As of v0.3.7 jose4j's JSON processing was derived from the JSON.simple toolkit and Base64 encoding/decoding was derived from the Apache Commons Codec project.
I have startet multiple Identical Apps in Tomcat (They display different content but the code is the same). These Apps use Hibernate and ehcache.
The Problem is: A singel Application works as expected. but adding a second one will make everything crash with nullpointerexception.
The configuration is:
// Caching
cfg.setProperty("hibernate.cache.use_second_level_cache", "true");
cfg.setProperty("hibernate.cache.provider_class", "org.hibernate.cache.EhCacheProvider");
cfg.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory");
cfg.setProperty("net.sf.ehcache.configurationResourceName", "com/gfop/util/hibernate/ehcache.xml");
// Query Caching
cfg.setProperty("hibernate.cache.use_query_cache", "true");
cfg.setProperty("hibernate.c3p0.statementCacheNumDeferredCloseThreads", "1");
This is the Stacktrace:
2016-06-28 17:57:31,766 [http-nio-8080-exec-6] ERROR myGroup.sv.hibernate.HibernateDBServerInstance.getSessionFactory(?:?) - Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given; please either disable second level cache or set correct region factory using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given; please either disable second level cache or set correct region factory using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
at org.hibernate.cache.internal.NoCachingRegionFactory.buildEntityRegion(NoCachingRegionFactory.java:83)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:364)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
at myGroup.sv.hibernate.HibernateDBServerInstance.getSessionFactory(Unknown Source)
at myGroup.sv.hibernate.HibernateDBServerInstance.getSystemSession(Unknown Source)
at myGroup.sv.hibernate.HibernateDBServerInstance.getSystemSession(Unknown Source)
at myGroup.sv.hibernate.HibernateService.getSystemSession(Unknown Source)
at myGroup.bwv.service.BwvMandantService.getList(Unknown Source)
at myGroup.bwv.bean.ApplicationBean.getMandantenList(Unknown Source)
at myGroup.bwv.bean.AusschreibungBean.init(Unknown Source)
at myGroup.bwv.bean.AusschreibungBean.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider.newInstance(Tomcat7AnnotationLifecycleProvider.java:54)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:162)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:303)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:266)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:66)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:65)
at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:96)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:66)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:80)
at org.apache.el.parser.AstValue.getValue(AstValue.java:137)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:115)
at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:243)
at javax.faces.component.UIData.getValue(UIData.java:1153)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.createDataModel(HtmlDataTableHack.java:957)
at org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.createDataModel(AbstractHtmlDataTable.java:1605)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getDataModel(HtmlDataTableHack.java:932)
at org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.getDataModel(AbstractHtmlDataTable.java:1597)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getRowCount(HtmlDataTableHack.java:103)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:366)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:214)
at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:366)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:488)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:609)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:370)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:194)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:618)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.actuallyRenderView(JspViewDeclarationLanguageBase.java:322)
at org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.renderView(JspViewDeclarationLanguageBase.java:181)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at org.apache.myfaces.tomahawk.application.ResourceViewHandlerWrapper.renderView(ResourceViewHandlerWrapper.java:169)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
2016-06-28 17:57:31,767 [http-nio-8080-exec-6] ERROR myGroup.bwv.bean.ApplicationBean.getMandantenList(?:?) -
java.lang.NullPointerException
at myGroup.sv.hibernate.HibernateDBServerInstance.getSystemSession(Unknown Source)
at myGroup.sv.hibernate.HibernateDBServerInstance.getSystemSession(Unknown Source)
at myGroup.sv.hibernate.HibernateService.getSystemSession(Unknown Source)
at myGroup.bwv.service.BwvMandantService.getList(Unknown Source)
at myGroup.bwv.bean.ApplicationBean.getMandantenList(Unknown Source)
at myGroup.bwv.bean.AusschreibungBean.init(Unknown Source)
at myGroup.bwv.bean.AusschreibungBean.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider.newInstance(Tomcat7AnnotationLifecycleProvider.java:54)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:162)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:303)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:266)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:66)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:65)
at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:96)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:66)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:80)
at org.apache.el.parser.AstValue.getValue(AstValue.java:137)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:115)
at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:243)
at javax.faces.component.UIData.getValue(UIData.java:1153)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.createDataModel(HtmlDataTableHack.java:957)
at org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.createDataModel(AbstractHtmlDataTable.java:1605)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getDataModel(HtmlDataTableHack.java:932)
at org.apache.myfaces.component.html.ext.AbstractHtmlDataTable.getDataModel(AbstractHtmlDataTable.java:1597)
at org.apache.myfaces.component.html.ext.HtmlDataTableHack.getRowCount(HtmlDataTableHack.java:103)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:366)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:214)
at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:366)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:488)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:609)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:370)
at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:194)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:618)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.actuallyRenderView(JspViewDeclarationLanguageBase.java:322)
at org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.renderView(JspViewDeclarationLanguageBase.java:181)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
at org.apache.myfaces.tomahawk.application.ResourceViewHandlerWrapper.renderView(ResourceViewHandlerWrapper.java:169)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Have you ever experienced anything like this? Do you know how to solve this?
You use SingletonEhCacheRegionFactory, you should use EhCacheRegionFactory. Now you have only singleton, so you are not able to get different instance, it is singlet :) Change it to EhCacheRegionFactory and it souhl be able to get another instance
I have been working on a web application that generates tests, given uploaded Java files and also tests uploaded code against said generated tests. I have been using Evosuite to generate the tests without a problem. However I have just updated to the latest release (1.0.3) and I am now getting the following error when running the generated tests:
initializationError(PackOfCrisps_ESTest)
java.lang.ClassNotFoundException: Class 'PackOfCrisps_ESTest.class' should be in target project, but could not be found!
at org.evosuite.runtime.instrumentation.EvoClassLoader.instrumentClass(EvoClassLoader.java:125)
at org.evosuite.runtime.instrumentation.EvoClassLoader.loadClass(EvoClassLoader.java:91)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.evosuite.runtime.EvoRunner.getFromEvoSuiteClassloader(EvoRunner.java:139)
at org.evosuite.runtime.EvoRunner.getClass(EvoRunner.java:92)
at org.evosuite.runtime.EvoRunner.<init>(EvoRunner.java:72)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runner.Computer.getRunner(Computer.java:40)
at org.junit.runner.Computer$1.runnerForClass(Computer.java:31)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101)
at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87)
at org.junit.runners.Suite.<init>(Suite.java:81)
at org.junit.runner.Computer.getSuite(Computer.java:28)
at org.junit.runner.Request.classes(Request.java:75)
at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:62)
at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at finalYearProject.assignmentManager.util.Marker.setupEnvironment(Marker.java:142)
at finalYearProject.assignmentManager.util.Marker.runTests(Marker.java:353)
at finalYearProject.assignmentManager.util.Marker.<init>(Marker.java:39)
at finalYearProject.assignmentManager.Submissions.doPost(Submissions.java:150)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1517)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1474)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
To run the tests I am creating a new classloader that contains the URL to the directory where the files to be tested along with generated tests from Evosuite are placed.
My application was working successfully before I updated Evosuite but I would like to continue using this new version as the additional features are useful for my project. There may have been a subtle change that I am unaware of so any help would be very much appreciated.
yes, there was a subtle change in 1.0.3, particularly in the EvoRunner class used to run the tests. To do instrumentation, there are 2 methods: with Java Agent, and with custom classloader. Before the default was Java Agent, but now we use the custom classloader (long story...).
I guess there are some side effects with yours "I am creating a new classloader", if that is different from the one used to load the ES code itself.
A quick check is to set to false separateClassLoader in:
#RunWith(EvoRunner.class) #EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
if you run ES from command line, you can try the option -Duse_separate_classloader=false