TrigerSoft/jaque

java.lang.RuntimeException: error parsing class file

Closed this issue · 3 comments

Can help overcome the following error:

java.lang.RuntimeException: error parsing class file mz/co/ACSystem/MVCTest/controllers/UserController$$Lambda$4.class
com.trigersoft.jaque.expression.ExpressionClassCracker.parseClass(ExpressionClassCracker.java:209)
com.trigersoft.jaque.expression.ExpressionClassCracker.parseClass(ExpressionClassCracker.java:191)
com.trigersoft.jaque.expression.ExpressionClassCracker.parseFromFileSystem(ExpressionClassCracker.java:164)
com.trigersoft.jaque.expression.ExpressionClassCracker.lambda(ExpressionClassCracker.java:122)
com.trigersoft.jaque.expression.LambdaExpression.parse(LambdaExpression.java:91)
mz.co.ACSystem.MVCTest.repository.ConvertLambdaToSql.toSql(ConvertLambdaToSql.java:47)
mz.co.ACSystem.MVCTest.repository.UWork.get(UWork.java:74)
mz.co.ACSystem.MVCTest.controllers.UserController.list(UserController.java:22)
mz.co.ACSystem.MVCTest.controllers.UserController$Proxy$_$$WeldClientProxy.list(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38)
net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54)
br.com.caelum.vraptor.observer.ExecuteMethod.execute(ExecuteMethod.java:87)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:78)
br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:98)
br.com.caelum.vraptor.interceptor.FlashInterceptor$Proxy$
$$WeldClientProxy.intercept(Unknown Source)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$
$$WeldClientProxy.next(Unknown Source)
br.com.caelum.vraptor.interceptor.DefaultSimpleInterceptorStack.next(DefaultSimpleInterceptorStack.java:49)
br.com.caelum.vraptor.interceptor.DefaultSimpleInterceptorStack$Proxy$
$$WeldClientProxy.next(Unknown Source)
br.com.caelum.vraptor.jpa.TransactionDecorator.intercept(TransactionDecorator.java:28)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod.invokeOnInstance(InvokableAnnotatedMethod.java:97)
org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:80)
org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler.doInvoke(DecoratorProxyMethodHandler.java:69)
org.jboss.weld.interceptor.util.proxy.TargetInstanceProxyMethodHandler.invoke(TargetInstanceProxyMethodHandler.java:33)
org.jboss.weld.bean.proxy.TargetBeanInstance.invoke(TargetBeanInstance.java:88)
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)
br.com.caelum.vraptor.jpa.JPATransactionInterceptor$Proxy$
$$Weld$Proxy$.intercept(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
org.jboss.weld.util.reflection.Reflections.invokeAndUnwrap(Reflections.java:401)
org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:62)
br.com.caelum.vraptor.jpa.JPATransactionInterceptor$Proxy$
$$WeldSubclass.intercept(Unknown Source)
br.com.caelum.vraptor.jpa.JPATransactionInterceptor$Proxy$
$$WeldClientProxy.intercept(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38)
net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54)
br.com.caelum.vraptor.interceptor.StepInvoker.invokeMethod(StepInvoker.java:49)
br.com.caelum.vraptor.interceptor.StepInvoker.tryToInvoke(StepInvoker.java:40)
br.com.caelum.vraptor.interceptor.StepInvoker$Proxy$
$$WeldClientProxy.tryToInvoke(Unknown Source)
br.com.caelum.vraptor.interceptor.InterceptorExecutor.executeAround(InterceptorExecutor.java:75)
br.com.caelum.vraptor.interceptor.InterceptorExecutor$Proxy$
$$WeldClientProxy.executeAround(Unknown Source)
br.com.caelum.vraptor.interceptor.AspectStyleInterceptorHandler.execute(AspectStyleInterceptorHandler.java:85)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:75)
br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor$Proxy$
$$WeldClientProxy.intercept(Unknown Source)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
br.com.caelum.vraptor.core.DefaultInterceptorStack.start(DefaultInterceptorStack.java:93)
br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$
$$_WeldClientProxy.start(Unknown Source)
br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:93)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:497)
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:123)

This is not a product issue.
Please read "how to write fluent interface with jaque" article.
The parser must have access to the lambda byte code. The preferred method is to make the lambda Serializable, like suggested in the article. In this case the byte code can be accessed in-memory. Otherwise a special system property must be defined, which might be not simple in complex deployments.

thank you for the explanation

Can you help me explaining me how to convert

pet -> pet.getColor() == null

to

pet.get(Pet_.color).isNull()

using your library.

Regards