[opencms-dev] javax.servlet.ServletException: Resource loader error in file Query - URGENT

Trevor Lee Trevor.Lee at 4Loop.com.au
Tue Dec 30 02:27:01 CET 2003


Hi all,

I'm getting the Resource Loader error in file .. error message and i'm not
sure why. The path of the file in error does not have the /opencms/opencms/
prepended to it when it should. What has caused the /opencms/opencms/ being
dropped from the link in the error page returned?

The jsp in question is a link on a page that displays the news items when i
click on it. I also have a link that logs the user into opencms using the
opencms api.

The case where it doesnt work is when i click on the opencms login link
(which successfully spawns another window with the opencms explorer view)
and then click on the jsp link to display the news item.

Any help in this matter would be greatly appreciated.

Cheers
Trevor
==============
Below is the jsp for logging in:
<%@ page import="java.util.*, com.opencms.core.*,
com.opencms.file.*,com.opencms.flex.jsp.*,
com.opencms.workplace.*" %>
<jsp:useBean id="cms" class="com.opencms.flex.jsp.CmsJspActionElement"
scope="page" />
<%
    cms.init(pageContext, request, response);
    CmsObject cmso = cms.getCmsObject();

    String forward = "/opencms/opencms/system/workplace/action/index.html";

    try
    {
        if (sUsername.equalsIgnoreCase("admin"))
            cmso.loginUser(sUsername, "admin");
        else
            cmso.loginUser(sUsername, sPassword);

        CmsUser user = cmso.readUser(sUsername, sPassword);
        if (user != null)
        {
            // retrieve the startup project settings for the user.
            Hashtable info =
(Hashtable)user.getAdditionalInfo(cmso.C_ADDITIONAL_INFO_STARTSETTINGS);
            Integer i = (Integer)info.get(cmso.C_START_PROJECT);

            if (i.intValue() == 4)
                cmso.getRequestContext().setCurrentProject(4); //set the
start up project to offline

            I_CmsSession old_session =
cmso.getRequestContext().getSession(false);
            if (old_session != null)
                old_session.invalidate();

            // retrieve the startup view and create a temporary session
object
            String view = (String)info.get(cmso.C_START_VIEW);
            I_CmsSession cms_session =
cmso.getRequestContext().getSession(true);
            // set the default view to the explorer view.
            if (view == null)
            {
                view="/system/workplace/action/explorer.html";
            }

            cms_session.putValue(I_CmsWpConstants.C_PARA_VIEW, view);

        }
        // redirect to opencms
        response.sendRedirect(forward);
    }
    catch (CmsException cmse)
    {
        System.out.println("### opencms login_user - can not login user: " +
stemp);
    }
%>

=============
Below is a portion of the jsp for displaying the news:

<%@ page import="java.util.*, com.opencms.flex.jsp.*,
com.opencms.modules.homepage.news.*" %>
<jsp:useBean id="mycms" class="com.opencms.flex.jsp.CmsJspActionElement"
scop="page" />
<?xml version="1.0" encoding="UTF-8"?>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<jsp:useBean id="cmsUserLock" scope="application" class="java.lang.Object"
/>

java.util.HashMap includeParameters = new java.util.HashMap();
mycms.init(pageContext, request, response);
includeParameters.clear();
includeParameters.put("channel", "1");
mycms.include("news.jsp",null,includeParameters);


==============

below is the error message
javax.servlet.ServletException: Resource loader error in file
'/swm/auth/news/swmNews.jsp'

Root cause:
org.apache.jasper.JasperException
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
	at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:575)
	at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:498)
	at
com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexRequestDispat
cher.java:180)
	at com.opencms.flex.CmsJspLoader.service(CmsJspLoader.java:955)
	at
com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexRequestDispat
cher.java:268)
	at com.opencms.flex.CmsJspLoader.load(CmsJspLoader.java:567)
	at com.opencms.flex.CmsJspLoader.initlaunch(CmsJspLoader.java:235)
	at com.opencms.core.OpenCms.showResource(OpenCms.java:956)
	at com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.java:310)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:400)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:549)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:666)
	at java.lang.Thread.run(Thread.java:536)

--------------- End of root cause.




More information about the opencms-dev mailing list