You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by An...@mn.man.de on 2002/07/04 11:03:40 UTC
Antwort: RE: Antwort: StrutsTestCase - setConfigFile() - LinkageError
thanks for your answer first ...
I did not understand the java-doc for setConfigFile() like this.
o.k. - the File has to be on the classpath anyway ...
I put the struts-config.xml in the classes directory (which is in the
classpath) because I can not
set nested directories in the classpath in my ide (websphere app.
developer).
Now I print my environment from the setup() method looking for the
classpath ... it is
java.class.path =
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\classes
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\ApacheXerces_r1-4-4.jar;
C:\Programme\IBM\Application
Developer\plugins\com.ibm.etools.websphere.runtime\lib\j2ee.jar;
C:\Programme\IBM\Application
Developer\plugins\com.ibm.etools.websphere.runtime\lib\webcontainer.jar;
C:\Programme\IBM\Application
Developer\plugins\com.ibm.etools.websphere.runtime\lib\ivjejb35.jar;
C:\Programme\IBM\Application
Developer\plugins\com.ibm.etools.websphere.runtime\lib\websphere.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaCactus_r1-2_v1-0.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaStruts_r1-0-1_v1-1.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\SourceForgeJUnit_r3-7_v1-0.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaLog4J_r1-1-3.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JavaMail_r1-1-3.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JavaActivation_r1-0-1.jar;
C:\Programme\IBM\Application
Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JDom_r1-0beta8.jar;
should be fine
As described by Oren Gros in
http://marc.theaimsgroup.com/?l=struts-user&m=102570855720187&w=2
I get an LinkageError now
and my JUnit Swing App is crashing.
###
public void setUp() throws Exception
{
cat.debug("setUp() ... start");
// never forget this!
super.setUp();
java.util.Iterator it = System.getProperties().keySet
().iterator();
while(it.hasNext()) {
String key = (String) it.next();
System.out.println( key + " : " + (String)
System.getProperties().get(key));
}
// Missing configuration resource for path ...
// this.setConfigFile("/Programme/IBM/Application
Developer/workspace/MANTemplateWebApp/webApplication/WEB-INF/struts-config.xml");
// java.lang.NullPointerException
this.setConfigFile("/struts-config.xml");
cat.debug("setUp() ... finished");
}
###
Any further ideas? Thanks for your time
A. Grimm
****************************************************
MAN Nutzfahrzeuge AG
Anton Grimm
Abt. IDP (SoftwareProduktionsumgebungen)
Dachauerstr.667
80995 München
Tel.: 089/1580-1054
Fax: 089/1580-911054
E-Mail: Anton_Grimm@mn.man.de
****************************************************
"Kevin Henrikson"
<kevin.henrikson@op An: "Struts Users Mailing List" <st...@jakarta.apache.org>
enwave.com> Kopie:
Thema: RE: Antwort: StrutsTestCase - setConfigFile()
04.07.2002 09:25
Bitte antworten an
"Struts Users
Mailing List"
StrutsTestCase requires your WEB-INF/struts-config.xml to be in the
classpath.
So make sure the directory above WEB-INF is in your classpath. Then by
default
it will find your file. If you specify a file or path in the setConfigFile
()
method that too must be in the classpath.
-kevin
> -----Original Message-----
> From: Anton_Grimm@mn.man.de [mailto:Anton_Grimm@mn.man.de]
> Sent: Thursday, July 04, 2002 12:16 AM
> To: Struts Users Mailing List
> Subject: Antwort: StrutsTestCase - setConfigFile()
>
>
>
> forgot about this: I am using Struts 1.0.1 and StrutsTestCase 1.6
>
> ###
>
> I did read the faq and searched the archive, but I still get the
following
> error ...
>
> I played around with the method
>
> setConfigFile(pathname);
>
> in my MockStrutsTestCase
> and always get a
> Missing Resource ... /WEB-INF/struts-config.xml
> or a
> NullPointerException
>
> ###
> public void setUp() throws Exception
> {
> cat.debug("setUp() ... start");
>
> // never forget this!
> super.setUp();
>
> // Missing configuration resource for path ...
> this.setConfigFile("/Programme/IBM/Application
> Developer/workspace/MANTemplateWebApp/webApplication/WEB-INF/struts-co
> nfig.xml"
>
> );
>
> // java.lang.NullPointerException
> // this.setConfigFile("./struts-config.xml");
>
> cat.debug("setUp() ... finished");
> }
> ###
>
> Any idea - help is very much appreciated!
>
> Toni
>
> ****************************************************
> MAN Nutzfahrzeuge AG
> Anton Grimm
> Abt. IDP (SoftwareProduktionsumgebungen)
> Dachauerstr.667
> 80995 München
>
> Tel.: 089/1580-1054
> Fax: 089/1580-911054
> E-Mail: Anton_Grimm@mn.man.de
> ****************************************************
>
>
> --
> To unsubscribe, e-mail: <
mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>
>
>
>
--
To unsubscribe, e-mail: <
mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Antwort: RE: Antwort: StrutsTestCase - setConfigFile() - LinkageError
Posted by Tadashi Ishikawa <is...@wink.tis.co.jp>.
I tested CactusStrutsTestCase *NOT* MockStrutsTestCase earlier.
public class TestLoginAction extends CactusStrutsTestCase {
public void setUp() throws Exception {
super.setUp();
setConfigFile("/WEB-INF/conf/struts-config.xml");
}
It worked good in WebLogic6.1 and Tomcat4.0.3.
If you're using MockStrutsTestCase, you don't need any Web container.
You only need to set the CLASSPATH to point to the
/Programme/IBM/ApplicationDeveloper/workspace/MANTemplateWebApp/webApplication
directory along with any other needed jar files.
Hope this helps.
Anton_Grimm@mn.man.de wrote:
>thanks for your answer first ...
>
>I did not understand the java-doc for setConfigFile() like this.
>o.k. - the File has to be on the classpath anyway ...
>
>I put the struts-config.xml in the classes directory (which is in the
>classpath) because I can not
>set nested directories in the classpath in my ide (websphere app.
>developer).
>
>Now I print my environment from the setup() method looking for the
>classpath ... it is
>
> java.class.path =
>
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\classes
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\ApacheXerces_r1-4-4.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\j2ee.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\webcontainer.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\ivjejb35.jar;
>C:\Programme\IBM\Application
>Developer\plugins\com.ibm.etools.websphere.runtime\lib\websphere.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaCactus_r1-2_v1-0.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaStruts_r1-0-1_v1-1.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\SourceForgeJUnit_r3-7_v1-0.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JakartaLog4J_r1-1-3.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JavaMail_r1-1-3.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JavaActivation_r1-0-1.jar;
>C:\Programme\IBM\Application
>Developer\workspace\MANTemplateWebApp\webApplication\WEB-INF\lib\JDom_r1-0beta8.jar;
>
>should be fine
>
>As described by Oren Gros in
> http://marc.theaimsgroup.com/?l=struts-user&m=102570855720187&w=2
>I get an LinkageError now
>and my JUnit Swing App is crashing.
>
>###
>
> public void setUp() throws Exception
> {
> cat.debug("setUp() ... start");
>
> // never forget this!
> super.setUp();
>
> java.util.Iterator it = System.getProperties().keySet
>().iterator();
>
> while(it.hasNext()) {
> String key = (String) it.next();
> System.out.println( key + " : " + (String)
>System.getProperties().get(key));
> }
> // Missing configuration resource for path ...
> // this.setConfigFile("/Programme/IBM/Application
>Developer/workspace/MANTemplateWebApp/webApplication/WEB-INF/struts-config.xml");
>
> // java.lang.NullPointerException
> this.setConfigFile("/struts-config.xml");
>
> cat.debug("setUp() ... finished");
> }
>
>###
>
>Any further ideas? Thanks for your time
>
>A. Grimm
>
>****************************************************
>MAN Nutzfahrzeuge AG
>Anton Grimm
>Abt. IDP (SoftwareProduktionsumgebungen)
>Dachauerstr.667
>80995 München
>
>Tel.: 089/1580-1054
>Fax: 089/1580-911054
>E-Mail: Anton_Grimm@mn.man.de
>****************************************************
>
>
>
> "Kevin Henrikson"
> <kevin.henrikson@op An: "Struts Users Mailing List" <st...@jakarta.apache.org>
> enwave.com> Kopie:
> Thema: RE: Antwort: StrutsTestCase - setConfigFile()
> 04.07.2002 09:25
> Bitte antworten an
> "Struts Users
> Mailing List"
>
>
>
>
>
>
>StrutsTestCase requires your WEB-INF/struts-config.xml to be in the
>classpath.
>So make sure the directory above WEB-INF is in your classpath. Then by
>default
>it will find your file. If you specify a file or path in the setConfigFile
>()
>method that too must be in the classpath.
>
>-kevin
>
>>-----Original Message-----
>>From: Anton_Grimm@mn.man.de [mailto:Anton_Grimm@mn.man.de]
>>Sent: Thursday, July 04, 2002 12:16 AM
>>To: Struts Users Mailing List
>>Subject: Antwort: StrutsTestCase - setConfigFile()
>>
>>
>>
>>forgot about this: I am using Struts 1.0.1 and StrutsTestCase 1.6
>>
>>###
>>
>>I did read the faq and searched the archive, but I still get the
>>
>following
>
>>error ...
>>
>>I played around with the method
>>
>> setConfigFile(pathname);
>>
>>in my MockStrutsTestCase
>>and always get a
>> Missing Resource ... /WEB-INF/struts-config.xml
>>or a
>> NullPointerException
>>
>>###
>> public void setUp() throws Exception
>> {
>> cat.debug("setUp() ... start");
>>
>> // never forget this!
>> super.setUp();
>>
>> // Missing configuration resource for path ...
>> this.setConfigFile("/Programme/IBM/Application
>>Developer/workspace/MANTemplateWebApp/webApplication/WEB-INF/struts-co
>>nfig.xml"
>>
>>);
>>
>> // java.lang.NullPointerException
>>// this.setConfigFile("./struts-config.xml");
>>
>> cat.debug("setUp() ... finished");
>> }
>>###
>>
>>Any idea - help is very much appreciated!
>>
>>Toni
>>
>>****************************************************
>>MAN Nutzfahrzeuge AG
>>Anton Grimm
>>Abt. IDP (SoftwareProduktionsumgebungen)
>>Dachauerstr.667
>>80995 München
>>
>>Tel.: 089/1580-1054
>>Fax: 089/1580-911054
>>E-Mail: Anton_Grimm@mn.man.de
>>****************************************************
>>
>>
>>--
>>To unsubscribe, e-mail: <
>>
>mailto:struts-user-unsubscribe@jakarta.apache.org>
>
>>For additional commands, e-mail: <
>>
>mailto:struts-user-help@jakarta.apache.org>
>
>>
>>
>
>
>
>
>--
>To unsubscribe, e-mail: <
>mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <
>mailto:struts-user-help@jakarta.apache.org>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>