cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: new JSR on Java Compiler API
Date Mon, 14 Oct 2002 08:20:40 GMT
Ovidiu Predescu wrote:

>
> On Friday, October 11, 2002, at 02:09  AM, Sylvain Wallez wrote:
>
>> Stefano Mazzocchi wrote:
>>
>>> People,
>>>
>>> Neal Gafter is about to start the process for a new JSR on Java 
>>> Compiler API which would hopefully make it fir Tiger (aka Java 1.5). 
>>> He asked me if there are people interested in helping out with the 
>>> details of bootstrapping this from Apache and since we (and Tomcat) 
>>> are the one who need this the most (for XSP and sitemap 
>>> compilation), I thought about asking here.
>>>
>>> The idea is to allow us to compile stuff without having to use the 
>>> filesystem to retrieve both the source file and the classes on which 
>>> the code to be compiled depend upon.
>>>
>>> So, if you are a committer and want to join, just raise your hand 
>>> and we'll see what happens.
>>
>>
>>
>> What would be  very cool is to be able to specify line numbers of the 
>> source file that generated the Java code (like #line in C). This 
>> would allow for source-level XSP debuggers !
>
>
> I've implemented this feature long time ago for the compiled sitemap, 
> in the sitemap.xsl stylesheet. The generated sitemap would have lines 
> like:
>
> // file: src/webapp/sitemap.xmap
> // line: 123


I know this, and what I'm proposing extends it to the source file and 
line number information in the bytecode.

The above allows to find the line in the sitemap/XSP that generated a 
given statement in the Java code. But exceptions stacktraces still refer 
to source lines of the generated java code, and not source lines of the 
original sitemap/XSP.

My proposal would allow to have exceptions carry the file name and line 
number of the _sitemap/XSP file_ that originated the Java code. You 
would then have stacktraces like this :

my.app.MyException (app failed)
  at my.app.MyClass (MyClass.java:315)
  at my.webapp.myXsp_xsp.generate (myXsp.xsp:79)        <===
  at ServerPagesGenerator.generate (ServerPagesGenerator.java:89)
  at my.webapp.sitemap_xmap.match123 (sitemap.xmap:152) <===
  ...

This kind of information would greatly help debugging Cocoon 
applications, and would also allow source-level debugging of XSPs using 
existing debuggers.

Sylvain

-- 
Sylvain Wallez
  Anyware Technologies                  Apache Cocoon
  http://www.anyware-tech.com           mailto:sylvain@apache.org



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


Mime
View raw message