1 2 Previous Next 23 Replies Latest reply on Jul 27, 2007 9:04 AM by dssa das

    how can i get current PortalNode

    dssa das Newbie

      I read CatalogPortlet.java sources and i saw lines

      PortalNode current = req.getPortalNode();

      for JBossRenderRequest req; definition.
      In new api there isn't class org.jboss.portlet.JBossRenderRequest but newest javax.portlet.RenderRequest whitch don't have method getPortalNode();

      Where should I search it?


        • 1. Re: how can i get current PortalNode
          dssa das Newbie

          I am use jboss portal 2.4.2

          • 2. Re: how can i get current PortalNode
            Andrew Brownfield Newbie

            I'm a bit confused about what you are asking.

            I see org.jboss.portlet.JBossRenderRequest in both the API docs and in the source. Same with javax.portlet.RenderRequest. This is with JBP 2.6 source package, and javadocs for both 2.4 and 2.6.

            • 3. Re: how can i get current PortalNode
              Chris Laprun Master

               

              "k3nnymusic" wrote:
              I read CatalogPortlet.java sources and i saw lines
              PortalNode current = req.getPortalNode();

              for JBossRenderRequest req; definition.
              In new api there isn't class org.jboss.portlet.JBossRenderRequest but newest javax.portlet.RenderRequest whitch don't have method getPortalNode();


              PortalNode is a JBoss Portal specific class used for things like Inter-Portlet Communication (IPC). Using it will tie your portlet to JBoss Portal (i.e. any portlet using the Portal API will not work on other portal solutions). RenderRequest is a JSR-168 interface. This is therefore normal that it doesn't give access to JBoss Portal's API.

              That said, I am not quite sure what your problem is. Could you please provide more details?

              • 4. Re: how can i get current PortalNode
                dssa das Newbie

                which .jar 's should I add to my portlet project? I must link source all sources from jboss portal 2.4.2-src ??? Could you give me simple solution?

                • 5. Re: how can i get current PortalNode
                  Thomas Heute Master

                  Add this for the compilation:
                  jboss-portlet-api-lib.jar
                  portal-api-lib.jar

                  • 6. Re: how can i get current PortalNode
                    dssa das Newbie

                     

                    "thomas.heute@jboss.com" wrote:
                    Add this for the compilation:
                    jboss-portlet-api-lib.jar
                    portal-api-lib.jar


                    Thanks!

                    • 7. Re: how can i get current PortalNode
                      dssa das Newbie

                      One more problem.
                      I am use apache ant 1-6-3, and when I deploy helloworldjspportlet.war builded version to my portal all its ok, but if I deploy version which I am build from heloworldjsp sources I have got the following error:

                      13:58:16,771 INFO [TomcatDeployer] deploy, ctxPath=/helloworldjspportlet, warUrl=.../tmp/deploy/tmp40551helloworldjspportlet-exp.war/
                      13:58:16,943 ERROR [AbstractKernelController] Error installing to Start: name=portal:container=Portlet,id=/helloworldjspportlet.Menu state=Create
                      org.jboss.portal.portlet.container.PortletInitializationException: The portlet Menu threw an error during init
                       at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:289)
                       at org.jboss.portal.portlet.container.PortletContainerAdapter.start(PortletContainerAdapter.java:72)
                       at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:324)
                       at org.jboss.joinpoint.plugins.reflect.ReflectMethodJoinPoint.dispatch(ReflectMethodJoinPoint.java:72)
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:92)
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:452)
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:147)
                       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
                       at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:74)
                       at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:225)
                       at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:77)
                       at org.jboss.portal.server.deployment.jboss.PortalDeploymentInfo$DeploymentContext.start(PortalDeploymentInfo.java:214)
                       at org.jboss.portal.server.deployment.jboss.ServerDeployer.start(ServerDeployer.java:243)
                       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                       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:324)
                       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 $Proxy115.deploy(Unknown Source)
                       at org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:297)
                       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:324)
                       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 $Proxy88.deploy(Unknown Source)
                       at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:54)
                       at org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:148)
                       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:324)
                       at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
                       at $Proxy118.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.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:324)
                       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.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
                       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 $Proxy103.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.GeneratedMethodAccessor55.invoke(Unknown Source)
                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                       at java.lang.reflect.Method.invoke(Method.java:324)
                       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 $Proxy8.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$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                      Caused by: java.lang.UnsupportedClassVersionError: org/jboss/portlet/hello/MenuBZWBK (Unsupported major.minor version 50.0)
                       at java.lang.ClassLoader.defineClass0(Native Method)
                       at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
                       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
                       at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
                       at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:869)
                       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1322)
                       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
                       at org.jboss.portal.portlet.container.PortletContainer.start(PortletContainer.java:245)
                       ... 101 more


                      I don't understand whats going on becouse ant build finished sucessfull
                      
                      D:\projekty\HelloWorldJSPPortlet>ant deploy
                      Buildfile: build.xml
                      
                      prepare:
                       [mkdir] Created dir: D:\projekty\HelloWorldJSPPortlet\output\classes
                       [mkdir] Created dir: D:\projekty\HelloWorldJSPPortlet\output\lib
                       [mkdir] Created dir: D:\projekty\HelloWorldJSPPortlet\output\lib\exploded
                      
                      clover-yes:
                      
                      clover-no:
                      
                      deploy:
                       [javac] Compiling 1 source file to D:\projekty\HelloWorldJSPPortlet\output\classes
                       [jar] Building jar: D:\projekty\HelloWorldJSPPortlet\output\lib\helloworldjspportlet-lib.jar
                       [copy] Copying 1 file to D:\projekty\HelloWorldJSPPortlet\src\resources\helloworldjspportlet-war\WEB-INF\lib
                       [jar] Building jar: D:\projekty\HelloWorldJSPPortlet\helloworldjspportlet.war
                      
                      BUILD SUCCESSFUL
                      Total time: 1 second
                      D:\projekty\HelloWorldJSPPortlet>

                      Any idea?

                      • 8. Re: how can i get current PortalNode
                        dssa das Newbie

                        I am tried in ant version 1.7 and there are the same problem.

                        • 9. Re: how can i get current PortalNode
                          Boleslaw Dawidowicz Master

                           

                          Unsupported major.minor version


                          This usually means that you are trying to run classes under lower Java version than the one used to build them - like compile under 1.6 and run under 1.5

                          • 11. Re: how can i get current PortalNode
                            dssa das Newbie

                            back to topic:

                            I saw sample portlets and I don't know how can I use
                            import javax.portlet.RenderRequest;
                            import javax.portlet.RenderResponse;

                            and

                            org.jboss.portlet.JBossRenderRequest
                            org.jboss.portlet.JBossRenderResponse

                            like a doView function arguments at the same time.
                            I need both information about current portal nodes, and about portlet (eg window state)

                            I saw CatalogPortlet.java and it use only JBossRenderRequest, JBossRenderResponse and have permissions to methods like
                            req.setAttribute("parentNode", parent); when req is a org.jboss.portlet.JBossRenderRequest object.
                            I tried to use the same code in my .java with the same imports (I added .jar's) and I have got errors such as:
                            setAttribute is undefined for type org.jboss.portlet.JBossRenderRequest.

                            Sorry for my noob questions but I am new in portlets, and I try to understand it well.

                            Could you help me?

                            • 12. Re: how can i get current PortalNode
                              dssa das Newbie

                              and what its the difference between
                              org.jboss.portlet.JBossPortlet and
                              javax.portlet.GenericPortlet
                              ???

                              • 13. Re: how can i get current PortalNode
                                Thomas Heute Master

                                org.jboss.portlet.JBossPortlet is an extension of javax.portlet.GenericPortlet.

                                It gives you access to stuff like Portal nodes

                                • 14. Re: how can i get current PortalNode
                                  dssa das Newbie

                                  ok thx, but how can i get information about is current user have permissions to use current PortalNode or PortalNodeURL???

                                  I have got current user and all node URL's and I try to display only links which user have acess.

                                  I read portal api in reference but I don't find any information about that.

                                  1 2 Previous Next