Hi, Bernard

I don't know which version of Java plug-in you are using for your Web
browser. It reminded me an issue with Java plug-in 1.4.*, Javascript is
executed in different threads. The work around is to create a thread in
your applet and do all transform work in this thread. Take a look of sample
codes: org.apache.xalan.client.XSLTProcessorApplet.java which is used in
AppletXMLtoHTML sample or CompiledApplet sample.

Christine Li
XSLT Development
IBM Toronto Lab
Tel: (905)413-2601
Email: [EMAIL PROTECTED]


                                                                                
                                                       
                      [EMAIL PROTECTED]                                         
                                                       
                      motel.com                To:       [EMAIL PROTECTED]      
                                            
                                               cc:                              
                                                       
                      08/05/2003 12:04         Subject:  Re: 
ClassNotFoundException when using an Applet                               
                      PM                                                        
                                                       
                                                                                
                                                       
                                                                                
                                                       



Hello Christine

Thanks for helping me. I forgot to mention that other methods (in my main
class) which are not using my Java XSLT Extensions, just work fine.
Therefore I assume that my applet tag is correct since the web browser
finds the MyApplet class an all related file such as DTD and XML. The
MyApplet class in turn instantiates my application (class) for message
processing with Xalan.

I also tried to run my transformation method in the init() method of the
applet and surprisingly got the right return value. it seems that problem
is limited to calling the applets transformation method from JavaScript.

I also have no clue how to debug/breakpoint this situation since the things
happen between the web browser(HTML/JavaScript) and the applet.

Regards,
Bernard

At 16:47 05.08.2003, you wrote:
> HI, Bernard
>
> It looks like that the problem is related to how you deployed your
> applet(class path problem). In the <applet /> tag, you should use
codebase
> attribute to specify the URI of net.myexp.msg.extension.MSGExtension or
use
> archive attribute to specify the jar file which contents the
> MSGExtension.class.
> Hope it will help,
>
> Christine Li
> XSLT Development
> IBM Toronto Lab
> Tel: (905)413-2601
> Email: [EMAIL PROTECTED]


>> Hello everybody
>>
>> I wrote a little application which does some transformation from a
specific
>> messaging protocol into XML and vice versa. It works well when used as
an
>> application but does not work correctly when used with/as an "hidden"
>> applet (simple wrapper) and accessed by JavaScript.
>> Here are the exceptions:
>>
>> javax.xml.transform.TransformerException:
java.lang.ClassNotFoundException:
>> net/myexp/msg/extension/MSGExtension
>> at net.myexp.msg.MSGXalan25.msg2xmlAsString(MSGXalan25.java:1603)
>> at MyApplet.msg2xmlString(MyApplet.java:65)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> at java.lang.reflect.Method.invoke(Unknown Source)
>> at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
>> at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
>>
>> The applet and the "main application" do use the MSGExtension class
(which
>> I use to avoid stack overflows during transformation) without any
problems
>> but the transformer can't find it at all only when used with an applet.
>>
>> Here is some additional info about my application:
>>
>> Xerces-J 2.4.0
>> Xalan Java 2.5.1
>>
>> <xsl:stylesheet version="1.0" xmlns:xsl="
>> http://www.w3.org/1999/XSL/Transform";
>> xmlns:java="http://xml.apache.org/xalan/java";
>> exclude-result-prefixes="java">
>> <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
>>    .
>>    .
>> <xsl:variable name="getString" select="
>> java:net.myexp.msg.extension.MSGExtension.getString('String')"/>
>>
>>
>>
>> Any help would be much appreciated.
>>
>> THX,
>> Bernard



Reply via email to