You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Christmann <pc...@gmail.com> on 2004/12/27 23:30:24 UTC

CompilingClassLoader problems inside a WAR

I am attempting (for my first time) to build a cocoon web application
and deploy it as a WAR to Tomcat.  However, I am encountering a
problem that occurs *only* when I deploy my app as a WAR.  If I deploy
it as an expanded folder (either myself, or by using Tomcat's
unpackWARS attribute) then the app works fine.

Versions:

Cocoon: 2.2-dev checked out today
Tomcat: 5.0.30-beta installed as a Service
Windows 2000

The problem:

I have a javascript file that includes this as the first two lines:

cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
importClass(com.priorartisans.ticketing.reports.DomainList)

Somehow (via some sufficiently advanced Cocoon magic that is well
beyond my current understanding), this second line turns into a call
to org.apache.cocoon.components.flow.javascript.fom.CompilingClassLoader
to resolve the imported class.

(Note: Based on mails I found in the archive, I tried
importClass(Packages.com.priorartisans.....) but nothing changed.)

The problem is that the compile method of CompilingClassLoader gets as
its class name "com.priorartisans" - not the full class name.  The
getSource method is able to turn that into a
org.apache.excalibur.source.impl.URLSource (via an
org.apache.excalibur.source.SourceResolver) with a URI of
jndi:/localhost/reports/com/priorartisans.java (note: "reports" is the
name of my webapplication).

Then at line 162 of CompilingClassLoader, the URLSource reports that
it exists, so it is returned.  But later - the URLSource cannot be
read (since it doesn't exist) so compilation fails.

Eventually, this means that if I try to view (in a browser) on of my
web pages that requires that javascript file, I instead see the
"Internal Server Error" page that shows an
org.mozilla.javascript.EvaluatorException thrown by the
ComplingClassLoader inside the compile method.

If I unpack the WAR, then the resolved source is an
org.apache.excalibur.source.impl.FileSource with a URI of 
file:/c:/program files/apache software foundation/tomcat
5.0/webapps/reports/com/priorartisans.java.  With this Source, line
162 reports that the source doesn't exist, so no attempts are made to
compile it, and the webapp works fine.

(When I run as an unpacked WAR, the CompilingClassLoader is called
first with "com.priorartisans", then with
"com.priorartisans.ticketing", then with
"com.priorartisans.ticketing.reports" - something is parsing the
chunks of the importClass statement.)

I've found bug #27484
(http://issues.apache.org/bugzilla/show_bug.cgi?id=27484) which seems
to describe the same problem and its marked as "RESOLVED WONTFIX", but
I don't see any description of why it won't be fixed, what the problem
is, or what a work around is.

Also - when I started doing this, I was using Cocoon 2.1.5.  In that
version, this error manifested as a NullPointerException.  With the
latest code, the NPE is gone (I've seen mailing list traffic
discussing a patch) but the underlying problem still remains.

I'm not sure if this is a bug with the Excalibur URLSource.  But with
the recent shutdown of Avalon, I couldn't find the appropriate set of
source for the excalibur components (the Cocoon API docs don't include
it; the Excalibur API docs reference packages with an "avalon" in them
- org.apache.avalon.excalibur - so that source appears to be
different).

Help!  I'm very new to cocoon, but I hope I've described my problem
sufficiently and accurately.  Thanks in advance for any pointers or
info.

-- 
PC

Paul Christmann
Prior Artisans, LLC
mailto:paul@priorartisans.com
504-587-9072

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CompilingClassLoader problems inside a WAR

Posted by Paul Christmann <pc...@gmail.com>.
For whatever its worth, I tried the same war today under Jetty 5.1.0
and the same problem appears.  So I don't think that its a Tomcat
problem.


On Mon, 27 Dec 2004 16:30:24 -0600, Paul Christmann
<pc...@gmail.com> wrote:
> I am attempting (for my first time) to build a cocoon web application
> and deploy it as a WAR to Tomcat.  However, I am encountering a
> problem that occurs *only* when I deploy my app as a WAR.  If I deploy
> it as an expanded folder (either myself, or by using Tomcat's
> unpackWARS attribute) then the app works fine.
> 
> Versions:
> 
> Cocoon: 2.2-dev checked out today
> Tomcat: 5.0.30-beta installed as a Service
> Windows 2000

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Problems with Xindice

Posted by oliver charlet <ol...@form4.de>.
I also had problems with xindice XUpdate. Got no answer from this list, 
but saw in the mailing list archives, that quite a lot had more or less 
the same problem.
one suggestion was to switch to the latest xalan and xerces version, but 
for me it did not change anything. I even used the patch provided in 
bugzilla, but that did not change anything either.
So there are two things you can do.
1. write your own transformer or other component  for updates in xindice or
2. use eXist, which is also an open source XML native DB. It is well 
documented and WORKs (!).
It has a nice cocoon integration and I had no problems with XUpdate 
whatsoever.
So I really recommend using 2.) and switch to eXist.
here's  a link:   http://exist-db.org/

happy new year!
:olli

javascript schrieb:

> I'm using Xindice embedded in Cocoon 2.1.6.
>
> When I use this code:
>
>    <x:query type="update" collection="cms" oid="samples.xml" 
> xmlns:x="http://apache.org/cocoon/xmldb/1.0">
>      <xu:modifications version="1.0" 
> xmlns:xu="http://www.xmldb.org/xupdate">
>        <xu:update select="/page/content/para[@id = '2']">Row 
> modified.</xu:update>
>      </xu:modifications>
>    </x:query>
>
> I receive the messagge:
>
> 1 entries updated
>
> but the database is not modified and in /page/content/para[@id = '2'] 
> the string is not changed.
>
> I tried a lot of solutions but never is changed.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Problems with Xindice

Posted by javascript <ja...@tin.it>.
I'm using Xindice embedded in Cocoon 2.1.6.

When I use this code:

    <x:query type="update" collection="cms" oid="samples.xml" 
xmlns:x="http://apache.org/cocoon/xmldb/1.0">
      <xu:modifications version="1.0" 
xmlns:xu="http://www.xmldb.org/xupdate">
        <xu:update select="/page/content/para[@id = '2']">Row 
modified.</xu:update>
      </xu:modifications>
    </x:query>

I receive the messagge:

1 entries updated

but the database is not modified and in /page/content/para[@id = '2'] 
the string is not changed.

I tried a lot of solutions but never is changed.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CompilingClassLoader problems inside a WAR

Posted by Paul Christmann <pc...@gmail.com>.
On Tue, 4 Jan 2005 15:57:01 -0600 (CST), Antonio Gallardo
<ag...@agssa.net> wrote:
> Are you tried the Paranoid block?

I just tried that, but the error message I got (showing up in a tomcat
log file) tells me that the ParanoidCocoonServlet cannot run in an
undeployed WAR file.  So unfortunately, that doesn't help.

(I just included the paranoid block, and changed the servlet mapping
entry in my web.xml; was there anything else I needed to do?)

-- 
PC

Paul Christmann
Prior Artisans, LLC
mailto:paul@priorartisans.com
504-587-9072

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CompilingClassLoader problems inside a WAR

Posted by Antonio Gallardo <ag...@agssa.net>.
Are you tried the Paranoid block?

Best Regards,

Antonio Gallardo

On Mar, 4 de Enero de 2005, 8:42, Paul Christmann dijo:
> On Mon, 27 Dec 2004 16:30:24 -0600, Paul Christmann
> <pc...@gmail.com> wrote:
>> I am attempting (for my first time) to build a cocoon web application
>> and deploy it as a WAR to Tomcat.  However, I am encountering a
>> problem that occurs *only* when I deploy my app as a WAR.  If I deploy
>> it as an expanded folder (either myself, or by using Tomcat's
>> unpackWARS attribute) then the app works fine.
>
> I still haven't been able to get my webapp to work, so now I'm digging
> into code (Cocoon and Excalibur code currently).  In the mean time:
>
> Is anyone successfully using a Cocoon app as an unexpanded war with a
> javascript file that includes importClass statements?
>
> If so, please respond just to say so - before I get too deep into the
> code, I'd like to know whether the problem is related to me, my
> computer, my configuration, my ???? (insert some other cause besides
> cocoon itself).
>
> Thanks,
>
> --
> PC
>
> Paul Christmann
> Prior Artisans, LLC
> mailto:paul@priorartisans.com
> 504-587-9072
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CompilingClassLoader problems inside a WAR

Posted by Paul Christmann <pc...@gmail.com>.
On Mon, 27 Dec 2004 16:30:24 -0600, Paul Christmann
<pc...@gmail.com> wrote:
> I am attempting (for my first time) to build a cocoon web application
> and deploy it as a WAR to Tomcat.  However, I am encountering a
> problem that occurs *only* when I deploy my app as a WAR.  If I deploy
> it as an expanded folder (either myself, or by using Tomcat's
> unpackWARS attribute) then the app works fine.

I still haven't been able to get my webapp to work, so now I'm digging
into code (Cocoon and Excalibur code currently).  In the mean time:

Is anyone successfully using a Cocoon app as an unexpanded war with a
javascript file that includes importClass statements?

If so, please respond just to say so - before I get too deep into the
code, I'd like to know whether the problem is related to me, my
computer, my configuration, my ???? (insert some other cause besides
cocoon itself).

Thanks,

-- 
PC

Paul Christmann
Prior Artisans, LLC
mailto:paul@priorartisans.com
504-587-9072

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org