You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Kaufman, Noah" <nk...@metatomix.com> on 2001/08/17 21:03:15 UTC

More on Debugging Cocoon2 in VAJ

	Once again, we've been working on getting Cocoon 2 set up so
that we can debug our own custom generators and transformers in VAJ.
We're working with Cocoon 2-b2 and VAJ v3.5.3.

	The problem we're having is that Cocoon 2 works fine with Tomcat
outside of the debugger, but when we run Cocoon 2 in the debugger it
craps out with the following error:  "The sitemap handler's sitemap is
not available."  which means absolutely nothing to us, since it then
tells you to look in the Cocoon 2 log for more information - of which
there is none.

	Stepping through the code in the debugger, we see the following
progression:

1.)  Manager.invoke() gets called as part of Cocoon's initialization.

2.)  This then executes "Handler sitemapHandler = getHandler()", which
then causes a call to be made to Manager.getHandler().

3.)  Manager.getHandler() then executes
           "Handler sitemapHander = (Handler)sitemaps.get(source)".

4.)  This call returns a null value, which causes a new sitemapHandler
to be created using the following code:

            sitemapHandler = new Handler(source,check_reload);

            where source="sitemap.xmap", and check_reload=true.

5.)  This is then followed by the following sequence of calls:

                sitemapHandler.setLogger(getLogger());
                sitemapHandler.compose(newManager);
                sitemapHandler.contextualize(this.context);
                sitemapHandler.regenerate(environment);
                sitemaps.put(source, sitemapHandler);

      After which the complete sitemap is then returned to the calling
function, but the source property for the sitemap object is not
populated.

	Why is this?

6.)   Then a call to setupProcessing() is made, which does a check via a
call to sitemap.available() to see if the sitemap is there.  Although
there is a sitemap object, the source property is null (because
AbstractSitemap.compose() doesn't seem to fill it in), so Cocoon then
stack dumps with the message "The sitemap handler's sitemap is not
available."


	Being new to Cocoon, it's not clear to me why
sitemap.regenerate() doesn't fill in a value for the source property in
the sitemap object under these circumstances.

	I was hoping that someone on this list could provide some
additional insight as to what's supposed to be happening here.
Additional details are provided by an extract of the cocoon.log file
showing the messages that appear there.  Thank you very much in advance.

Sincerely,

Noah Kaufman
Metatomix, Inc.

-=-=-=-=-=-=-=-=-=-  extract from cocoon.log below
-=-=-=-=-=-=-=-=-=-=-=-

DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): DEBUGGING
INFORMATION:
REQUEST: /cocoon/

CONTEXT PATH: /cocoon
SERVLET PATH: /
PATH INFO: null

REMOTE HOST: 127.0.0.1
REMOTE ADDRESS: 127.0.0.1
REMOTE USER: null
REQUEST SESSION ID: null
REQUEST PREFERRED LOCALE: en_US
SERVER HOST: localhost
SERVER PORT: 8080

METHOD: GET
CONTENT LENGTH: -1
PROTOCOL: HTTP/1.1
SCHEME: http
AUTH TYPE: null

REQUEST PARAMETERS:


SESSION ATTRIBUTES:


DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): ComponentFactory
creating new instance of
org.apache.cocoon.components.source.SourceHandlerImpl.
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Getting the
SourceFactories
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Beginning sitemap
regeneration
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Resolving
'sitemap.xmap'
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Making URL from
file:C:\Program Files\Jakarta Tomcat 4.0\webapps\cocoon\sitemap.xmap
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Resolved to
'file:C:/Program Files/Jakarta Tomcat 4.0/webapps/cocoon/sitemap.xmap'
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Resolving ''
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Making URL from
file:/C:/Program Files/Jakarta Tomcat 4.0/webapps/cocoon/
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Resolved to
'file:/C:/Program Files/Jakarta Tomcat 4.0/webapps/cocoon/'
DEBUG   99807   [cocoon  ] (Thread-17): Making URL from file:C:\Program
Files\Jakarta Tomcat 4.0\webapps\cocoon\sitemap.xmap
DEBUG   99807   [cocoon  ] (Thread-17): UnnamedSelector:
ComponentSelector could not find the component for hint:
org\apache\cocoon\www\sitemap_xmap
DEBUG   99807   [cocoon  ] (Thread-17): Could not access component for
hint: org\apache\cocoon\www\sitemap_xmap
DEBUG   99807   [cocoon  ] (Thread-17): The instance was not accessible,
creating it now.
DEBUG   99807   [cocoon  ] (Thread-17): ComponentFactory creating new
instance of org.apache.cocoon.www.sitemap_xmap.
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand store,
returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
url-factory, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
source-handler, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
program-generator, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand jsp-engine,
returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
programming-languages, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
classloader, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
markup-languages, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
datasources, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
stream-pipeline, returning
org.apache.cocoon.components.pipeline.StreamPipeline
DEBUG   99807   [cocoon  ] (Thread-17): Adding component
(org.apache.cocoon.components.pipeline.StreamPipeline =
org.apache.cocoon.components.pipeline.CachingStreamPipeline)
DEBUG   99807   [cocoon  ] (Thread-17): Attempting to get Handler for:
org.apache.cocoon.components.pipeline.StreamPipeline
DEBUG   99807   [cocoon  ] (Thread-17): Handler type =
org.apache.avalon.excalibur.component.PoolableComponentHandler
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
stream-cache, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
event-pipeline, returning
org.apache.cocoon.components.pipeline.EventPipeline
DEBUG   99807   [cocoon  ] (Thread-17): Adding component
(org.apache.cocoon.components.pipeline.EventPipeline =
org.apache.cocoon.components.pipeline.CachingEventPipeline)
DEBUG   99807   [cocoon  ] (Thread-17): Attempting to get Handler for:
org.apache.cocoon.components.pipeline.EventPipeline
DEBUG   99807   [cocoon  ] (Thread-17): Handler type =
org.apache.avalon.excalibur.component.PoolableComponentHandler
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand
event-cache, returning null
DEBUG   99807   [cocoon  ] (Thread-17): looking up shorthand sitemap,
returning null
WARN    99807   [cocoon  ] (Thread-17): Looking up component on an
uninitialized ComponentManager:
org.apache.cocoon.generation.GeneratorSelector
DEBUG   99807   [cocoon  ] (Thread-17): Could not find ComponentHandler,
attempting to create one for role:
org.apache.cocoon.generation.GeneratorSelector
ERROR   99807   [cocoon  ] (Thread-17): Error compiling sitemap
java.lang.InternalError: (Ex02) An error has occurred.
	java.lang.Throwable(java.lang.String)
	java.lang.Error(java.lang.String)
	java.lang.VirtualMachineError(java.lang.String)
	java.lang.InternalError(java.lang.String)
	java.lang.Class
java.lang.ClassLoader.findLoadedClass(java.lang.String)
	java.lang.Class
java.lang.ClassLoader.loadClass(java.lang.String, boolean)
	java.lang.Class
java.lang.ClassLoader.loadClass(java.lang.String)
	org.apache.avalon.framework.component.Component
org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(j
ava.lang.String)
	org.apache.avalon.framework.component.Component
org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(j
ava.lang.String)
	void
org.apache.cocoon.sitemap.AbstractSitemap.compose(org.apache.avalon.fram
ework.component.ComponentManager)
	java.lang.Object
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstanc
e()
	void
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initial
ize()
	void
org.apache.cocoon.components.language.generator.GeneratorSelector.addGen
erator(org.apache.avalon.framework.component.ComponentManager,
java.lang.Object, java.lang.Class)
	void
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.add
CompiledComponent(org.apache.avalon.framework.component.ComponentManager
, java.lang.String, java.lang.Class)
	
org.apache.cocoon.components.language.generator.CompiledComponent
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loa
d(org.apache.avalon.framework.component.ComponentManager,
java.lang.String, java.lang.String, java.lang.String,
org.apache.cocoon.environment.SourceResolver)
	void org.apache.cocoon.sitemap.Handler.run()
	void java.lang.Thread.run()

DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): Changing Cocoon
context(sitemap.xmap) to prefix()
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): 	from
context(file:/C:/Program Files/Jakarta Tomcat 4.0/webapps/cocoon/) and
prefix()
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): 	at URI 
DEBUG   99807   [cocoon  ] (HttpProcessor[8080][4]): New context is
file:/C:/Program Files/Jakarta Tomcat 4.0/webapps/cocoon/
ERROR   99807   [cocoon  ] (HttpProcessor[8080][4]): Problem with
servlet
org.apache.cocoon.ProcessingException: The sitemap handler's sitemap is
not available. Please check C:\Program Files\Jakarta Tomcat
4.0\webapps\cocoon\WEB-INF\logs\cocoon.log for the exact error.
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	org.apache.avalon.framework.CascadingException(java.lang.String,
java.lang.Throwable)
	org.apache.cocoon.ProcessingException(java.lang.String,
java.lang.Throwable)
	void
org.apache.cocoon.sitemap.Manager.setupProcessing(org.apache.cocoon.envi
ronment.Environment, org.apache.cocoon.sitemap.Handler,
java.lang.String, java.lang.String)
	boolean
org.apache.cocoon.sitemap.Manager.invoke(org.apache.avalon.framework.com
ponent.ComponentManager, org.apache.cocoon.environment.Environment,
java.lang.String, java.lang.String, boolean, boolean)
	boolean
org.apache.cocoon.Cocoon.process(org.apache.cocoon.environment.Environme
nt)
	void
org.apache.cocoon.servlet.CocoonServlet.service(javax.servlet.http.HttpS
ervletRequest, javax.servlet.http.HttpServletResponse)
	void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
	void
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.s
ervlet.ServletRequest, javax.servlet.ServletResponse)
	void
org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.S
ervletRequest, javax.servlet.ServletResponse)
	void
org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina
.Request, org.apache.catalina.Response,
org.apache.catalina.ValveContext)
	void
org.apache.catalina.core.StandardPipeline.invokeNext(org.apache.catalina
.Request, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardPipeline.invoke(org.apache.catalina.Req
uest, org.apache.catalina.Response)
	void
org.apache.catalina.core.ContainerBase.invoke(org.apache.catalina.Reques
t, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina
.Request, org.apache.catalina.Response,
org.apache.catalina.ValveContext)
	void
org.apache.catalina.core.StandardPipeline.invokeNext(org.apache.catalina
.Request, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardPipeline.invoke(org.apache.catalina.Req
uest, org.apache.catalina.Response)
	void
org.apache.catalina.core.ContainerBase.invoke(org.apache.catalina.Reques
t, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardContext.invoke(org.apache.catalina.Requ
est, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.Re
quest, org.apache.catalina.Response, org.apache.catalina.ValveContext)
	void
org.apache.catalina.core.StandardPipeline.invokeNext(org.apache.catalina
.Request, org.apache.catalina.Response)
	void
org.apache.catalina.valves.AccessLogValve.invoke(org.apache.catalina.Req
uest, org.apache.catalina.Response, org.apache.catalina.ValveContext)
	void
org.apache.catalina.core.StandardPipeline.invokeNext(org.apache.catalina
.Request, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardPipeline.invoke(org.apache.catalina.Req
uest, org.apache.catalina.Response)
	void
org.apache.catalina.core.ContainerBase.invoke(org.apache.catalina.Reques
t, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.
Request, org.apache.catalina.Response, org.apache.catalina.ValveContext)
	void
org.apache.catalina.core.StandardPipeline.invokeNext(org.apache.catalina
.Request, org.apache.catalina.Response)
	void
org.apache.catalina.core.StandardPipeline.invoke(org.apache.catalina.Req
uest, org.apache.catalina.Response)
	void
org.apache.catalina.core.ContainerBase.invoke(org.apache.catalina.Reques
t, org.apache.catalina.Response)
	void
org.apache.catalina.connector.http.HttpProcessor.process(java.net.Socket
)
	void org.apache.catalina.connector.http.HttpProcessor.run()
	void java.lang.Thread.run()

INFO    99807   [cocoon  ] (HttpProcessor[8080][4]): '' Processed by
Apache Cocoon 2.0b2 in 18.407 seconds.


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


Re: More on Debugging Cocoon2 in VAJ

Posted by Joerg Henne <j....@levigo.de>.
Hi,

"Kaufman, Noah" wrote:
> 
>         The problem we're having is that Cocoon 2 works fine with Tomcat
> outside of the debugger, but when we run Cocoon 2 in the debugger it
> craps out with the following error:  "The sitemap handler's sitemap is
> not available."  which means absolutely nothing to us, since it then
> tells you to look in the Cocoon 2 log for more information - of which
> there is none.

regarding C2 and VAJ you have to keep in mind a few things:

- The sitemap consists of a generated and compiled Java class
- VAJ is able to load these classes if you add the work/cocoon directory to
the "extra classpath", however, you won't be able to debug them and reloading
won't work (which means to restart the servlet engine for every change vou
make to the sitemap)
- cocoon uses it's own classloader for the generated stuff. This means that
this classloader won't find the classes living inside VAJ

There are several way to make Cocoon work inside VAJ anyway, but they all
involve some drawbacks. The solution we went with (prior to giving up on VAJ
in favor of NetBeans) looks like this:

1) Add the IBM IDE Utility classes to your workspace
2) Replace the C2 code that compiles the generated code with code that
actually perfoms an IMPORT into the VAJ workspace
3) Update the xsp.xsl logicsheet so that the timestamp of generated Classes is
set not in a static initializer, but in the consuructor. This is necessary due
to the fact that VAJ won't re-execute static blocks when it reloads a class.

Please let me know if you want to take that route - I can provide you with the
necessary changes to the cocoon code.

Joerg Henne

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