You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Bierenfeld <mi...@atmiralis.de> on 2000/06/05 14:11:47 UTC

IOException while compiling XSP-Pages

Hello

I am having a strange problem with XSP-Pages. We
are using a PreProcessor (tablegen) in order to
create home-brewed Classes for Database-Access.
These Classes are just normal Java-Classes with
functions like :

getByClass (), store (), insert (), update () and
so on. Has some advantages and disadvantages eg.
FOREIGN KEYS, CONSTRAINTS are not working but
nevertheless it saves a lot of typingwork.

So we have created a XSP-Functionality that goes
like this

<Form action=/login.xml dbtable="dbtables.login"
bean="DbAccess">

</Form>

Where DbAccess is a java class that handles all
operations on DatabaseTables like insert the form
data, Create new rows, delete old ones and so on.
DbTables.login is the automatic generated Class
from the Precompiler ("tablegen"). This Class is
loaded on demand by :

	Class dbtable = this.getClass ().getClassLoader
().loadClass ("dbtables.login");

	DbObject dbObject = dbtable.newInstance
();            // this causes problem

The Instanstiation of the Class (in fact the usage
of the function newInstance ()) causes Problems in
compiling the xsp-page. I receive an IOException
in the XSP


      java.lang.Exception: XSP Java Compiler:
Compilation failed for _login.java
      I/O exception
      1 error


              at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java:159)
              at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:451)
              at
org.apache.cocoon.Engine.handle(Engine.java:305)
              at
org.apache.cocoon.Cocoon.service(Cocoon.java:167)
              at
javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
              at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:335)
              at
org.apache.jserv.JServConnection.run(JServConnection.java:197)
              at java.lang.Thread.run(Thread.java)

When I compile the file _login.java manualy it all
works fine. Even if I restart cocoon the
compilation works fine. I think it is somewhat
related to classloading and class instantiation 
But why should this affect the compilation of a
xsp-Page ????

Had anybody a similar problem before ?

Regards

Michael

Re: IOException while compiling XSP-Pages

Posted by Mike Engelhart <me...@earthtrip.com>.
on 6/5/00 7:11 AM, Michael Bierenfeld at michael.bierenfeld@atmiralis.de
wrote:

> When I compile the file _login.java manualy it all
> works fine. Even if I restart cocoon the
> compilation works fine. I think it is somewhat
> related to classloading and class instantiation
> But why should this affect the compilation of a
> xsp-Page ????
> 
> Had anybody a similar problem before ?
> 
> Regards
> 
> Michael
There are definitely class loader issues with XSP. For example, you can not
call:
ResourceBundle bundle = ResourceBundle.getBundle("com.mycompany.mypackage");

without getting class loader errors and this is standard JDK stuff.

Unfortunately I don't know the answer but you may look through the archives
for related threads.

Mike