There are a two things that seem wrong to me:
1. do not instanciate
@Inject
private XMLBuilder builder;
@Inject
private XMLBuilder builder = new XMLBuilder();
I never instanciate injected thingies and it always works.
2. inject a page like this:
@InjectPage("path/to/XMLBuilder")
private XMLBuilder xmlBuilder;
Is XMLBuilder a page (complete document) or does it produce some XML
rendererd inside pages? For the latter, I would have made it a component.
Andy
bob_k wrote:
Hi folks.
It seems to be a simple problem but I cannot figure out what's going on.
I have created an XMLBuilder class that dynamically generates an XML file,
"XMLBuilder" and when I try to instantiate it in a Tapestry page I'm getting
this error:
.......................................
# java.lang.ClassNotFoundException
caught an exception while obtaining a class file for
com.eveo.edetail.webapp.pages.GenerateXML
exception
org.apache.tapestry5.internal.services.TransformationException: Error
obtaining injected value for field
com.eveo.edetail.webapp.pages.GenerateXML.builder: No service implements the
interface com.eveo.edetail.util.XMLBuilder.
# org.apache.tapestry5.internal.services.TransformationException
Error obtaining injected value for field
com.eveo.edetail.webapp.pages.GenerateXML.builder: No service implements the
interface com.eveo.edetail.util.XMLBuilder.
.......................................
In my Tapestry page, "GenerateXML.java" I have the following simple code.
public class GenerateXML {
@Inject
private XMLBuilder builder = new XMLBuilder();
void onActivate()
{
try {
builder.generateXML(3);
} catch (TransformerConfigurationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
}
}
...............................................
I'm injecting the class that I want to use but I'm getting this error. It
seems like such a simple thing but I'm stumped about what's happening.
Anyone have any ideas?
thanks.
-Bob
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]