You can't write to a file from an ejb, you should instead use an MBean to do this.
ciao, kiuma
Gordon wrote:
Hi.
I have a problem writing a SVG document to a local directory
My code works in a normal java class but when i use it in an ejb, i get an error. The svg file is created in the local drive but the content is not written to it.My code and the error is below.
(am using jdk 1.3.1 & jboss 2.4.1)
Any help would be great.
Thanks.
Gordon.
code:
Writer w = new FileWriter(uri);
DOMUtilities.writeDocument(doc, w); (The error occurs at this line)
w.flush();
w.close();
error:
[SVGController] TRANSACTION ROLLBACK EXCEPTION:null
Embedded Exception
null; nested exception is:
javax.ejb.EJBException: null
Embedded Exception
null
[SVGController] java.lang.NullPointerException
[SVGController] at org.apache.batik.dom.util.DOMUtilities.writeDocument(Unknown Source)
[SVGController] at ie.ejb.SVGControllerBean.writeDocument(Unknown Source)
[SVGController] at java.lang.reflect.Method.invoke(Native Method)
[SVGController] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionC
.java:543)
[SVGController] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInst
rceptor.java:87)
[SVGController] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[SVGController] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
[SVGController] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[SVGController] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
[SVGController] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[SVGController] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
[SVGController] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.ja
[SVGController] at java.lang.reflect.Method.invoke(Native Method)
[SVGController] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
[SVGController] at sun.rmi.transport.Transport$1.run(Transport.java:152)
[SVGController] at java.security.AccessController.doPrivileged(Native Method)
[SVGController] at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
[SVGController] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)
[SVGController] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)
[SVGController] at java.lang.Thread.run(Thread.java:484)
------------------------------------------------------------------------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003
------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user