1 Reply Latest reply on Sep 15, 2008 10:33 PM by Cesar Augusto Boguchevski

    problem in build portlets with xml-rpc

    Cesar Augusto Boguchevski Newbie

      I'm trying to use xml-rpc in my portlet eclipse project using pluggin JBossTools-3.0.0.Alpha1-ALL-linux-gtk, but when I deploy de application it report this error:

      19:23:21,342 ERROR [LifeCycle] Cannot start object
      org.jboss.portal.portlet.container.PortletInitializationException: The portlet MyPortlet threw an error during init
      at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:292)
      at org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle.invokeStart(PortletContainerLifeCycle.java:76)
      at org.jboss.portal.portlet.impl.container.LifeCycle.managedStart(LifeCycle.java:92)
      at org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle.startDependents(PortletApplicationLifeCycle.java:351)
      at org.jboss.portal.portlet.impl.container.LifeCycle.managedStart(LifeCycle.java:128)
      at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:225)
      at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:94)
      at org.jboss.portal.server.deployment.jboss.DeploymentContext.start(DeploymentContext.java:99)
      at org.jboss.portal.server.deployment.jboss.PortalDeploymentInfoContext.start(PortalDeploymentInfoContext.java:220)
      at org.jboss.portal.server.deployment.jboss.ServerDeployer.start(ServerDeployer.java:217)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy220.deploy(Unknown Source)
      at org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:259)
      at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:53)
      at org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:159)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
      at $Proxy222.handleNotification(Unknown Source)
      at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadcasterSupport.java:127)
      at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcasterSupport.java:108)
      at org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:340)
      at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:308)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:482)
      at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy201.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:508)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NoClassDefFoundError: org/apache/xmlrpc/XmlRpcException
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
      at java.lang.Class.getConstructor0(Class.java:2699)
      at java.lang.Class.newInstance0(Class.java:326)
      at java.lang.Class.newInstance(Class.java:308)
      at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:254)
      ... 122 more

      The init metod is implemented calling a class XmlRpcTeste executing the xml-rpc call, like this:

      @Override
      public void init() throws PortletException {
      // TODO Auto-generated method stub
      super.init();


      XmlRpcTeste cliente = new XmlRpcTeste();
      try {
      respostaXmlRpc = cliente.getServico();
      } catch (XmlRpcException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      respostaXmlRpc = "erro comunicacao xmlRpc";
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      respostaXmlRpc = "erro I/O";
      }


      }

      and the var. respostaXmlRpc is used in the metod doView():

      @Override
      protected void doView(RenderRequest request, RenderResponse response)
      throws PortletException, IOException, UnavailableException {
      response.setContentType("text/html");
      PrintWriter writer = response.getWriter();
      writer.write(respostaXmlRpc);
      writer.close();
      }

      Anyone can help with this mistake?

      Thanks and sorry for my english,
      Cesar Boguchevski



        • 1. Re: problem in build portlets with xml-rpc
          Cesar Augusto Boguchevski Newbie

          I solve this problem (java can't find the jar).. If someone have the same problem the solution is:

          - download the xml-rpc 3.0 API (file: xmlrpc-current-bin.tar.gz);
          - extract and put the jar files on dir ;~/workspace//WEB-INF/lib/
          - import the jars to the eclipse project in add external jars and check all the jars in order and export tab;
          - go to eclipse resource view, browse WEB-INF/lib and, clik and select to refresh with right button.

          I hope it could be usefull