maven+cactus (Couldn't find tools.jar (needed for JSP compilation))

2005-06-02 Thread sheep
hi all

when I do cactus:test I meet this problem(Couldn't find tools.jar (needed 
for JSP compilation)).Vincent say it's a bug of cactus then I see the source 
code of cactus1.7 i use.
find code in AbstractJavaContainer.java from line 184~201
//
/**
 * Returns the file containing the JDK tools (such as the compiler). This
 * method must not be called on Mac OSX as there is no tools.jar file on
 * that platform (everything is included in classes.jar).
 * 
 * @return The tools.jar file
 * @throws FileNotFoundException If the tools.jar file could not be found
 */
protected final File getToolsJar() throws FileNotFoundException
{
String javaHome = System.getProperty(java.home); 
File toolsJar = new File(javaHome, ../lib/tools.jar);
if (!toolsJar.isFile())
{
throw new FileNotFoundException(toolsJar.getAbsolutePath());
}
return toolsJar;
}
//
this is a simple test code for getToolsJar()
//-TestGetTool.java-
/**
 *sheep test cactus's getToolsJar (temp delete when test over)
 */
import java.io.File;
import java.io.FileNotFoundException;
public class TestGetTool
{

 protected  File getToolsJar() throws FileNotFoundException
 {
  String javaHome = System.getProperty(java.home); 
  System.out.println(java.home: + javaHome);
 File toolsJar = new File(javaHome, ../lib/tools.jar);
 
 if (!toolsJar.isFile())
 {
   throw new FileNotFoundException(toolsJar.getAbsolutePath());
 }
 return toolsJar;
 }
 //sheep: a simple test for getToolJar
 public static void main(String[] args) throws FileNotFoundException
 {
  //System.out.println(getProperty(java.home): + 
System.getProperty(java.home));
 
  System.out.println(new TestGetTool().getToolsJar());
 }
}
//
the result is:
//
java.home:C:\Program Files\Java\jre1.5.0_02
Exception in thread main java.io.FileNotFoundException: C:\Program 
Files\Java\jre1.5.0_02\..\lib\tools.jar
at TestGetTool.getToolsJar(TestGetTool.java:19)
at TestGetTool.main(TestGetTool.java:28)
//
here cactus want to find tools.jar in C:\Program 
Files\Java\jre1.5.0_02\..\lib\tools.jar
but the real path is : C:\Program Files\Java\jre1.5.0_02\..\lib\tools.jar


cactus plug for maven is the latest.. : maven plugin:download 
-DartifactId=cactus-maven -DgroupId=cactus -Dversion=1.7
what should I do for this problem?

thanks

sheep


Re: maven+cactus (Couldn't find tools.jar (needed for JSP compilation))

2005-06-02 Thread sheep
I'm sorry I have a wrong at:
here cactus want to find tools.jar in C:\Program 
Files\Java\jre1.5.0_02\..\lib\tools.jar
 but the real path is : C:\Program Files\Java\jre1.5.0_02\..\lib\tools.jar

//---the right is-
here cactus want to find tools.jar in C:\Program 
Files\Java\jre1.5.0_02\..\lib\tools.jar
 but the real path is : C:\Program Files\Java\jre1.5.0_02\lib\tools.jar





/

- Original Message - 
From: sheep [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Cactus Users List cactus-user@jakarta.apache.org
Sent: Thursday, June 02, 2005 2:11 PM
Subject: maven+cactus (Couldn't find tools.jar (needed for JSP compilation))


 hi all
 
 when I do cactus:test I meet this problem(Couldn't find tools.jar (needed 
 for JSP compilation)).Vincent say it's a bug of cactus then I see the source 
 code of cactus1.7 i use.
 find code in AbstractJavaContainer.java from line 184~201
 //
 /**
  * Returns the file containing the JDK tools (such as the compiler). This
  * method must not be called on Mac OSX as there is no tools.jar file on
  * that platform (everything is included in classes.jar).
  * 
  * @return The tools.jar file
  * @throws FileNotFoundException If the tools.jar file could not be found
  */
 protected final File getToolsJar() throws FileNotFoundException
 {
 String javaHome = System.getProperty(java.home); 
 File toolsJar = new File(javaHome, ../lib/tools.jar);
 if (!toolsJar.isFile())
 {
 throw new FileNotFoundException(toolsJar.getAbsolutePath());
 }
 return toolsJar;
 }
 //
 this is a simple test code for getToolsJar()
 //-TestGetTool.java-
 /**
  *sheep test cactus's getToolsJar (temp delete when test over)
  */
 import java.io.File;
 import java.io.FileNotFoundException;
 public class TestGetTool
 {
 
  protected  File getToolsJar() throws FileNotFoundException
  {
   String javaHome = System.getProperty(java.home); 
   System.out.println(java.home: + javaHome);
  File toolsJar = new File(javaHome, ../lib/tools.jar);
  
  if (!toolsJar.isFile())
  {
throw new FileNotFoundException(toolsJar.getAbsolutePath());
  }
  return toolsJar;
  }
  //sheep: a simple test for getToolJar
  public static void main(String[] args) throws FileNotFoundException
  {
   //System.out.println(getProperty(java.home): + 
 System.getProperty(java.home));
  
   System.out.println(new TestGetTool().getToolsJar());
  }
 }
 //
 the result is:
 //
 java.home:C:\Program Files\Java\jre1.5.0_02
 Exception in thread main java.io.FileNotFoundException: C:\Program 
 Files\Java\jre1.5.0_02\..\lib\tools.jar
 at TestGetTool.getToolsJar(TestGetTool.java:19)
 at TestGetTool.main(TestGetTool.java:28)
 //
 here cactus want to find tools.jar in C:\Program 
 Files\Java\jre1.5.0_02\..\lib\tools.jar
 but the real path is : C:\Program Files\Java\jre1.5.0_02\..\lib\tools.jar
 
 
 cactus plug for maven is the latest.. : maven plugin:download 
 -DartifactId=cactus-maven -DgroupId=cactus -Dversion=1.7
 what should I do for this problem?
   
   thanks
   
   sheep
 

Re: Cactus + maven

2005-06-02 Thread sheep
hi.
you should set cactus.contextURL = http://lcoalhost:8080/test-cactus in 
cactus.properties and put it in WEB/classes folder,if you don't have a folder 
named classes.you can put it in you  source code folder .good luck


sheep
- Original Message - 
From: Flávio Silva [EMAIL PROTECTED]
To: cactus-user@jakarta.apache.org
Sent: Wednesday, June 01, 2005 4:05 AM
Subject: Cactus + maven


 Hi,
 
 I'm a new maven user and I getting the above error when run cactus
 tests. I have to configure the system property 'contextURL' or the
 cactus (or maven) will automatically configure it?
 
 I've already tried set
 'cactus.contextURL=http://localhost:8080/test-cactus' on my
 build.properties but it didn't work.
 
 Someone has a tutorial or a hint? Tanks,
 
 Flávio
 
 Missing Cactus property [cactus.contextURL]
 org.apache.cactus.util.ChainedRuntimeException: Missing Cactus
 property [cactus.contextURL]
 at 
 org.apache.cactus.internal.configuration.BaseConfiguration.getContextURL(BaseConfiguration.java:59)
 at 
 org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL_aroundBody0(AbstractWebConfiguration.java:46)
 at 
 org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL_aroundBody1$advice(AbstractWebConfiguration.java:206)
 at 
 org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL(AbstractWebConfiguration.java)
 at 
 org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:159)
 at 
 org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:80)
 at 
 org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:206)
 at 
 org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
 at 
 org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebTest(HttpProtocolHandler.java:159)
 at 
 org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody0(HttpProtocolHandler.java:80)
 at 
 org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody1$advice(HttpProtocolHandler.java:206)
 at 
 org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest(HttpProtocolHandler.java)
 at 
 org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:144)
 at 
 org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCactusTestCase.java:215)
 at 
 org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTestCase.java:133)
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

where to placed cactus.properties

2005-06-01 Thread sheep
hi
I read some articles about cactus but i was confuse about CLASSPATH 
//

Cactus looks for this information in a file called cactus.properties, which 
must be placed somewhere in the CLASSPATH on the client side. 
//
here CLASSPATH means java classpath or some other place ? help me!!!

Re: maven + cactus problem (Missing Cactus property [cactus.contextURL] but I have set cactus.contextURL in cactus.properties)

2005-06-01 Thread sheep
hi.Vincent
this is the point confuse me. my work environment is: eclipse + maven + 
cactus.but when I run  maven cactus:test or maven test
I get the same result .all I can see is [junit] but not [cactus]. :(



- Original Message - 
From: Vincent Massol [EMAIL PROTECTED]
To: 'Cactus Users List' cactus-user@jakarta.apache.org
Sent: Wednesday, June 01, 2005 5:04 PM
Subject: RE: maven + cactus problem (Missing Cactus property 
[cactus.contextURL] but I have set cactus.contextURL in cactus.properties)


 Hi sheep,
 
 You don't need this file if you're using the Maven plugin for Cactus.
 
 You should read
 http://jakarta.apache.org/cactus/integration/maven/using.html. That's all
 you should need.
 
 Thanks
 -Vincent
 
  -Original Message-
  From: sheep [mailto:[EMAIL PROTECTED]
  Sent: mercredi 1 juin 2005 05:38
  To: users@maven.apache.org; cactus-user@jakarta.apache.org
  Subject: maven + cactus problem (Missing Cactus property
  [cactus.contextURL] but I have set cactus.contextURL in cactus.properties)
 
 [snip]
 
 
 
 
 
 
 _ 
 Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, 
 photos et vidéos ! 
 Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

Re: maven + cactus problem (Missing Cactus property [cactus.contextURL] but I have set cactus.contextURL in cactus.properties)

2005-06-01 Thread sheep
hi.
here is the maven cactus:test run result
//--
build:start:

cactus:check-plugin-dependencies:

cactus:init:

cactus:test:
cactus:check-plugin-dependencies:

cactus:init:
Overriding previous definition of reference to cactus.classpath
Overriding previous definition of reference to cactus.scanner.classpath

cactus:init-report:

java:prepare-filesystem:

java:compile:
[echo] Compiling to F:\sheep\workspace\test/target/classes
[echo] 
==

  NOTE: Targetting JVM 1.5, classes
  will not run on earlier JVMs

==
  
Tag library requested that is not present: 'license' in plugin: 
'maven-war-plugin-1.6.1'

cactus:compile:

cactus:cactifywar:
war:init:

war:war-resources:
[copy] Copying 1 file to F:\sheep\workspace\test\target\servlet\WEB-INF

java:prepare-filesystem:

java:compile:
[echo] Compiling to F:\sheep\workspace\test/target/classes
[echo] 
==

  NOTE: Targetting JVM 1.5, classes
  will not run on earlier JVMs

==
  

java:jar-resources:

test:prepare-filesystem:

test:test-resources:

test:compile:

test:test:
[junit] Running servlet.TestAdminServlet
  //sheep add start : I run maven cactus:test  here it may [cactus] but 
[junit]  //sheep add end
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2.313 sec
[junit] [ERROR] TEST servlet.TestAdminServlet FAILED

BUILD FAILED
File.. C:\Documents and 
Settings\Administrator\.maven\cache\maven-test-plugin-1.6.2\plugin.jelly
Element... fail
Line.. 181
Column 54
There were test failures.
Total time: 14 seconds
Finished at: Wed Jun 01 17:16:54 CST 2005

//--
- Original Message - 
From: Vincent Massol [EMAIL PROTECTED]
To: 'Cactus Users List' cactus-user@jakarta.apache.org
Sent: Wednesday, June 01, 2005 5:04 PM
Subject: RE: maven + cactus problem (Missing Cactus property 
[cactus.contextURL] but I have set cactus.contextURL in cactus.properties)


 Hi sheep,
 
 You don't need this file if you're using the Maven plugin for Cactus.
 
 You should read
 http://jakarta.apache.org/cactus/integration/maven/using.html. That's all
 you should need.
 
 Thanks
 -Vincent
 
  -Original Message-
  From: sheep [mailto:[EMAIL PROTECTED]
  Sent: mercredi 1 juin 2005 05:38
  To: users@maven.apache.org; cactus-user@jakarta.apache.org
  Subject: maven + cactus problem (Missing Cactus property
  [cactus.contextURL] but I have set cactus.contextURL in cactus.properties)
 
 [snip]
 
 
 
 
 
 
 _ 
 Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, 
 photos et vidéos ! 
 Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

maven + cactus problem (Missing Cactus property [cactus.contextURL] but I have set cactus.contextURL in cactus.properties)

2005-05-31 Thread sheep
hi.
   I have a problem when i do a servlet test anybody who can help me.
//-
   maven+cactus do servlet test.but it always report miss cactus.contextURL.I 
put cactus.contextURL=http://localhost:8080/test in cactus.properties and 
System.setProperty(cactus.contextURL,http://localhost:8080/test); in 
Test***() method but it seem no work.what place should i placed this property. 
:( maybe i can put cactus.properties to other palce ?

//-error 
message--
Testsuite: servlet.TestAdminServlet
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.801 sec

Testcase: testGetCommandOK(servlet.TestAdminServlet): Caused an ERROR
Missing Cactus property [cactus.contextURL]
org.apache.cactus.util.ChainedRuntimeException: Missing Cactus property 
[cactus.contextURL]
 at 
org.apache.cactus.internal.configuration.BaseConfiguration.getContextURL(BaseConfiguration.java:59)
 at 
org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL_aroundBody0(AbstractWebConfiguration.java:46)
 at 
org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL_aroundBody1$advice(AbstractWebConfiguration.java:306)
 at 
org.apache.cactus.internal.configuration.AbstractWebConfiguration.getRedirectorURL(AbstractWebConfiguration.java)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:159)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:80)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:306)
 at 
org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebTest(HttpProtocolHandler.java:159)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody0(HttpProtocolHandler.java:80)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody1$advice(HttpProtocolHandler.java:306)
 at 
org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest(HttpProtocolHandler.java)
 at 
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:144)
 at 
org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCactusTestCase.java:215)
 at 
org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTestCase.java:133)
//
//-my work env dir:(eclipse + maven + 
cactus)-
  .classpath
  .project
  build.properties
  cactus.logging.config
  cactus.properties
  logging_client.properties
  logging_server.properties
  project.properties
  project.xml

.settings
  org.eclipse.jdt.core.prefs

bin
  .project

src
  java
servlet
AdminServlet.class
AdminServlet.java
  
  test-cactus
servlet
TestAdminServlet.class
TestAdminServlet.java
  
  webapp
  lib
aspectjrt-1.2.1.jar
cactus-1.7.jar
cactus-ant-1.7.jar
cactus.properties
commons-httpclient-2.0.2.jar
commons-logging-1.0.4.jar
httpunit-1.6.jar
jasper-compiler-4.1.30.jar
jasper-runtime-4.1.30.jar
junit-3.8.1.jar
nekohtml-0.9.1.jar
org.mortbay.jetty-4.2.17.jar
servletapi-2.3.jar
  
  WEB-INF
  cactus-web.xml
  web.xml

target
classes
  servlet
  AdminServlet.class

servlet
  lib
aspectjrt-1.2.1.jar
cactus-1.7.jar
cactus-ant-1.7.jar
cactus.properties
commons-httpclient-2.0.2.jar
commons-logging-1.0.4.jar
httpunit-1.6.jar
jasper-compiler-4.1.30.jar
jasper-runtime-4.1.30.jar
junit-3.8.1.jar
nekohtml-0.9.1.jar
org.mortbay.jetty-4.2.17.jar
servletapi-2.3.jar
  
  WEB-INF
  cactus-web.xml
  web.xml

test-cactus-classes
  servlet
  TestAdminServlet.class

test-cactus-reports
  resin2x
test-classes
  servlet
  TestAdminServlet.class

test-reports
TEST-servlet.TestAdminServlet.txt
TEST-servlet.TestAdminServlet.xml