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 Praveen Nayak <Pr...@telelogic.com> on 2007/08/28 09:26:16 UTC

Batik hosted on server looks for more class files and not found

Hi,

 

 I have built the batik-all.jar and created an applet around it. I have
hosted it on an IIS Web server, by embedding the applet inside a web
page.

 

Now, the references I have given in the applet tag are the following:

 

 

"batik-all.jar,xerces_2_5_0.jar,js.jar,xml-apis.jar,xml-apis-ext.jar"

 

 

When the page is downloaded by the client, the image comes up alright.
But there was one problem I noticed. The applet starts sending requests
to the server. These requests come by the hundreds.

The server doesn't have these classes and returns HTTP 401 error.

 

 

The requests were for classes like the following: 

 

/org/w3c/dom/DeleteList.class 

/java/lang/PieTotalSize.class

/org/w3c/dom/smil/PieTotalSize.class

 

There were more classes as well.

 

I searched around and couldn't find the classes among the Jars required
for Batik.

 

I have attached the applet also if that helps.

 

It looks to me that the calls are because of the lines:

 

 
canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);

                        canvas.setDocument(doc);

 

 

Can you tell me if there is something wrong?

 

Also,

Please let me know if there is some more information I can provide.

 

 

Thanks,

Praveen 
--------------------------------------------------------------------------------
Telelogic Lifecycle Solutions:
              
Helping You Define, Design & Deliver
            Advanced Systems & Software
Learn
        More at www.telelogic.com 

Praveen Nayak
Technical Leader
Telelogic India Pvt Ltd
#58, 1- 4 HM Towers,
Brigade Road,
560 025 Bangalore
India

Phone: +91 (80) 419 95800 Ext 327
Fax: 
Mobile phone:

Praveen.Nayak@telelogic.com
http://www.telelogic.com

Telelogic - Requirements-Driven Innovation!
-------------------------------------------------------------



The information contained in this e-mail,
including any attachment or enclosure, is intended only for the person or
entity to which it is addressed and may contain confidential material. Any
unauthorized use, review, retransmissions, dissemination, copying or other
use of this information by persons or entities other than the intended
recipient is prohibited.

Re: Batik hosted on server looks for more class files and not found

Posted by Steffen Jacobs <ja...@arcor.de>.
Praveen Nayak wrote:
>
> Hi,
>
>  
>
>  I have built the batik-all.jar and created an applet around it. I
> have hosted it on an IIS Web server, by embedding the applet inside a
> web page.
>
>  
>
> Now, the references I have given in the applet tag are the following:
>
>  
>
>  
>
> "batik-all.jar,xerces_2_5_0.jar,js.jar,xml-apis.jar,xml-apis-ext.jar"
>
>  
>
>  
>
> When the page is downloaded by the client, the image comes up alright.
> But there was one problem I noticed. The applet starts sending
> requests to the server. These requests come by the hundreds.
>
> The server doesn't have these classes and returns HTTP 401 error.
>
>  
>
>  
>
> The requests were for classes like the following:
>
>  
>
> /org/w3c/dom/DeleteList.class
>
> /java/lang/PieTotalSize.class
>
> /org/w3c/dom/smil/PieTotalSize.class
>
>  
>
> There were more classes as well.
>
>  
>
> I searched around and couldn't find the classes among the Jars
> required for Batik.
>
>  
>
> I have attached the applet also if that helps.
>
>  
>
> It looks to me that the calls are because of the lines:
>
>  
>
>                        
> canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
>
>                         canvas.setDocument(doc);
>
>  
>
>  
>
> Can you tell me if there is something wrong?
>
The missing class files do not belong to Batik itself. It seems to me,
that the svg file you are trying to load uses some ECMAScript/Javascript
features and therefore references to those classes. So I guess you
should have a look at that location where you find the SVG image.

Regards,
Steffen
>
>  
>
> Also,
>
> Please let me know if there is some more information I can provide.
>
>  
>
>  
>
> Thanks,
>
> Praveen
>
> --------------------------------------------------------------------------------
> *Telelogic Lifecycle Solutions:
> ** Helping You Define, Design & Deliver Advanced Systems & Software
> Learn More at **www.telelogic.com* <http://www.telelogic.com/>
>
>
> Praveen Nayak
> Technical Leader
> Telelogic India Pvt Ltd
> #58, 1- 4 HM Towers,
> Brigade Road,
> 560 025 Bangalore
> India
>
> Phone: +91 (80) 419 95800 Ext 327
> Fax:
> Mobile phone:
>
> Praveen.Nayak@telelogic.com <ma...@telelogic.com>
> http://www.telelogic.com <http://www.telelogic.com/>
>
> *
> **Telelogic - Requirements-Driven Innovation!
> ------------------------------------------------------------- *
>
>
> The information contained in this e-mail, including any attachment or
> enclosure, is intended only for the person or entity to which it is
> addressed and may contain confidential material. Any unauthorized use,
> review, retransmissions, dissemination, copying or other use of this
> information by persons or entities other than the intended recipient
> is prohibited.
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> 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: Batik hosted on server looks for more class files and not found

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Praveen.

Praveen Nayak:
> I asked about this in the Rhino forum and Norris gave me the following
> suggestion:
> ...
> * Remove importPackage calls. You'll have to change existing code that 
> relies upon the package import, of course. 
> * Declare global variables before using them. I haven't tested this, 
> but a quick read of the ImporterTopLevel code makes it look like Rhino 
> will test first to see if global variables are defined before 
> attempting to load a class of that name.
> ...
> http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/
> thread/a8e60144d4c76b68/ce9df605a451f6df#ce9df605a451f6df
> 
> I then checked the Batik source and found that "importPackage" is only
> called in the RhinoInterpreter constructor. If I remove this call, the
> rendering of SVG and execution of the JS had no problem. The hits to the
> server are also stopped.
> 
> So, I wanted to know if anyone can foresee any problem removing this
> call.

Those importPackage calls cause the various DOM interface objects to be
visible in the global scope (e.g. Node, Element, Document, etc.) as well
as the classes from java.lang.  Actually I’m not sure why the java.lang
classes are imported; I think it’d be fine to require the author to
import them specifically.

Anyway, if the importPackage call is to be removed, it should be
replaced with a bunch of importClass calls so that the individual
classes/interfaces from those packages are still imported.

A patch to do this would be welcome.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Batik hosted on server looks for more class files and not found

Posted by Praveen Nayak <Pr...@telelogic.com>.
Hi,

I asked about this in the Rhino forum and Norris gave me the following
suggestion:
...
* Remove importPackage calls. You'll have to change existing code that 
relies upon the package import, of course. 
* Declare global variables before using them. I haven't tested this, 
but a quick read of the ImporterTopLevel code makes it look like Rhino 
will test first to see if global variables are defined before 
attempting to load a class of that name.
...
http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/
thread/a8e60144d4c76b68/ce9df605a451f6df#ce9df605a451f6df

I then checked the Batik source and found that "importPackage" is only
called in the RhinoInterpreter constructor. If I remove this call, the
rendering of SVG and execution of the JS had no problem. The hits to the
server are also stopped.

So, I wanted to know if anyone can foresee any problem removing this
call.

Thanks,
Praveen

-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: Wednesday, August 29, 2007 6:43 AM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Batik hosted on server looks for more class files and not
found

Hi Praveen,

"Praveen Nayak" <Pr...@telelogic.com> wrote on 08/28/2007
03:26:16 
AM:

>  I have built the batik-all.jar and created an applet around it.

> When the page is downloaded by the client, the image comes up 
> alright. But there was one problem I noticed. The applet starts 
> sending requests to the server. These requests come by the hundreds.
> The server doesn't have these classes and returns HTTP 401 error.
> 
> The requests were for classes like the following: 
> 
> /org/w3c/dom/DeleteList.class 

    This is a feature of Rhino the JavaScript implementation that
we use.  Unfortunately I'm not aware of a good/simple solution to
the problem.

> I searched around and couldn't find the classes among the Jars 
> required for Batik.

   As part of trying to resolve global variables Rhino checks
a list of packages to see if they define a class with that name.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org 
--------------------------------------------------------------------------------
Telelogic Lifecycle Solutions:
Helping You Define, Design & Deliver Advanced Systems & Software 
Learn More at www.telelogic.com 

Praveen Nayak 
Technical Leader 
Telelogic India Pvt Ltd 
#58, 1- 4 HM Towers,
Brigade Road, 
560 025 Bangalore 
India 

Phone: +91 (80) 419 95800 x327 
Fax: 
Mobile phone: 
Praveen.Nayak@telelogic.com 
http://www.telelogic.com 

Telelogic - Requirements-Driven Innovation!
------------------------------------------------------------- 


The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Batik hosted on server looks for more class files and not found

Posted by th...@kodak.com.
Hi Praveen,

"Praveen Nayak" <Pr...@telelogic.com> wrote on 08/28/2007 03:26:16 
AM:

>  I have built the batik-all.jar and created an applet around it.

> When the page is downloaded by the client, the image comes up 
> alright. But there was one problem I noticed. The applet starts 
> sending requests to the server. These requests come by the hundreds.
> The server doesn't have these classes and returns HTTP 401 error.
> 
> The requests were for classes like the following: 
> 
> /org/w3c/dom/DeleteList.class 

    This is a feature of Rhino the JavaScript implementation that
we use.  Unfortunately I'm not aware of a good/simple solution to
the problem.

> I searched around and couldn't find the classes among the Jars 
> required for Batik.

   As part of trying to resolve global variables Rhino checks
a list of packages to see if they define a class with that name.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org