List Info

Thread: jspc precompiler error




jspc precompiler error
user name
2007-11-05 10:08:38
hi,

i have a difficult problem with precompiling jsp with
jspc-maven-plugin 
(v1.4.6)

i get this error:
[INFO] [jspc:compile {execution: jspc}]
java.lang.NumberFormatException: For input string:
"$" 
java.lang.NumberFormatException.forInputString(NumberFormatE
xception.java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.valueOf(Integer.java:553)
[...]


this is my jspc pom snippet

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jspc-maven-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
					<javaEncoding>UTF-8</javaEncoding>
				</configuration>
				<executions>
					<execution>
						<id>jspc</id>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
  [...]
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.1.2</version>
		</dependency>
		<dependency>
			<groupId>taglibs</groupId>
			<artifactId>standard</artifactId>
			<version>1.1.2</version>
		</dependency>

this is my jsp file

<?xml version="1.0" encoding="UTF-8"
?>
<jsp:root xmlns="http://www.w3.org/
1999/xhtml"
	xmlns:jsp="http://java.sun.co
m/JSP/Page"
	xmlns:c="http://java.s
un.com/jsp/jstl/core" version="2.0">

	<jsp:directive.page
contentType="text/html;charset=utf-8" />

	<c:forEach var="i" begin="1"
end="$">
		<c:out value="$" />
	</c:forEach>

</jsp:root>

To track down the error i created a second project with this
pom.xml 
(complete) and just this jsp file in src/main/webapp and a
minimal web.xml 
and everything works even without 

<?xml version="1.0"
encoding="UTF-8"?>
<project>
	<modelVersion>4.0.0</modelVersion>
	<groupId>jspc</groupId>
	<artifactId>jspc</artifactId>
	<packaging>war</packaging>
	<version>0.0.1</version>
	<description></description>
	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jspc-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>jspc</id>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

if i add dependencies to this pom it doesnt work anymore:

	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.1.2</version>
		</dependency>
		<dependency>
			<groupId>taglibs</groupId>
			<artifactId>standard</artifactId>
			<version>1.1.2</version>
		</dependency>
	</dependencies>

i guess my understanding of jspc is entirly wrong. Can
someone help me 
explaining what went wrong and how to fix it?

kind regards,
janning


------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribemaven.apache.org
For additional commands, e-mail: users-helpmaven.apache.org


Re: jspc precompiler error
user name
2007-11-05 11:09:33
I'm not sure about the solution to your problem, but you may
want to try 
using the Jetty jspc plugin, rather than the Codehaus
one...

http://www.
mortbay.org/jspc-maven-plugin/

mljvplanwerk6.de wrote:
> hi,
>
> i have a difficult problem with precompiling jsp with
jspc-maven-plugin 
> (v1.4.6)
>
> i get this error:
> [INFO] [jspc:compile {execution: jspc}]
> java.lang.NumberFormatException: For input string:
"$" 
>
java.lang.NumberFormatException.forInputString(NumberFormatE
xception.java:48)
>         at
java.lang.Integer.parseInt(Integer.java:447)
>         at java.lang.Integer.valueOf(Integer.java:553)
> [...]
>
>
> this is my jspc pom snippet
>
> 			<plugin>
> 				<groupId>org.codehaus.mojo</groupId>
>
				<artifactId>jspc-maven-plugin</artifactId>
> 				<configuration>
> 					<source>1.5</source>
> 					<target>1.5</target>
> 					<javaEncoding>UTF-8</javaEncoding>
> 				</configuration>
> 				<executions>
> 					<execution>
> 						<id>jspc</id>
> 						<goals>
> 							<goal>compile</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
>   [...]
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.5</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>jstl</artifactId>
> 			<version>1.1.2</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>taglibs</groupId>
> 			<artifactId>standard</artifactId>
> 			<version>1.1.2</version>
> 		</dependency>
>
> this is my jsp file
>
> <?xml version="1.0"
encoding="UTF-8" ?>
> <jsp:root xmlns="http://www.w3.org/
1999/xhtml"
> 	xmlns:jsp="http://java.sun.co
m/JSP/Page"
> 	xmlns:c="http://java.s
un.com/jsp/jstl/core" version="2.0">
>
> 	<jsp:directive.page
contentType="text/html;charset=utf-8" />
>
> 	<c:forEach var="i" begin="1"
end="$">
> 		<c:out value="$" />
> 	</c:forEach>
>
> </jsp:root>
>
> To track down the error i created a second project with
this pom.xml 
> (complete) and just this jsp file in src/main/webapp
and a minimal web.xml 
> and everything works even without 
>
> <?xml version="1.0"
encoding="UTF-8"?>
> <project>
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>jspc</groupId>
> 	<artifactId>jspc</artifactId>
> 	<packaging>war</packaging>
> 	<version>0.0.1</version>
> 	<description></description>
> 	<build>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.codehaus.mojo</groupId>
>
				<artifactId>jspc-maven-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<id>jspc</id>
> 						<goals>
> 							<goal>compile</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 			</plugin>
> 		</plugins>
> 	</build>
> </project>
>
> if i add dependencies to this pom it doesnt work
anymore:
>
> 	<dependencies>
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.5</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>jstl</artifactId>
> 			<version>1.1.2</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>taglibs</groupId>
> 			<artifactId>standard</artifactId>
> 			<version>1.1.2</version>
> 		</dependency>
> 	</dependencies>
>
> i guess my understanding of jspc is entirly wrong. Can
someone help me 
> explaining what went wrong and how to fix it?
>
> kind regards,
> janning
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: users-unsubscribemaven.apache.org
> For additional commands, e-mail: users-helpmaven.apache.org
>
>   


------------------------------------------------------------
---------
To unsubscribe, e-mail: users-unsubscribemaven.apache.org
For additional commands, e-mail: users-helpmaven.apache.org


Re: jspc precompiler error
user name
2007-11-05 11:11:58
Hi


You must use the jspc plugin in conjunction with the
maven-war-plugin. The
maven-war-plugin must have its *webXml* configuration
parameter set to the
newly created web.xml, which is $basedir/target/jspweb.xml
by default. See
the following example configuration in the link :

http://mojo.codehaus.org/jspc-maven-plugin/usage.html

Also try to add the following dependencies to your POM:
       <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>jsp-api</artifactId>
             <version>2.0</version>
         </dependency>


Thanks

Saritha S.V
On 11/5/07, mljvplanwerk6.de <mljvplanwerk6.de> wrote:
>
> hi,
>
> i have a difficult problem with precompiling jsp with
jspc-maven-plugin
> (v1.4.6)
>
> i get this error:
> [INFO] [jspc:compile {execution: jspc}]
> java.lang.NumberFormatException: For input string:
"$"
>
java.lang.NumberFormatException.forInputString(NumberFormatE
xception.java
> :48)
>        at java.lang.Integer.parseInt(Integer.java:447)
>        at java.lang.Integer.valueOf(Integer.java:553)
> [...]
>
>
> this is my jspc pom snippet
>
>                        <plugin>
>                               
<groupId>org.codehaus.mojo</groupId>
>                               
<artifactId>jspc-maven-plugin</artifactId>
>                                <configuration>
>                                       
<source>1.5</source>
>                                       
<target>1.5</target>
>                                       
<javaEncoding>UTF-8</javaEncoding>
>                                </configuration>
>                                <executions>
>                                       
<execution>
>                                               
<id>jspc</id>
>                                               
<goals>
>
> <goal>compile</goal>
>                                               
</goals>
>                                       
</execution>
>                                </executions>
>                        </plugin>
> [...]
>                <dependency>
>                       
<groupId>javax.servlet</groupId>
>                       
<artifactId>servlet-api</artifactId>
>                       
<version>2.5</version>
>                </dependency>
>                <dependency>
>                       
<groupId>javax.servlet</groupId>
>                       
<artifactId>jstl</artifactId>
>                       
<version>1.1.2</version>
>                </dependency>
>                <dependency>
>                       
<groupId>taglibs</groupId>
>                       
<artifactId>standard</artifactId>
>                       
<version>1.1.2</version>
>                </dependency>
>
> this is my jsp file
>
> <?xml version="1.0"
encoding="UTF-8" ?>
> <jsp:root xmlns="http://www.w3.org/
1999/xhtml"
>        xmlns:jsp="http://java.sun.co
m/JSP/Page"
>        xmlns:c="http://java.s
un.com/jsp/jstl/core" version="2.0">
>
>        <jsp:directive.page
contentType="text/html;charset=utf-8" />
>
>        <c:forEach var="i"
begin="1" end="$">
>                <c:out value="$" />
>        </c:forEach>
>
> </jsp:root>
>
> To track down the error i created a second project with
this pom.xml
> (complete) and just this jsp file in src/main/webapp
and a minimal web.xml
> and everything works even without
>
> <?xml version="1.0"
encoding="UTF-8"?>
> <project>
>        <modelVersion>4.0.0</modelVersion>
>        <groupId>jspc</groupId>
>        <artifactId>jspc</artifactId>
>        <packaging>war</packaging>
>        <version>0.0.1</version>
>        <description></description>
>        <build>
>                <plugins>
>                        <plugin>
>                               
<groupId>org.codehaus.mojo</groupId>
>                               
<artifactId>jspc-maven-plugin</artifactId>
>                                <executions>
>                                       
<execution>
>                                               
<id>jspc</id>
>                                               
<goals>
>
> <goal>compile</goal>
>                                               
</goals>
>                                       
</execution>
>                                </executions>
>                        </plugin>
>                </plugins>
>        </build>
> </project>
>
> if i add dependencies to this pom it doesnt work
anymore:
>
>        <dependencies>
>                <dependency>
>                       
<groupId>javax.servlet</groupId>
>                       
<artifactId>servlet-api</artifactId>
>                       
<version>2.5</version>
>                </dependency>
>                <dependency>
>                       
<groupId>javax.servlet</groupId>
>                       
<artifactId>jstl</artifactId>
>                       
<version>1.1.2</version>
>                </dependency>
>                <dependency>
>                       
<groupId>taglibs</groupId>
>                       
<artifactId>standard</artifactId>
>                       
<version>1.1.2</version>
>                </dependency>
>        </dependencies>
>
> i guess my understanding of jspc is entirly wrong. Can
someone help me
> explaining what went wrong and how to fix it?
>
> kind regards,
> janning
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: users-unsubscribemaven.apache.org
> For additional commands, e-mail: users-helpmaven.apache.org
>
>
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )