Uncommented Bytes

Wednesday, November 10, 2004

Problem Deploying Jetspeed 2 on Weblogic

Here's a quick fix for deploying Jetspeed 2 on Weblogic. First I had to fix a java.net.MalformedURLException. Here's the post on the BEA dev2dev Forums. I just needed to add this to the JAVA_OPTIONS of my startWebLogic script:
-Djava.naming.provider.url=t3://localhost:nnnn
where nnnn is the port configured for this particular WL server.


Next I made a jetspeed.ear folder under applications and exploded jetspeed.war into this. I also added a small application.xml file under jetspeed.ear/META-INF to setup the war module.

Then I copied in these 5 jar files from jetspeed into the root of my ear:
jetspeed-api-2.0-a1-dev.jar
jetspeed-commons-2.0-a1-dev.jar
portals-bridges-common-0.1.jar
portlet-api-1.0.jar
pluto-1.0.1-rc1.jar


Then I added this line to the MANIFEST.MF file under jetspeed.ear/jetspeed.war/META-INF:
Class-Path: jetspeed-api-2.0-a1-dev.jar jetspeed-commons-2.0-a1-dev.jar portals-bridges-common-0.1.jar portlet-api-1.0.jar pluto-1.0.1-rc1.jar

Now I'm stuck on a "cannot find OJB.properties". Hope to find it soon!

Edited: Mar 3, 2005 to add the following:
Hey, I've been linked from the Jetspeed Wiki, cool!

Please see my follow-up posts to this issue:
Jetspeed 2 on Weblogic - part 2
Jetspeed 2 on Weblogic - Finally
Jetspeed 2 on Weblogic - update again
Jetspeed Fusion, Struts, and Weblogic

Also, it appears the commenting system on blogspot has been having some issues, so I cleaned out a few duplicate comments...

13 Comments:

  • refer to this document for more information on how to get jetspeed2 running on weblogic.

    http://wiki.apache.org/portals/Jetspeed2/Fusion

    follow the section installing fusion on weblogic steps 1-5 replacing tomcat with weblogic then the following steps 1-4. Make sure you comment out all parameters as defined in step one on the jetspeed-spring.xml file.

    the jetspeed2.war must be exploded or it can't access the director /web-inf/decorations defined in the web.xml

    I found the file OJB.properties in the {$jetspeed2}/etc/db-ojb directory and placed it in the root of my weblogic domain directory.

    Now I am stuck on an null pointer exception.

    {$beaDomain}/jetspeed/WEB-INF/assembly/jetspeed
    -spring.xml]: Initialization of bean failed; nested exception is org.apache.jets
    peed.prefs.PreferencesException: Failed to initialize prefs api. java.lang.Null
    PointerException
    org.apache.jetspeed.prefs.PreferencesException: Failed to initialize prefs api.
    java.lang.NullPointerException
    at org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl.init(Preference
    sFactoryImpl.java:69)

    I guess I'll keep looking.

    By Blogger robby, at 26 March, 2005 00:00  

  • Problems with the Preferences API often deal with the database. Make sure that your database is correctly setup and your datasource is working.

    By Blogger Jeff Sheets, at 28 March, 2005 17:13  

  • I've created the data source name of JetspeedDB as defined in the weblogic.xml file provided, however I am still receiving the same error. Were is the DataSource JNDI name defined in jetspeed2?

    JNDI System Property flag null
    org.springframework.beans.factory.BeanCreationException: Error creating bean wit
    h name 'java.util.prefs.PreferencesFactory' defined in URL [file:/C:/pharmacy/do
    mains/pharmacyDomain/myserver/upload/jetspeed/jetspeed/WEB-INF/assembly/jetspeed
    -spring.xml]: Initialization of bean failed; nested exception is org.apache.jets
    peed.prefs.PreferencesException: Failed to initialize prefs api. java.lang.Null
    PointerException
    org.apache.jetspeed.prefs.PreferencesException: Failed to initialize prefs api.
    java.lang.NullPointerException
    at org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl.init(Preference
    sFactoryImpl.java:69)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)

    By Anonymous Anonymous, at 30 March, 2005 22:26  

  • I've tried datasource names of: (all were found in jetspeed)

    JetspeedDS
    JetspeedDB
    jdbc/JetspeedDS
    jdbc/JetspeedDB

    None of them seem to work.

    By Blogger robby, at 30 March, 2005 22:44  

  • I have finally solved my data source issue. It appears that there is a problem with the build file jetspeed-2.0-M1-src.zip. When it builds it is missing critical files. Refer to the posting of: http://www.mail-archive.com/jetspeed-dev@jakarta.apache.org/msg18903.html

    Apparently I was missing in the jetspeed.war/WEB-INF/classes/ directory several files:

    OJB-logging.properties
    OJB.properties
    repository.dtd
    repository_internal.xml
    repository.xml

    I found those files in the binary download. I am running against mysql database.

    I set my datasource to JetspeedDB as defined in weblogic.xml found in web-inf directory and that has worked for me. I am now getting errors of


    ServletContext(id=3
    432461,name=jetspeed,context-path=/jetspeed)] Root cause of ServletException.
    org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.Pip
    elineException: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetsp
    eed.aggregator.FailedToRenderFragmentException: Unable to render fragment becaus
    e: org.apache.jetspeed.container.window.FailedToRetrievePortletWindow: org.apach
    e.jetspeed.container.window.FailedToCreateWindowException: Error generating new
    PortletEntity: org.apache.jetspeed.components.portletentity.PortletEntityNotGene
    ratedException: Failed to retrieve Portlet Definition for jetspeed::VelocityTwoC
    olumns
    at org.apache.jetspeed.security.impl.PasswordCredentialValveImpl.invoke(
    PasswordCredentialValveImpl.java:144)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.security.impl.AbstractSecurityValve$1.run(Abstrac
    tSecurityValve.java:108)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:437)
    at org.apache.jetspeed.security.impl.AbstractSecurityValve.invoke(Abstra
    ctSecurityValve.java:102)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.container.url.impl.PortalURLValveImpl.invoke(Port
    alURLValveImpl.java:55)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.capabilities.impl.CapabilityValveImpl.invoke(Capa
    bilityValveImpl.java:127)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.localization.impl.LocalizationValveImpl.invoke(Lo
    calizationValveImpl.java:73)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invoke(JetspeedPipeline
    .java:191)
    at org.apache.jetspeed.engine.AbstractEngine.service(AbstractEngine.java
    :259)
    at org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java
    :225)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:419)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:315)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
    cherImpl.java:328)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:150
    )
    at jsp_servlet.__index._jspService(__index.java:127)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:419)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:463)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:315)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6722)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3764)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.p
    ipeline.PipelineException: org.apache.jetspeed.aggregator.FailedToRenderFragment
    Exception: Unable to render fragment because: org.apache.jetspeed.container.wind
    ow.FailedToRetrievePortletWindow: org.apache.jetspeed.container.window.FailedToC
    reateWindowException: Error generating new PortletEntity: org.apache.jetspeed.co
    mponents.portletentity.PortletEntityNotGeneratedException: Failed to retrieve Po
    rtlet Definition for jetspeed::VelocityTwoColumns
    at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerVa
    lveImpl.java:170)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.security.impl.PasswordCredentialValveImpl.invoke(
    PasswordCredentialValveImpl.java:139)
    ... 35 more
    Caused by: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.a
    ggregator.FailedToRenderFragmentException: Unable to render fragment because: or
    g.apache.jetspeed.container.window.FailedToRetrievePortletWindow: org.apache.jet
    speed.container.window.FailedToCreateWindowException: Error generating new Portl
    etEntity: org.apache.jetspeed.components.portletentity.PortletEntityNotGenerated
    Exception: Failed to retrieve Portlet Definition for jetspeed::VelocityTwoColumn
    s
    at org.apache.jetspeed.aggregator.AggregatorValve.invoke(AggregatorValve
    .java:52)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.pipeline.valve.impl.ActionValveImpl.invoke(Action
    ValveImpl.java:117)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.container.ContainerValve.invoke(ContainerValve.ja
    va:76)
    at org.apache.jetspeed.pipeline.JetspeedPipeline.invokeNext(JetspeedPipe
    line.java:209)
    at org.apache.jetspeed.profiler.impl.ProfilerValveImpl.invoke(ProfilerVa
    lveImpl.java:133)
    ... 37 more
    Caused by: org.apache.jetspeed.aggregator.FailedToRenderFragmentException: Unabl
    e to render fragment because: org.apache.jetspeed.container.window.FailedToRetri
    evePortletWindow: org.apache.jetspeed.container.window.FailedToCreateWindowExcep
    tion: Error generating new PortletEntity: org.apache.jetspeed.components.portlet
    entity.PortletEntityNotGeneratedException: Failed to retrieve Portlet Definition
    for jetspeed::VelocityTwoColumns
    at org.apache.jetspeed.aggregator.impl.PortletRendererImpl.renderNow(Por
    tletRendererImpl.java:114)
    at org.apache.jetspeed.aggregator.impl.PageAggregatorImpl.build(PageAggr
    egatorImpl.java:251)
    at org.apache.jetspeed.aggregator.AggregatorValve.invoke(AggregatorValve
    .java:48)
    ... 43 more
    Caused by: org.apache.jetspeed.container.window.FailedToRetrievePortletWindow: o
    rg.apache.jetspeed.container.window.FailedToCreateWindowException: Error generat
    ing new PortletEntity: org.apache.jetspeed.components.portletentity.PortletEntit
    yNotGeneratedException: Failed to retrieve Portlet Definition for jetspeed::Velo
    cityTwoColumns
    at org.apache.jetspeed.container.window.impl.PortletWindowAccessorImpl.g
    etPortletWindow(PortletWindowAccessorImpl.java:100)
    at org.apache.jetspeed.aggregator.impl.PortletRendererImpl.getPortletWin
    dow(PortletRendererImpl.java:234)
    at org.apache.jetspeed.aggregator.impl.PortletRendererImpl.renderNow(Por
    tletRendererImpl.java:95)
    ... 45 more
    Caused by: org.apache.jetspeed.container.window.FailedToCreateWindowException: E
    rror generating new PortletEntity: org.apache.jetspeed.components.portletentity.
    PortletEntityNotGeneratedException: Failed to retrieve Portlet Definition for je
    tspeed::VelocityTwoColumns
    at org.apache.jetspeed.container.window.impl.PortletWindowAccessorImpl.c
    reatePortletWindow(PortletWindowAccessorImpl.java:138)
    at org.apache.jetspeed.container.window.impl.PortletWindowAccessorImpl.c
    reatePortletWindow(PortletWindowAccessorImpl.java:120)
    at org.apache.jetspeed.container.window.impl.PortletWindowAccessorImpl.g
    etPortletWindow(PortletWindowAccessorImpl.java:96)
    ... 47 more
    Caused by: org.apache.jetspeed.components.portletentity.PortletEntityNotGenerate
    dException: Failed to retrieve Portlet Definition for jetspeed::VelocityTwoColum
    ns
    at org.apache.jetspeed.components.portletentity.PersistenceBrokerPortlet
    EntityAccess.generateEntityFromFragment(PersistenceBrokerPortletEntityAccess.jav
    a:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingR
    eflection(AopProxyUtils.java:61)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
    inpoint(ReflectiveMethodInvocation.java:149)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
    ReflectiveMethodInvocation.java:116)
    at org.springframework.transaction.interceptor.TransactionInterceptor.in
    voke(TransactionInterceptor.java:56)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
    ReflectiveMethodInvocation.java:138)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
    cAopProxy.java:152)
    at $Proxy9.generateEntityFromFragment(Unknown Source)
    at org.apache.jetspeed.container.window.impl.PortletWindowAccessorImpl.c
    reatePortletWindow(PortletWindowAccessorImpl.java:133)
    ... 49 more
    >

    By Blogger robby, at 30 March, 2005 23:32  

  • It appears that the VelocityTwoColumns portlet definition hasn't been registered in my database in table PORTLET_DEFINITION. Refer to http://www.mail-archive.com/jetspeed-dev@jakarta.apache.org/msg17413.html

    By Blogger robby, at 30 March, 2005 23:50  

  • OJB.properties doesn't need to be in the weblogic domain if placed in the /web-inf/classes directory where it should be when built.

    By Blogger robby, at 31 March, 2005 00:11  

  • The reason ojb.properties isn't found and I am missing other files is because of a maven 1.0 build issue. see: http://wiki.apache.org/portals/Jetspeed2/OjbPropertiesNotFound

    Changing your build.properties from
    org.apache.jetspeed.project.home = /jetspeed2
    to
    org.apache.jetspeed.project.home = c:/jetspeed2

    seems to fix the improper build issue by supplying the proper files in the /web-inf/classes directory. Make note of the c:/ rather than just / Again, this is a windows maven 1.0 build issue.

    By Blogger robby, at 31 March, 2005 00:15  

  • I added the following files to the web-inf/deploy directory and now everything works.

    demo.war
    jsf-demo.war
    pam.war
    perl.war
    php.war
    rss.war
    security.war
    struts-demo.war
    jetspeed-layouts.war

    I still need to figure out how to get the jetspeed.war to deploy rather than having to deploy an exploded war.

    By Blogger robby, at 31 March, 2005 01:20  

  • I'm still having some issues. The portal is running, however the demo portlets aren't working. The demo portlets deployed and loaded the database tables, but I am getting this error in the content pane of each portlet.

    javax.portlet.PortletException: Failed to find Servlet context for Portlet Application: /pam at org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:184) at org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:124) at org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:103) at org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPortlet(JetspeedPortletContainerWrapper.java:88) at org.apache.jetspeed.aggregator.impl.RenderingJob.run(RenderingJob.java:109) at org.apache.jetspeed.aggregator.impl.Worker$1.run(Worker.java:171) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:437) at org.apache.jetspeed.aggregator.impl.Worker.run(Worker.java:165)

    This error message is respective of the deployed demo portlet name and portlet content pane displayed.

    By Blogger robby, at 31 March, 2005 02:05  

  • Robby,

    I'm glad that you are finding your way with Jetspeed, and thanks for posting your findings here!

    As for your last error:
    Failed to find Servlet context for Portlet Application: /pam
    I have solved this problem in my post on Nov 10, and I describe my problems in another post from Nov 10. Basically you just need to deploy the wars through weblogic console, or add all of them to an ear and make an entry for each in application.xml. (I chose the 2nd solution.)

    Also, I was not successful in deploying jetspeed.war as a jar'ed up file. My current setup is to have jetspeed.war exploded in the applications directory. Then I have a myapp.ear that is unexploded also in the applications directory. myapp.ear contains the demo wars, and my other wars, each with an entry in application.xml. Now we just deploy a new myapp.ear each time, and don't have to worry about jetspeed.war (except we must register the portlets each time we redeploy, but I wrote a nice auto-register feature using JMS that we use).

    Also, since I see I've been linked from the Jetspeed FAQ, I'm going to edit this post with links to all of my details on getting Jetspeed working with Weblogic.

    By Blogger Jeff Sheets, at 31 March, 2005 07:47  

  • If you put the jars from shared\lib of the original distribution into APP-INF\lib you won't need a MANIFEST.MF

    Juergen

    By Anonymous Anonymous, at 31 March, 2005 10:41  

  • I prefer not to put things in APP-INF/lib because that is Weblogic specific, however I agree that it would be easier.

    By Blogger Jeff Sheets, at 31 March, 2005 22:55  

Post a Comment

Links to this post:

Create a Link

<< Home