You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by mclovis <mc...@elucidar.com> on 2008/08/06 19:47:15 UTC

Running Roller as a Packed WAR

I am starting a new thread on this question because I asked the question
incorrectly before and I hope to get new feedback. Currently If you run
Roller as a PACKED war there are code issues. You can start to change the
code and configuration to overcome these issues. Has anyone had any success
or thoughts on this? Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Running-Roller-as-a-Packed-WAR-tp18856261s12275p18856261.html
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Running Roller as a Packed WAR

Posted by Dave <sn...@gmail.com>.
On Sat, Aug 16, 2008 at 1:44 PM, mclovis <mc...@elucidar.com> wrote:
>
> To finalize the issues...
> If you make the changes suggested in the code AND do the following...
>
> 1. Create a directory that the tomcat user has permissions and access
>   let' call it /usr/home/YOURNAME/roller_data
>
> 2. In this directory create a uploads, search-index, themes, and planetcache
> directory
> 3. copy the themes from apache-roller-4.0/apps/weblogger/web/themes to
> roller_data/themes directory
> 4. Create a roller-custom.properties file that has JDBC settings for the
> database and property settings
>   for the mail server.
> 6. Also in the roller-custom.properties file set the full path to the
> uploads.dir, search.index.dir, themes.dir and planet.aggregator.cache.dir.
> These will be the directories in /usr/home/YOURNAME/roller_data.
> 7. Create a planet-custom.properties file. You really only need to do this
> IF your JDBC settings in roller-custom.properties are not the default. In
> that they probably are not (username, password at least) you should make
> one. The JDBC settings should match roller-custom.properties. IF your
> permissions on the war and the directories are correct, I believe this
> should take care of all the issues.

Thanks for figuring this out and following through with detailed
notes.  Please create an issue in JIRA for this so we can make sure it
is addresses. And please attach a patch for the code changes, or if
they are simple enough just describe them.

Thanks,
- Dave

Re: Running Roller as a Packed WAR

Posted by mclovis <mc...@elucidar.com>.
To finalize the issues...
If you make the changes suggested in the code AND do the following...

1. Create a directory that the tomcat user has permissions and access 
   let' call it /usr/home/YOURNAME/roller_data

2. In this directory create a uploads, search-index, themes, and planetcache
directory
3. copy the themes from apache-roller-4.0/apps/weblogger/web/themes to
roller_data/themes directory
4. Create a roller-custom.properties file that has JDBC settings for the
database and property settings 
   for the mail server. 
6. Also in the roller-custom.properties file set the full path to the
uploads.dir, search.index.dir, themes.dir and planet.aggregator.cache.dir.
These will be the directories in /usr/home/YOURNAME/roller_data. 
7. Create a planet-custom.properties file. You really only need to do this
IF your JDBC settings in roller-custom.properties are not the default. In
that they probably are not (username, password at least) you should make
one. The JDBC settings should match roller-custom.properties. IF your
permissions on the war and the directories are correct, I believe this
should take care of all the issues. 

Dave Johnson-8 wrote:
> 
> On Thu, Aug 7, 2008 at 11:44 AM, mclovis <mc...@elucidar.com> wrote:
>>
>> Ok here goes...
>> 1. In org.apache.roller.weblogger.ui.core.RollerContext
>>
>> The way code is currently written you will get a NULL pointer exception
>> that
>> will cause roller to NOT run because of the following..
> 
> ...snip...
> 
>> roller-custom.properties. So if you then change the code to :
>> String ctxPath ="";
>>        // get the *real* path to <context>/resources
>>        ctxPath= servletContext.getRealPath("/");
>>        //log.info(ctxPath);
>>        if(ctxPath!=null&&!ctxPath.endsWith(File.separator))
>>            ctxPath += File.separator + "resources";
>>        else
>>            ctxPath += "resources";
>> and change the roller-custom.properties to have a base.dir property to
>> something like your home directory and have the uploads and planecache
>> directories be in ${basedir}/roller_data/uploads, etc.
>> this takes care of the first issue. Furthermore, move the themes velocity
>> templates to a themes directory outside of the war also.
> 
> That all sounds good and suitable for a patch, once we figure this thing
> out...
> 
> 
>> If you do this and try again. You will then deploy properly until you try
>> to
>> access the index page of the roller project. You will then run into your
>> next issue:
>>
>> Page: Unexpected Exception Status Code     500
>> Message         An exception occurred processing JSP page /index.jsp at
>> line 31 28:
>> } else { 29: // dispatch to setup page 30: RequestDispatcher setuppage =
>> request.getRequestDispatcher("/roller-ui/setup.rol"); 31:
>> setuppage.forward(request, response); 32: } 33: 34: %> Stacktrace:
>> Type
>> Exception       Roller has encountered and logged an unexpected
>> exception.
>>
>> Catalina.out
>> java.lang.IllegalStateException: Roller Weblogger has not been
>> bootstrapped
>> yet at
>> org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger(WebloggerFactory.java:60)
>>  at
>> org.apache.roller.weblogger.ui.struts2.core.Setup.execute(Setup.java:60)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
> ...snip...
> 
>> It is at this point I was asking had anyone else started down this
>> path....
> 
> Is there an error message earlier in the logs? Something else must
> have gone wrong to cause that "not been bootstrapped" message.
> 
> - Dave
> 
> 

-- 
View this message in context: http://www.nabble.com/Running-Roller-as-a-Packed-WAR-tp18856261s12275p19013475.html
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Running Roller as a Packed WAR

Posted by Dave <sn...@gmail.com>.
On Thu, Aug 7, 2008 at 11:44 AM, mclovis <mc...@elucidar.com> wrote:
>
> Ok here goes...
> 1. In org.apache.roller.weblogger.ui.core.RollerContext
>
> The way code is currently written you will get a NULL pointer exception that
> will cause roller to NOT run because of the following..

...snip...

> roller-custom.properties. So if you then change the code to :
> String ctxPath ="";
>        // get the *real* path to <context>/resources
>        ctxPath= servletContext.getRealPath("/");
>        //log.info(ctxPath);
>        if(ctxPath!=null&&!ctxPath.endsWith(File.separator))
>            ctxPath += File.separator + "resources";
>        else
>            ctxPath += "resources";
> and change the roller-custom.properties to have a base.dir property to
> something like your home directory and have the uploads and planecache
> directories be in ${basedir}/roller_data/uploads, etc.
> this takes care of the first issue. Furthermore, move the themes velocity
> templates to a themes directory outside of the war also.

That all sounds good and suitable for a patch, once we figure this thing out...


> If you do this and try again. You will then deploy properly until you try to
> access the index page of the roller project. You will then run into your
> next issue:
>
> Page: Unexpected Exception Status Code     500
> Message         An exception occurred processing JSP page /index.jsp at line 31 28:
> } else { 29: // dispatch to setup page 30: RequestDispatcher setuppage =
> request.getRequestDispatcher("/roller-ui/setup.rol"); 31:
> setuppage.forward(request, response); 32: } 33: 34: %> Stacktrace:
> Type
> Exception       Roller has encountered and logged an unexpected exception.
>
> Catalina.out
> java.lang.IllegalStateException: Roller Weblogger has not been bootstrapped
> yet at
> org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger(WebloggerFactory.java:60)
>  at org.apache.roller.weblogger.ui.struts2.core.Setup.execute(Setup.java:60)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

...snip...

> It is at this point I was asking had anyone else started down this path....

Is there an error message earlier in the logs? Something else must
have gone wrong to cause that "not been bootstrapped" message.

- Dave

Re: Running Roller as a Packed WAR

Posted by mclovis <mc...@elucidar.com>.
Ok here goes...
1. In org.apache.roller.weblogger.ui.core.RollerContext 

The way code is currently written you will get a NULL pointer exception that
will cause roller to NOT run because of the following..


        
        // get the *real* path to <context>/resources
        String ctxPath= servletContext.getRealPath("/");
        //log.info(ctxPath);
        if(!ctxPath.endsWith(File.separator))
            ctxPath += File.separator + "resources";
        else
            ctxPath += "resources";

servletContext.getRealPath returns null if the war has not been unPacked.
The purpose of this class is to create the context that Roller works within.
It "discerns" it's context and uses any settings in
roller-custom.properties. So if you then change the code to :

String ctxPath ="";
        
        // get the *real* path to <context>/resources
        ctxPath= servletContext.getRealPath("/");
        //log.info(ctxPath);
        if(ctxPath!=null&&!ctxPath.endsWith(File.separator))
            ctxPath += File.separator + "resources";
        else
            ctxPath += "resources";
and change the roller-custom.properties to have a base.dir property to
something like your home directory and have the uploads and planecache
directories be in ${basedir}/roller_data/uploads, etc.
this takes care of the first issue. Furthermore, move the themes velocity
templates to a themes directory outside of the war also. 

If you do this and try again. You will then deploy properly until you try to
access the index page of the roller project. You will then run into your
next issue:

Page:
Unexpected Exception
Status Code 	500
Message 	An exception occurred processing JSP page /index.jsp at line 31 28:
} else { 29: // dispatch to setup page 30: RequestDispatcher setuppage =
request.getRequestDispatcher("/roller-ui/setup.rol"); 31:
setuppage.forward(request, response); 32: } 33: 34: %> Stacktrace:
Type 	
Exception 	Roller has encountered and logged an unexpected exception.

Catalina.out

java.lang.IllegalStateException: Roller Weblogger has not been bootstrapped
yet
        at
org.apache.roller.weblogger.business.WebloggerFactory.getWeblogger(WebloggerFactory.java:60)
        at
org.apache.roller.weblogger.ui.struts2.core.Setup.execute(Setup.java:60)
        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
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
        at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
        at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
        at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
        at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
        at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
        at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterce$
        at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
        at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
        at
org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.intercept(UIActionPrepareInterceptor.java:$
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
        at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

It is at this point I was asking had anyone else started down this path....


 

Allen Gilliland-3 wrote:
> 
> Can you be more specific about "there are code issues"?
> 
> That's a pretty vague statement and doesn't leave much to go on.
> 
> -- Allen
> 
> 
> mclovis wrote:
>> To be clear in this thread roller will be deployed to Tomcat as a war and
>> the
>> Host configuration will have the attribute unPackWars ="false" so that
>> roller will remain a war. 
>> 
>> 
>> Ryan de Laplante-2 wrote:
>>> I followed the 4.0 install instructions to create a .war file and 
>>> successfully deployed it to GlassFish V2 with no issues.
>>>
>>>
>>> mclovis wrote:
>>>> I am starting a new thread on this question because I asked the
>>>> question
>>>> incorrectly before and I hope to get new feedback. Currently If you run
>>>> Roller as a PACKED war there are code issues. You can start to change
>>>> the
>>>> code and configuration to overcome these issues. Has anyone had any
>>>> success
>>>> or thoughts on this? Thanks in advance.
>>>>   
>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Running-Roller-as-a-Packed-WAR-tp18856261s12275p18873470.html
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Running Roller as a Packed WAR

Posted by Allen Gilliland <Al...@Sun.COM>.
Can you be more specific about "there are code issues"?

That's a pretty vague statement and doesn't leave much to go on.

-- Allen


mclovis wrote:
> To be clear in this thread roller will be deployed to Tomcat as a war and the
> Host configuration will have the attribute unPackWars ="false" so that
> roller will remain a war. 
> 
> 
> Ryan de Laplante-2 wrote:
>> I followed the 4.0 install instructions to create a .war file and 
>> successfully deployed it to GlassFish V2 with no issues.
>>
>>
>> mclovis wrote:
>>> I am starting a new thread on this question because I asked the question
>>> incorrectly before and I hope to get new feedback. Currently If you run
>>> Roller as a PACKED war there are code issues. You can start to change the
>>> code and configuration to overcome these issues. Has anyone had any
>>> success
>>> or thoughts on this? Thanks in advance.
>>>   
>>
>>
> 

Re: Running Roller as a Packed WAR

Posted by mclovis <mc...@elucidar.com>.
To be clear in this thread roller will be deployed to Tomcat as a war and the
Host configuration will have the attribute unPackWars ="false" so that
roller will remain a war. 


Ryan de Laplante-2 wrote:
> 
> I followed the 4.0 install instructions to create a .war file and 
> successfully deployed it to GlassFish V2 with no issues.
> 
> 
> mclovis wrote:
>> I am starting a new thread on this question because I asked the question
>> incorrectly before and I hope to get new feedback. Currently If you run
>> Roller as a PACKED war there are code issues. You can start to change the
>> code and configuration to overcome these issues. Has anyone had any
>> success
>> or thoughts on this? Thanks in advance.
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Running-Roller-as-a-Packed-WAR-tp18856261s12275p18857307.html
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Running Roller as a Packed WAR

Posted by Ryan de Laplante <ry...@ijws.com>.
I followed the 4.0 install instructions to create a .war file and 
successfully deployed it to GlassFish V2 with no issues.


mclovis wrote:
> I am starting a new thread on this question because I asked the question
> incorrectly before and I hope to get new feedback. Currently If you run
> Roller as a PACKED war there are code issues. You can start to change the
> code and configuration to overcome these issues. Has anyone had any success
> or thoughts on this? Thanks in advance.
>