You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lukas Latz <lu...@gmx.de> on 2004/03/11 12:47:33 UTC

problems with

Hi List!

I'm trying to get started with struts (1.1) step by step.
I had a working frameset made from *.JSPs in Tomcat 3.23 (The JSPs don't
actually do anything at this stage, they're like static html).

Then I inserted the 

<html:base/>

tag in one of the JSPs, together with the

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

At first, my web.xml only had the

  <taglib>
    <taglib-uri>/tags/struts-bean</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/tags/struts-html</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/tags/struts-logic</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>

When that didn't work, I figured the actionServlet must probably be required
and added

  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

<servlet-mapping>
     <servlet-name>action</servlet-name>
     <url-pattern>/do/*</url-pattern>
</servlet-mapping>

The struts-config.xml is where it should be, but pretty empty, like this:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
</struts-config>

The Struts 1.1 libs , taglibs, and dtds are all where they should be, AFAIK
.
I figured, as at this stage I'm only using STRUTS in the one tag above, and
not actually invoking the ActionServlet, the app should work without setting
up any ActionForwards and so on.
Is that correct?

When Tomcat is started up, this is what happens:

11-Mar-2004 11:24:39 org.apache.struts.util.MessageResourcesFactory
createFactory
SEVERE: MessageResourcesFactory.createFactory
java.lang.ClassNotFoundException:
org.apache.struts.util.PropertyMessageResourcesFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
        at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
        at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
        at
org.apache.struts.util.RequestUtils.<clinit>(RequestUtils.java:134)
        at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
        at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
        at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
        at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
        at javax.servlet.GenericServlet.init(GenericServlet.java:258)
        at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
        at org.apache.tomcat.core.Handler.init(Handler.java:215)
        at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
        at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
        at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
        at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
11-Mar-2004 11:24:39 org.apache.struts.util.MessageResourcesFactory
createFactory
SEVERE: MessageResourcesFactory.createFactory
java.lang.ExceptionInInitializerError
        at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
        at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
        at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
        at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
        at javax.servlet.GenericServlet.init(GenericServlet.java:258)
        at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
        at org.apache.tomcat.core.Handler.init(Handler.java:215)
        at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
        at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
        at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
        at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
Caused by: java.lang.NullPointerException
        at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:577)
        at
org.apache.struts.util.RequestUtils.<clinit>(RequestUtils.java:134)
        ... 13 more
cannot load servlet name: action: null



Any clues?


-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: problems with

Posted by Lukas Latz <lu...@gmx.de>.
> Hello, Lukas:
>  
> Here's a simple script that can be helpful in these situations:
> +++++++++++++++++++++++++++++++++++++++++++
> for jar in `ls *jar`
> do
>   echo "checking $jar..."
>   jar tvf $jar | grep
> "org.apache.struts.util.PropertyMessageResourcesFactory"
> done
> +++++++++++++++++++++++++++++++++++++++++++
>  
> When I checked WEB-INF\lib under a struts-based web 
> application on my system,  it produced the following output:
> #################################################
> checking commons-beanutils.jar...
> checking commons-collections.jar...
> checking commons-digester.jar...
> checking commons-fileupload.jar...
> checking commons-lang.jar...
> checking commons-logging.jar...
> checking commons-validator.jar...
> checking jakarta-oro.jar...
> checking struts.jar...
>    749 Sun Jun 29 21:46:38 PDT 2003
> org/apache/struts/util/PropertyMessageResourcesFactory.class
> #####################################################
>  
> Perhaps you are missing struts.jar?
>  
> 
> btw:  if you are on Windows, you can download either Cygwin
> or uwin (if you prefer ksh)....
>  
> Cordially,
>  
> Oswald

Thanks for the script, Oswald!

I did manually check the presence of all the required stuff once tomcat had
unpacked the war file.
struts.jar is in WEB-INF/lib, together with all the other *.jar s from
struts 1.1, all the *.tld and *.dtd from struts 1.1 are in WEB-INF, and web.xml
and struts-config.xml are in WEB-INF, too.

I had actually downloaded the sources and looked at the
PropertyMessageResourcesFactory, but I couldn't figure out what it needs that's not there.

I suspect that some entries in either web.xml or in struts-config are
required that I didn't put in there, or maybe some properties file?

Kind regards

Lukas


-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: problems with

Posted by Oswald Campesato <oc...@yahoo.com>.
Hello, Lukas:
 
Here's a simple script that can be helpful in these situations:
+++++++++++++++++++++++++++++++++++++++++++
for jar in `ls *jar`
do
  echo "checking $jar..."
  jar tvf $jar | grep "org.apache.struts.util.PropertyMessageResourcesFactory"
done
+++++++++++++++++++++++++++++++++++++++++++
 
When I checked WEB-INF\lib under a struts-based web 
application on my system,  it produced the following output:
#################################################
checking commons-beanutils.jar...
checking commons-collections.jar...
checking commons-digester.jar...
checking commons-fileupload.jar...
checking commons-lang.jar...
checking commons-logging.jar...
checking commons-validator.jar...
checking jakarta-oro.jar...
checking struts.jar...
   749 Sun Jun 29 21:46:38 PDT 2003 org/apache/struts/util/PropertyMessageResourcesFactory.class
#####################################################
 
Perhaps you are missing struts.jar?
 

btw:  if you are on Windows, you can download either Cygwin
or uwin (if you prefer ksh)....
 
Cordially,
 
Oswald


Lukas Latz <lu...@gmx.de> wrote:
Hi List!

I'm trying to get started with struts (1.1) step by step.
I had a working frameset made from *.JSPs in Tomcat 3.23 (The JSPs don't
actually do anything at this stage, they're like static html).

Then I inserted the 



tag in one of the JSPs, together with the





At first, my web.xml only had the


/tags/struts-bean
/WEB-INF/struts-bean.tld


/tags/struts-html
/WEB-INF/struts-html.tld


/tags/struts-logic
/WEB-INF/struts-logic.tld


When that didn't work, I figured the actionServlet must probably be required
and added


action
org.apache.struts.action.ActionServlet


config


/WEB-INF/struts-config.xml


1



action
/do/*


The struts-config.xml is where it should be, but pretty empty, like this:


"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">



The Struts 1.1 libs , taglibs, and dtds are all where they should be, AFAIK
.
I figured, as at this stage I'm only using STRUTS in the one tag above, and
not actually invoking the ActionServlet, the app should work without setting
up any ActionForwards and so on.
Is that correct?

When Tomcat is started up, this is what happens:

11-Mar-2004 11:24:39 org.apache.struts.util.MessageResourcesFactory
createFactory
SEVERE: MessageResourcesFactory.createFactory
java.lang.ClassNotFoundException:
org.apache.struts.util.PropertyMessageResourcesFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
at
org.apache.struts.util.RequestUtils.(RequestUtils.java:134)
at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
11-Mar-2004 11:24:39 org.apache.struts.util.MessageResourcesFactory
createFactory
SEVERE: MessageResourcesFactory.createFactory
java.lang.ExceptionInInitializerError
at
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
at
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
Caused by: java.lang.NullPointerException
at
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:577)
at
org.apache.struts.util.RequestUtils.(RequestUtils.java:134)
... 13 more
cannot load servlet name: action: null



Any clues?


-- 
+++ NEU bei GMX und erstmalig in Deutschland: T�V-gepr�fter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster.