[opencms-dev] Publishing problems

Warrell Harries warrell.harries at gojobsite.co.uk
Thu Jun 7 14:28:56 CEST 2001


Dear whoever

I was having trouble with version 4.3.17 and a ClassCastException when the opencms servlet initializes and tries to cast the Sun Class Loader to a CmsClassLoader on Tomcat 3.2.1

If I run the opencmsboot stuff it's fine so I looked at the com.opencms.boot.OpenCmsHttpServlet source and find in line 80 that it instatiates a brand new CmsClassLoader and uses that with no problem. However the com.opencms.core.OpenCmsHttpServlet does the following in line 701 :-

CmsClassLoader loader = (CmsClassLoader) (getClass().getClassLoader());

This throws the exception 

java.lang.ClassCastException: sun.misc.Launcher$AppClassLoader
at com.opencms.core.OpenCmsHttpServlet.init(OpenCmsHttpServlet.java:701)
at com.opencms.boot.OpenCmsServlet.init(OpenCmsServlet.java:89)
at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)

I can't see a valid reason why it should prefer to cast the existing loader rather than instantiate a new CmsClassLoader. So I changed the offending line to :-

CmsClassLoader loader = new CmsClassLoader() ;

I hope this finds it's way into the release source.

I am also having trouble publishing due to the session problem e.g.

java.lang.NullPointerException
 at org.apache.tomcat.core.RequestImpl.getSession(RequestImpl.java:480)
 at org.apache.tomcat.facade.HttpServletRequestFacade.getSession(HttpServletRequestFacade.java:387)
 at com.opencms.file.CmsRequestContext.getSession(CmsRequestContext.java:173)
 at com.opencms.workplace.CmsAdminPublishProjectThread.run(CmsAdminPublishProjectThread.java:62)

appears in my stderr

I have seen discussion about this in the mail archive but no soluion. Please help me someone.

Regards

Warrell Harries

warrell.harries at gojobsite.co.uk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20010607/bdb4177d/attachment.htm>


More information about the opencms-dev mailing list