Hello!
Can you send us a screenshot with the notification as well as jrebel.log and jrebel-intellij.log after reproducing the issue? You can send it to support@zeroturnaround.com
Please add the link to this forum post in your mail.
Hello!
Can you send us a screenshot with the notification as well as jrebel.log and jrebel-intellij.log after reproducing the issue? You can send it to support@zeroturnaround.com
Please add the link to this forum post in your mail.
Wildfly 10.1.0 and JRebel Agent 7.0.14 (201708161539)
Hi:
I have docker with Wildfly and rebel. Used to work fine until a moment when .. it stopped (could be an update).
If I remove JRebel, everything works fine
This is how docker configures jrebel
# Install jRebel
RUN curl http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip -o /tmp/jrebel.zip
RUN unzip /tmp/jrebel.zip -d /opt/jboss/
ENV REBEL_HOME=/opt/jboss/jrebel
ENV JAVA_OPTS=”-agentpath:$REBEL_HOME/lib/libjrebel64.so -Drebel.remoting_plugin=true -Xms256m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m”
# Start WildFly
CMD [“/opt/jboss/wildfly/bin/standalone.sh”, “-b”, “0.0.0.0”, “-bmanagement”, “0.0.0.0”, “–debug”]
Wildfly Logs:
wildfly-experiment | 05:06:03,234 INFO [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 8 (per class), which is derived from the number of CPUs on this host.
wildfly-experiment | 05:06:03,476 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.undertow.listener.default: org.jboss.msc.service.StartException in service jboss.undertow.listener.default: WFLYUT0082: Could not start ‘default’ listener.
wildfly-experiment | at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:153)
wildfly-experiment | at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
wildfly-experiment | at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
wildfly-experiment | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
wildfly-experiment | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
wildfly-experiment | at java.lang.Thread.run(Thread.java:748)
wildfly-experiment | Caused by: java.net.SocketException: Protocol family unavailable
wildfly-experiment | at sun.nio.ch.Net.bind0(Native Method)
wildfly-experiment | at sun.nio.ch.Net.bind(Net.java:433)
wildfly-experiment | at sun.nio.ch.Net.bind(Net.java:425)
wildfly-experiment | at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
wildfly-experiment | at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
wildfly-experiment | at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:190)
wildfly-experiment | at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:243)
wildfly-experiment | at org.wildfly.extension.undertow.HttpListenerService.startListening(HttpListenerService.java:126)
wildfly-experiment | at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:142)
wildfly-experiment | … 5 more
Found an error so I will post the fix here in bold:
# Install jRebel
RUN curl http://dl.zeroturnaround.com/jrebel-stable-nosetup.zip -o /tmp/jrebel.zip
RUN unzip /tmp/jrebel.zip -d /opt/jboss/
ENV REBEL_HOME=/opt/jboss/jrebel
RUN echo “JAVA_OPTS=\”\$JAVA_OPTS -Xms256m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Drebel.remoting_plugin=true -agentpath:$REBEL_HOME/lib/libjrebel64.so\”” >> /opt/jboss/wildfly/bin/standalone.conf
# Start WildFly
CMD [“/opt/jboss/wildfly/bin/standalone.sh”, “-b”, “0.0.0.0”, “-bmanagement”, “0.0.0.0”, “–debug”]
///CUT HERE
Old code:
ENV JAVA_OPTS=”-agentpath:$REBEL_HOME/lib/libjrebel64.so -Drebel.remoting_plugin=true -Xms256m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m”
Hi,
I’ve installed the XRebel plugin today from Eclipse Marketplace and uninstalled after 10 mins use, and then Eclipse (Oxygen) started causing a lot of problems especially when it compiles/builds my app.
Whole bunch of Validation things, change event, … and I get stuck. Your plugin seems to break Darby and some components. This is very bad experience of your plugin.
Hope you can find the solution, but I’m afraid I have to reinstall Eclipse and a number of plugins again. :(
Brendan
I am using JRebel 7.0.10 in Netbeans 8.1. The problem I am having is getting classes in a jar file generated from a maven war project to reload.
The maven war project includes the following plugin configuration:
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>domain-classes</classifier>
<includes>
<include>**/domain/*</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
…so when the maven build is run, both a jar file and a war file are created. JRebel is enabled for the project via the Netbeans JRebel panel. The generated war file contains a WEB-INF/classes/rebel.xml file, and consequently those classes reload fine when code is changed. However the generated jar file does not contain a rebel.xml file, so those classes do not reload when the code is changed.
Is there a way to configure the project so classes from the jar file reload when the code is changed?
Thanks,
Duncan
Hello Duncan!
In this case you would need to play around with the order of commands as you need to call jrebel:generate
twice. Should be something like:
process-resources -> jrebel:generate (for WAR), package->war, package -> jrebel:generate (for JAR), package -> jar
Here is an example of such configuration for a better visual:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<packagingExcludes>**/org/separate/classes/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>1.1.7</version>
<executions>
<execution>
<id>jrebel-war</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<classpath>
<resources>
<resource>
<excludes>
<exclude>/org/separate/classes/**</exclude>
</excludes>
</resource>
</resources>
</classpath>
</configuration>
</execution>
<execution>
<id>jrebel-jar</id>
<phase>package</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<alwaysGenerate>true</alwaysGenerate>
<generateDefaultWeb>false</generateDefaultWeb>
<classpath>
<resources>
<resource>
<includes>
<include>/org/separate/classes/**</include>
</includes>
</resource>
</resources>
</classpath>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includes>
<include>/org/separate/classes/**</include>
<include>rebel.xml</include>
</includes>
<classifier>domain-classes</classifier>
</configuration>
</execution>
</executions>
</plugin>
Let us know if it helps!
Kind regards,
Valerie
Grails 3.3, JDK 1.8_77
JRebel Agent 7.0.14 (201708161539)
I have a Domainclass:
package bugtest
class MyDomainClass {
String myattribute
}
In a Controller I do:
def index() {
def json = new JsonSlurper().parseText('{ "class": "bugtest.MyDomainClass", "myattribute": "aaa" }')
new MyDomainClass(json).save(failOnError: true, flush:true)
render "OK"
}
This works fine when I run it with the default debugger.
The jrebel debugger fails with:
Validation Error(s) occurred during save():
– Field error in object ‘bugtest.MyDomainClass’ on field ‘class’: rejected value [bugtest.MyDomainClass]; codes [bugtest.MyDomainClass.class.typeMismatch.error,bugtest.MyDomainClass.class.typeMismatch,myDomainClass.class.typeMismatch.error,myDomainClass.class.typeMismatch,typeMismatch.bugtest.MyDomainClass.class,typeMismatch.class,typeMismatch.java.lang.Class,typeMismatch]; arguments [class]; default message [Could not find matching constructor for: java.lang.Class(java.lang.String)]
. Stacktrace follows:
java.lang.reflect.InvocationTargetException: null
at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:211)
at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188)
at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
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: grails.validation.ValidationException: Validation Error(s) occurred during save():
– Field error in object ‘bugtest.MyDomainClass’ on field ‘class’: rejected value [bugtest.MyDomainClass]; codes [bugtest.MyDomainClass.class.typeMismatch.error,bugtest.MyDomainClass.class.typeMismatch,myDomainClass.class.typeMismatch.error,myDomainClass.class.typeMismatch,typeMismatch.bugtest.MyDomainClass.class,typeMismatch.class,typeMismatch.java.lang.Class,typeMismatch]; arguments [class]; default message [Could not find matching constructor for: java.lang.Class(java.lang.String)]
at org.grails.orm.hibernate.AbstractHibernateGormInstanceApi.save(AbstractHibernateGormInstanceApi.groovy:132)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.save(GormEntity.groovy:151)
at bugtest.TestController.index(TestController.groovy:9)
… 14 common frames omitted
This error seems to appear after upgrade to latest Hibernate Validator (6.0.2). Next stacktrace is printed when run with Jrebel:
2017-09-01 12:14:50 JRebel: ERROR Class 'org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider' could not be processed by org.zeroturnaround.jrebel.hibernate.validator.cbp.AnnotationMetaDataProviderCBP@org.apache.catalina.loader.ParallelWebappClassLoader@f333f47: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] no such class: configuredBeans
at org.zeroturnaround.bundled.javassist.CtBehavior.insertBefore(SourceFile:774)
at org.zeroturnaround.bundled.javassist.CtBehavior.insertBefore(SourceFile:734)
at org.zeroturnaround.jrebel.hibernate.validator.cbp.AnnotationMetaDataProviderCBP.process(AnnotationMetaDataProviderCBP.java:12)
at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(SourceFile:78)
at com.zeroturnaround.javarebel.tz.a(SourceFile:376)
at com.zeroturnaround.javarebel.tz.a(SourceFile:365)
at com.zeroturnaround.javarebel.tz.a(SourceFile:322)
at com.zeroturnaround.javarebel.SDKIntegrationImpl.runBytecodeProcessors(SourceFile:34)
at com.zeroturnaround.javarebel.rn.transform(SourceFile:106)
at java.lang.ClassLoader.defineClass(ClassLoader.java)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2268)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at org.hibernate.validator.internal.metadata.BeanMetaDataManager.<init>(BeanMetaDataManager.java:145)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.lambda$createValidator$0(ValidatorFactoryImpl.java:374)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.createValidator(ValidatorFactoryImpl.java:365)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.getValidator(ValidatorFactoryImpl.java:278)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.<init>(MethodValidationInterceptor.java:100)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.<init>(MethodValidationInterceptor.java:91)
at org.springframework.validation.beanvalidation.MethodValidationPostProcessor.createMethodValidationAdvice(MethodValidationPostProcessor.java:122)
at org.springframework.validation.beanvalidation.MethodValidationPostProcessor.afterPropertiesSet(MethodValidationPostProcessor.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:223)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:702)
at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:527)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1702)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
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: compile error: no such class: configuredBeans
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.searchImports(SourceFile:470)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.lookupClass(SourceFile:414)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.lookupClassByJvmName(SourceFile:321)
at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atCallExpr(SourceFile:683)
at org.zeroturnaround.bundled.javassist.compiler.JvstTypeChecker.atCallExpr(SourceFile:157)
at org.zeroturnaround.bundled.javassist.compiler.ast.CallExpr.accept(SourceFile:46)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.doTypeCheck(SourceFile:242)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(SourceFile:330)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(SourceFile:50)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compileStmnt(SourceFile:567)
at org.zeroturnaround.bundled.javassist.CtBehavior.insertBefore(SourceFile:754)
... 89 more
Hi,
The incompatibility with newest Hibernate Validator should be fixed in the nightly build available here: https://zeroturnaround.com/software/jrebel/download/nightly-build/
The fix will also be included in the 7.0.15 release.
Hi,
Thank you for bringing this problem to our attention. Also, thank you for the detailed problem description.
I have managed to reproduce it and will now start investigating what causes this bug.
I’ll let you know as soon as we have a workaround or a fix available for you!
Hey,
i updated all dependencies in our Project and now there is an Exception at startup.
2017-09-04 16:23:52 JRebel: ERROR Class 'org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider' could not be processed by org.zeroturnaround.jrebel.hibernate.validator.cbp.AnnotationMetaDataProviderCBP@org.apache.catalina.loader.ParallelWebappClassLoader@67fc3bbd: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] no such class: configuredBeans
at org.zeroturnaround.bundled.javassist.CtBehavior.insertBefore(SourceFile:774)
at org.zeroturnaround.bundled.javassist.CtBehavior.insertBefore(SourceFile:734)
at org.zeroturnaround.jrebel.hibernate.validator.cbp.AnnotationMetaDataProviderCBP.process(AnnotationMetaDataProviderCBP.java:12)
at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(SourceFile:78)
at com.zeroturnaround.javarebel.tz.a(SourceFile:376)
at com.zeroturnaround.javarebel.tz.a(SourceFile:365)
at com.zeroturnaround.javarebel.tz.a(SourceFile:322)
at com.zeroturnaround.javarebel.SDKIntegrationImpl.runBytecodeProcessors(SourceFile:34)
at com.zeroturnaround.javarebel.rn.transform(SourceFile:106)
at java.lang.ClassLoader.defineClass(ClassLoader.java)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at org.hibernate.validator.internal.metadata.BeanMetaDataManager.<init>(BeanMetaDataManager.java:145)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.lambda$createValidator$0(ValidatorFactoryImpl.java:374)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.createValidator(ValidatorFactoryImpl.java:365)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.getValidator(ValidatorFactoryImpl.java:278)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(TypeSafeActivator.java:207)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyRelationalConstraints(TypeSafeActivator.java:191)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyRelationalConstraints(TypeSafeActivator.java:150)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:132)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:278)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.__build(SessionFactoryBuilderImpl.java:452)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.__createEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.__createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:370)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:359)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1078)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857)
at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:543)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1739)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
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: compile error: no such class: configuredBeans
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.searchImports(SourceFile:470)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.lookupClass(SourceFile:414)
at org.zeroturnaround.bundled.javassist.compiler.MemberResolver.lookupClassByJvmName(SourceFile:321)
at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atCallExpr(SourceFile:683)
at org.zeroturnaround.bundled.javassist.compiler.JvstTypeChecker.atCallExpr(SourceFile:157)
at org.zeroturnaround.bundled.javassist.compiler.ast.CallExpr.accept(SourceFile:46)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.doTypeCheck(SourceFile:242)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(SourceFile:330)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(SourceFile:50)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compileStmnt(SourceFile:567)
at org.zeroturnaround.bundled.javassist.CtBehavior.insertBefore(SourceFile:754)
... 106 more
Error appears only when jrebel is activated. I’think, that it is following dependency:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.2.Final</version>
</dependency>
Is there any solution?
Thanks a lot.
Greetings
Damian
Hello,
The Logging (log4j version 2.8.2) is not working when JRebel is enabled.
An info log message from the jrebel.log:
Added Log4j2 configuration: E:\servers\Tomcat 9.0\webapps\MY_PROJECT_NAME\WEB-INF\classes\log4j2.xml
Also, to make sure, I have checked the picked log4j.xml file at runtime and it is the one that I have configured for my project.
I have also check these two previous threads one and two but unfortunately did not help.
Tomcat version is 9.0
JDK 8
JRebel 7.0.14, build 201708161539
Would you please help? Thank you!
Hi,
The incompatibility with newest Hibernate Validator should be fixed in the nightly build available here: https://zeroturnaround.com/software/jrebel/download/nightly-build/
The fix will also be included in the 7.0.15 release which lands in the beginning of next week.
I try decompile code and found bug:
com.zeroturnaround.jdi.JRTypeComponent#calledFromIntellijBytecodeUtils:
private boolean calledFromIntellijBytecodeUtils() {
boolean isIdea = com.zeroturnaround.jdi.util.Configuration.getInstance().getIDEType() == 4;
if (isIdea) {
Throwable t = new Throwable();
return "com.intellij.debugger.jdi.MethodBytecodeUtil".equals(t.getStackTrace()[4].getClassName());
}
return false;
}
on my macbook,jdk8, t.printStackTrace output:
java.lang.Throwable
at com.zeroturnaround.jdi.JRTypeComponent.calledFromIntellijBytecodeUtils(JRTypeComponent.java:84)
Hi,
Usually this can happen if the webapp doesn’t have a rebel.xml but some library has it and also includes a log4j configuration.
However as you pointed out in the log snippet, the file is loaded from your webapp so it shouldn’t be the case.
Also by not working do you mean that only warn/error messages are displayed and it doesn’t match your configuration or that every log message is missing?
Can you send the jrebel.log after reproducing the problem? It’s best if you can set it to trace level beforehand via the vm argument -Drebel.log=trace
You can send the log to support@zeroturnaround.com or if you are running via an IDE with the JRebel plugin installed, you can submit a support ticket via Help -> JRebel -> Submit a Support Ticket and attach the logs there.
From a quick test with the same log4j and tomcat versions i was unable to reproduce this behavior so hopefully the logs will give a clearer overview of your setup and why it may fail.
Hello Meelis,
Finally after around 5 hours of digging, I found the solution. Let me explain it.
I am using log4j’s ${web:rootDir} property, and since I am using JRepel it returns the path defined inside jrebel.xml file (in my case it is pointing to the WebContent of my project from Eclipse workspace), but I was looking inside the Tomcat path.
Why I was looking inside the Tomcat path? Because the logs were written there before using JRebel.
Thanks for your help Meelis and have a nice day.
Thank you!
This performance problem was introduced in 7.0.11 version of JRebel IDE plugin when we modified the rebel.xml generation logic for Gradle projects.
Our development team is currently investigating this issue.
Current workaround would be to revert back to the 7.0.10 version of the JRebel Eclipse IDE plugin.
Hi,
In case you want to retain the previous behavior you can add the web root under rebel.xml excludes as follows:
<web>
<link target="/">
<dir name="/path/to/src/main/webapp">
<exclude name="/"/>
</dir>
</link>
</web>
This will mean that resolving the ServletContext path “/” results in the original deployment path while everything else(e.g. “/foo”, “/foo/bar”) are taken from the rebel.xml mapped path.
Hi Valerie,
Thanks for your quick response. After making your suggested changes the jar file now contains a rebel.xml file. However changes to classes sourced from the jar file are still not being picked up by the dependent projects until I do a maven clean-build of the jar file project. The jar file’s rebel.xml has the expected <classpath> element, but also a <web> element not included when a standard jar file project is built – could this be causing problems?
I have JRebel enabled for all the projects in the Netbeans JRebel panel, is there any other Netbeans configuration I need to put in place?
Thanks,
Duncan