Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ant & jspc

0 views
Skip to first unread message

giuseppe

unread,
Oct 9, 2002, 3:58:18 AM10/9/02
to
Hi all,
I have a problem with ant and jspc.
I have ant 1.5 and WebLogic 6.1 SP2. The directory tree is the following:

/project
|--> /war ( it contains my jsp)
|--> /war/WEB-INF (it contains web.xml and weblogic.xml)
|--> build.xml (the script of ant)


I would precompile my jsp pages with ant with this simple task:

<target name="jspc" depends="init" " >
<java classpathref="project-classpath"
classname="weblogic.jspc"
dir="war"
fork="yes">
<arg line="-k -webapp war index.jsp"/>
</java>
</target>

But it doesn't work; the error is
jspc:
[java] [jspc] warning: expected file /project/war/war/WEB-INF/web.xml
not found, tag libraries cannot be resolved.

I think the error is due to the attribute -webapp: in fact if I change this
value (e. g. -webapp=dummydir ) the error is:
jspc:
[java] [jspc] warning: expected file
/project/war/dummydir/WEB-INF/web.xml not found, tag libraries cannot be
resolved.

If I set the attribute -webapp with the absolute path the error is:
jspc:
[java] Exception in thread "main" java.lang.NoSuchMethodError
[java] at
weblogic.apache.xerces.jaxp.DocumentBuilderImpl.<init>(DocumentBuilderImpl.j
ava:136)
[java] at
weblogic.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Do
cumentBuilderFactoryImpl.java:82)
[java] at
weblogic.xml.jaxp.WebLogicDocumentBuilderFactory.newDocumentBuilder(WebLogic
DocumentBuilderFactory.java:112)
[java] at
weblogic.servlet.internal.dd.DescriptorLoader.initDOMFactory(DescriptorLoade
r.java:308)
[java] at
weblogic.servlet.internal.dd.DescriptorLoader.parse(DescriptorLoader.java:32
5)
[java] at
weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(DescriptorLoa
der.java:341)
[java] at
weblogic.servlet.internal.dd.DescriptorLoader.initialize(DescriptorLoader.ja
va:254)
[java] at
weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader.java:1
74)
[java] at
weblogic.servlet.internal.dd.DescriptorLoader.loadDescriptor(DescriptorLoade
r.java:410)
[java] at weblogic.jspc.runBodyInternal(jspc.java:227)
[java] at weblogic.jspc.runBody(jspc.java:169)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:79)
[java] at weblogic.jspc.main(jspc.java:360)
[java] Java Result: 1

What is wrong?

Giuseppe


Ann Cao

unread,
Oct 11, 2002, 2:15:10 AM10/11/02
to
You have specified dir="war" in your script already. Specifying "-webapp war"
will make rootdir become war/war.

Please try:


<target name="jspc" depends="init" " >
<java classpathref="project-classpath"
classname="weblogic.jspc"
dir="war"
fork="yes">

<arg line="-k index.jsp"/>
</java>
</target>

giuseppe wrote:

--
Regards,
Ann
Developer Relations Engineer
BEA Support


giuseppe

unread,
Oct 14, 2002, 4:12:59 AM10/14/02
to
Hi Ann,
sorry for the delay in response.
I've tried your solution and the error was:

Then I've found another solution and this works fine:

<target name="jspc" depends="init" >

<exec executable="java" failonerror="yes" dir="war">
<arg line="-classpath ${bea.home}/lib/weblogic.jar"/>
<arg value="weblogic.jspc" />
<arg line="-webapp /project/war"/>
<arg value="-k" />
<arg value="indexl.jsp" />
</exec>
</target>

Thanks
Giuseppe


"Ann Cao" <Re...@ToNewsgroup.Only> wrote in message
news:3DA66C6D...@ToNewsgroup.Only...

0 new messages