You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Arian Hojat <ar...@gmail.com> on 2005/04/27 13:39:29 UTC
updated question about svg filepaths. using batik in tomcat
Hello i posted a while back about my <image> tag references not workin
in a java servlet i made. I got around it on my windows machine/tomcat
server by using the absolute filepath to the image file to use in my
svg file, which then gets rasterized. but when i moved the code to
unix production server i forgot the paths dont work. so i use
bascially use unix abs paths when i encounter '/' and create tags like
this...
<svg ...>...
<image x="0" y="0" width="100%"
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="/usr/local/tomcat/webapps/Watermark/WEB-INF/w.png" />
....</svg>
Anyway this saves a 0 kb jpeg, not seeming to save same as. but i am
still longing to get relative filepaths working and i got some batik
help from u all last time, but to no avail, i just went and used abs.
filepaths...
I have more info that might help you guys debug my problem.... when
using an image's abs filepath (so a filenotfound exception definitely
doesnt occur), and rasterizing to just 'test.jpg' (relative save
path), it saves not to the webapps directory which is what i expected.
it saves to tomcat/bin. now am i doin something wrong? If anyone can
help again, it is much appreciated.
thanks
Arian Hojat.
PS
(if anyone has a simple servlet that saves an svg that uses relative
filepaths(to an image file pretend) and saves to a reltive location, i
would love to put it on my server and see if maybe its a server
setting and not my code),
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: error in servlet:
org/apache/batik/dom/svg/SVGDOMImplementation (Illegal UTF8 string in
constant pool)
Posted by Tonny Kohar <to...@kiyut.com>.
Hi,
> not sure whats up here. seems to not work on a unix tomcat server. but
> works fine on my windows tomcat server. any ideas?
> java.lang.ClassFormatError:
> org/apache/batik/dom/svg/SVGDOMImplementation (Illegal UTF8 string in
> constant pool)
> java.lang.ClassLoader.defineClass0(Native Method)
> java.lang.ClassLoader.defineClass(ClassLoader.java:539)
I could be totally wrong. ClassFormatError could be occurred because
mismatch in Java bytecode eg: compile in JDK 1.5 deploy in JVM 1.4
Regards
Tonny Kohar
--
Sketsa
SVG Graphics Editor
http://www.kiyut.com
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
error in servlet: org/apache/batik/dom/svg/SVGDOMImplementation (Illegal UTF8 string in constant pool)
Posted by Arian Hojat <ar...@gmail.com>.
Hello guys,
i get an error with this line of code.
>>>> DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
svgDoc =
impl.createDocument(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg",
null);
Element svgRoot = svgDoc.getDocumentElement();
svgRoot.setAttributeNS(null, "width", "800");
svgRoot.setAttributeNS(null, "height", "600");
svgRoot.setAttributeNS(org.apache.batik.util.XMLConstants.XMLNS_NAMESPACE_URI,
"xmlns:xlink", "http://www.w3.org/1999/xlink");//xMidYMid meet
not sure whats up here. seems to not work on a unix tomcat server. but
works fine on my windows tomcat server. any ideas?
java.lang.ClassFormatError:
org/apache/batik/dom/svg/SVGDOMImplementation (Illegal UTF8 string in
constant pool)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:539)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
w4.doGet(w4.java:41)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: updated question about svg filepaths. using batik in tomcat
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Arian,
Arian Hojat wrote:
> Doh!, i musta missed that Transcoder.setURI() suggestion in your
> previous email. Sorry. Thanks, i will try it out later tonight...
> also... is this URI being passed a file system path
> (file:///c:/dir1/dir2) or web base path
> (http://www.blah.com/absDir1/absDir2)?
It could be either, however in this case you probably want the
'file' version otherwise your referenced files will be fetched
over HTTP rather than reading directly from disk.
> or whatever i fancy.
> thanx again,
> Arian Hojat
>
>
> On 4/27/05, Thomas DeWeese <Th...@kodak.com> wrote:
>
>>Arian Hojat wrote:
>>
>>>Hello i posted a while back about my <image> tag references not workin
>>>in a java servlet i made. I got around it on my windows machine/tomcat
>>>server by using the absolute filepath to the image file to use in my
>>>svg file, which then gets rasterized. but when i moved the code to
>>>unix production server i forgot the paths dont work.
>>
>> Sure they do, they just have a different 'base' to them.
>>
>>
>>>so i use bascially use unix abs paths when i encounter '/' and create
>>>tags like this...
>>
>> This isn't correct it should be more like:
>>xlink:href="file:///usr/local/tomcat/webapps/Watermark/WEB-INF/w.png"
>>
>>
>>>Anyway this saves a 0 kb jpeg, not seeming to save same as. but i am
>>>still longing to get relative filepaths working and i got some batik
>>>help from u all last time, but to no avail, i just went and used abs.
>>>filepaths...
>>
>> Did you re-read my message from last time? When you pass the
>>document to the transcoder you need to pass in a 'base' URL that it
>>will then use to resolve your relative references. The base URL should
>>look less the first part of the above link, for example:
>> "file:///usr/local/tomcat/webapps/Watermark"
>>
>>
>>>I have more info that might help you guys debug my problem.... when
>>>using an image's abs filepath (so a filenotfound exception definitely
>>>doesnt occur), and rasterizing to just 'test.jpg' (relative save
>>>path), it saves not to the webapps directory which is what i expected.
>>>it saves to tomcat/bin. now am i doin something wrong? If anyone can
>>>help again, it is much appreciated.
>>
>> Well, yes you are using relative paths for something that needs
>>an absolute path, not surprisingly 'tomcat/bin' is the 'default'
>>directory (also known as the current working directory) for tomcat after
>>all that is where it is started from. I don't know a lot about tomcat
>>but I imagine you can provide configuration parameters to the servlets
>>I would make the 'root' of the servlet's directory tree a config
>>parameter and then pass that as the base URL of the document when you
>>go to transcode.
>>
>>
>>
>>>thanks
>>>Arian Hojat.
>>>
>>>PS
>>> (if anyone has a simple servlet that saves an svg that uses relative
>>>filepaths(to an image file pretend) and saves to a reltive location, i
>>>would love to put it on my server and see if maybe its a server
>>>setting and not my code),
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>>>For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>>For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: updated question about svg filepaths. using batik in tomcat
Posted by Arian Hojat <ar...@gmail.com>.
Doh!, i musta missed that Transcoder.setURI() suggestion in your
previous email. Sorry. Thanks, i will try it out later tonight...
also... is this URI being passed a file system path
(file:///c:/dir1/dir2) or web base path
(http://www.blah.com/absDir1/absDir2)?
or whatever i fancy.
thanx again,
Arian Hojat
On 4/27/05, Thomas DeWeese <Th...@kodak.com> wrote:
> Arian Hojat wrote:
> > Hello i posted a while back about my <image> tag references not workin
> > in a java servlet i made. I got around it on my windows machine/tomcat
> > server by using the absolute filepath to the image file to use in my
> > svg file, which then gets rasterized. but when i moved the code to
> > unix production server i forgot the paths dont work.
>
> Sure they do, they just have a different 'base' to them.
>
> > so i use bascially use unix abs paths when i encounter '/' and create
> > tags like this...
>
> This isn't correct it should be more like:
> xlink:href="file:///usr/local/tomcat/webapps/Watermark/WEB-INF/w.png"
>
> > Anyway this saves a 0 kb jpeg, not seeming to save same as. but i am
> > still longing to get relative filepaths working and i got some batik
> > help from u all last time, but to no avail, i just went and used abs.
> > filepaths...
>
> Did you re-read my message from last time? When you pass the
> document to the transcoder you need to pass in a 'base' URL that it
> will then use to resolve your relative references. The base URL should
> look less the first part of the above link, for example:
> "file:///usr/local/tomcat/webapps/Watermark"
>
> > I have more info that might help you guys debug my problem.... when
> > using an image's abs filepath (so a filenotfound exception definitely
> > doesnt occur), and rasterizing to just 'test.jpg' (relative save
> > path), it saves not to the webapps directory which is what i expected.
> > it saves to tomcat/bin. now am i doin something wrong? If anyone can
> > help again, it is much appreciated.
>
> Well, yes you are using relative paths for something that needs
> an absolute path, not surprisingly 'tomcat/bin' is the 'default'
> directory (also known as the current working directory) for tomcat after
> all that is where it is started from. I don't know a lot about tomcat
> but I imagine you can provide configuration parameters to the servlets
> I would make the 'root' of the servlet's directory tree a config
> parameter and then pass that as the base URL of the document when you
> go to transcode.
>
>
> >
> > thanks
> > Arian Hojat.
> >
> > PS
> > (if anyone has a simple servlet that saves an svg that uses relative
> > filepaths(to an image file pretend) and saves to a reltive location, i
> > would love to put it on my server and see if maybe its a server
> > setting and not my code),
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: updated question about svg filepaths. using batik in tomcat
Posted by Thomas DeWeese <Th...@Kodak.com>.
Arian Hojat wrote:
> Hello i posted a while back about my <image> tag references not workin
> in a java servlet i made. I got around it on my windows machine/tomcat
> server by using the absolute filepath to the image file to use in my
> svg file, which then gets rasterized. but when i moved the code to
> unix production server i forgot the paths dont work.
Sure they do, they just have a different 'base' to them.
> so i use bascially use unix abs paths when i encounter '/' and create
> tags like this...
This isn't correct it should be more like:
xlink:href="file:///usr/local/tomcat/webapps/Watermark/WEB-INF/w.png"
> Anyway this saves a 0 kb jpeg, not seeming to save same as. but i am
> still longing to get relative filepaths working and i got some batik
> help from u all last time, but to no avail, i just went and used abs.
> filepaths...
Did you re-read my message from last time? When you pass the
document to the transcoder you need to pass in a 'base' URL that it
will then use to resolve your relative references. The base URL should
look less the first part of the above link, for example:
"file:///usr/local/tomcat/webapps/Watermark"
> I have more info that might help you guys debug my problem.... when
> using an image's abs filepath (so a filenotfound exception definitely
> doesnt occur), and rasterizing to just 'test.jpg' (relative save
> path), it saves not to the webapps directory which is what i expected.
> it saves to tomcat/bin. now am i doin something wrong? If anyone can
> help again, it is much appreciated.
Well, yes you are using relative paths for something that needs
an absolute path, not surprisingly 'tomcat/bin' is the 'default'
directory (also known as the current working directory) for tomcat after
all that is where it is started from. I don't know a lot about tomcat
but I imagine you can provide configuration parameters to the servlets
I would make the 'root' of the servlet's directory tree a config
parameter and then pass that as the base URL of the document when you
go to transcode.
>
> thanks
> Arian Hojat.
>
> PS
> (if anyone has a simple servlet that saves an svg that uses relative
> filepaths(to an image file pretend) and saves to a reltive location, i
> would love to put it on my server and see if maybe its a server
> setting and not my code),
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org