Uploaded image for project: 'PUBLIC - Liferay IDE'
  1. PUBLIC - Liferay IDE
  2. IDE-1082

ClassCastException and NullPointerException when steping over Freemarker debugger on remote server

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0 M1
    • Debug, Debug > Freemarker
    • None

    Description

      Start up a remote server in debug mode by "catalina jpda run" in cmd under "XX\bundles\tomcat-7.0.40\bin";
      Deploy server manager web plugin by "ant deploy" in cmd under "XX\liferay-plugins\webs\server-manager-web";
      Go to IDE, connect to the remote server by Server view - new server - remote - 6.2 - "XX\bundles\tomcat-7.0.40";
      Create a theme using "XX\liferay-plugins" as SDK and "XX\bundles\tomcat-7.0.40" as runtime, deploy theme;
      Go to localhost 8080, set this theme;
      Copy "docroot\templates\portal_normal.ftl" to "docroot_diffs\templates\" and set a breakpoint;
      Refresh localhost 8080, will stop at the breakpoint, but after click F6 or F8, following errors will show up:

      java.lang.ClassCastException: freemarker.ext.servlet.ServletContextHashModel cannot be cast to freemarker.template.TemplateHashModelEx
      at freemarker.debug.impl.RmiDebugModelImpl.keys(RmiDebugModelImpl.java:126)
      at sun.reflect.GeneratedMethodAccessor447.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      at freemarker.debug.impl.RmiDebugModelImpl_Stub.keys(Unknown Source)
      at com.liferay.ide.debug.core.fm.FMValue.getVariables(FMValue.java:382)
      at com.liferay.ide.debug.core.fm.FMValue.hasVariables(FMValue.java:529)
      at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.hasChildren(VariableContentProvider.java:62)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.updateHasChildren(ElementContentProvider.java:223)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$3.run(ElementContentProvider.java:200)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
      java.lang.ClassCastException: com.liferay.util.freemarker.FreeMarkerTaglibFactoryUtil$TaglibFactoryCacheWrapper cannot be cast to freemarker.template.TemplateHashModelEx
      at freemarker.debug.impl.RmiDebugModelImpl.keys(RmiDebugModelImpl.java:126)
      at sun.reflect.GeneratedMethodAccessor447.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      at freemarker.debug.impl.RmiDebugModelImpl_Stub.keys(Unknown Source)
      at com.liferay.ide.debug.core.fm.FMValue.getVariables(FMValue.java:382)
      at com.liferay.ide.debug.core.fm.FMValue.hasVariables(FMValue.java:529)
      at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.hasChildren(VariableContentProvider.java:62)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.updateHasChildren(ElementContentProvider.java:223)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$3.run(ElementContentProvider.java:200)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
      java.lang.ClassCastException: com.liferay.util.freemarker.FreeMarkerTaglibFactoryUtil$TaglibFactoryCacheWrapper cannot be cast to freemarker.template.TemplateHashModelEx
      at freemarker.debug.impl.RmiDebugModelImpl.keys(RmiDebugModelImpl.java:126)
      at sun.reflect.GeneratedMethodAccessor447.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      at freemarker.debug.impl.RmiDebugModelImpl_Stub.keys(Unknown Source)
      at com.liferay.ide.debug.core.fm.FMValue.getVariables(FMValue.java:382)
      at com.liferay.ide.debug.core.fm.FMValue.hasVariables(FMValue.java:529)
      at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.hasChildren(VariableContentProvider.java:62)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.updateHasChildren(ElementContentProvider.java:223)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$3.run(ElementContentProvider.java:200)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

      get(deployed) failed on instance of $Proxy557
      Java backtrace for programmers:
      ----------
      freemarker.template.TemplateModelException: get(deployed) failed on instance of $Proxy557
      at freemarker.ext.beans.BeanModel.get(BeanModel.java:224)
      at freemarker.debug.impl.RmiDebugModelImpl.get(RmiDebugModelImpl.java:119)
      at sun.reflect.GeneratedMethodAccessor448.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      at freemarker.debug.impl.RmiDebugModelImpl_Stub.get(Unknown Source)
      at com.liferay.ide.debug.core.fm.FMValue.getVariables(FMValue.java:384)
      at com.liferay.ide.debug.core.fm.FMValue.hasVariables(FMValue.java:529)
      at org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.hasChildren(VariableContentProvider.java:62)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.updateHasChildren(ElementContentProvider.java:223)
      at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$3.run(ElementContentProvider.java:200)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor494.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:866)
      at freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:277)
      at freemarker.ext.beans.BeanModel.get(BeanModel.java:184)
      at freemarker.debug.impl.RmiDebugModelImpl.get(RmiDebugModelImpl.java:119)
      at sun.reflect.GeneratedMethodAccessor448.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at $Proxy557.isDeployed(Unknown Source)
      ... 20 more

      Attachments

        Activity

          People

            gregory.amerson Gregory Amerson
            cindy.li Cindy Li (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 37 weeks, 4 days ago

              Packages

                Version Package
                2.0.0 M1