2 Replies Latest reply on Oct 14, 2009 8:06 PM by Mladen Stupar

    Source code for ShoppingCart and ShoppingCatalog portlets

    Mladen Stupar Newbie

      I use JBoss Portal 2.7.2 (JDK 1.5, Eclipse Ganymade SR1 and MySQL 5.0) and I need source code for this two portals: ShoppingCart and ShoppingCatalog. I found this six JAVA files, here: http://anonsvn.jboss.org/repos/portal/modules/portlet/tags/JBP_PORTLET_2_0_8/samples/src/main/java/org/jboss/portal/portlet/samples/shoppingcart/. Is this enough for these two portlets?

      These files should be integred into the Eclipse project and to upgrade with AJAX and JSF (Richfaces-Ajax4JSF). Could I use all files in same Eclipse project for two portlets, or each portlet in a separate project?

      Could someone explain me, how to connect JBoss Portal with MySQL Server? And, how to connect this two portlets with database?

        • 1. Re: Source code for ShoppingCart and ShoppingCatalog portlet
          Peter Johnson Master

          I haven't used those portlets so I cannot comment on whether that is all the code you need or not.

          You can place both portlets into a single project.

          To configure a database for Portal see http://docs.jboss.com/jbportal/v2.7.1/referenceGuide/html/installation.html#d0e927

          Accessing a database within a portlet is no different from accessing a database within any other app deployed to the app server. Specifically how you go about it depends on the data access technology (i.e., JPA, Hibernate, JDBC). However, I recommend that you do not use the same database used by the Portal, you should create a separate database and a separate *-ds.xml file to access it.

          • 2. Re: Source code for ShoppingCart and ShoppingCatalog portlet
            Mladen Stupar Newbie

            I have problem with deploying portlet into JBoss Portal. When I put portlet.war into folder: jboss/server/default/deploy, I get this message on console:

            00:23:30,642 ERROR [LifeCycle] Cannot start object org.jboss.portal.portlet.container.PortletInitializationException: The portlet ShoppingCatalog_Portlet threw a runtime exception during init
            at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:288)
            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:226)
            at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:94)
            at org.jboss.portal.server.deployment.jboss.DeploymentContext.start(DeploymentContext.java:99)
            etc...


            Does anyone from these lines can tell me why not to deploy portlet?