You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by bary <pe...@stonline.sk> on 2007/05/29 20:02:12 UTC

Applet in portal coplet

Hi!

I am trying to run an applet in cocoon under portal. I have included it in
the html page this way:

<objectX classid="java:test.SampleApplet.class" archive="sampleapplet.jar"
width="800" height="600" codetype="application/java">
</objectX>

I have tried also:

        <APPLETX
          CODE="test.SampleApplet.class"
          archive="sampleapplet.jar"
                NAME="SampleApplet"
          WIDTH=800
          HEIGHT=600>
        </APPLETX>

(The X is written behind tag object and applet to don't be interpreted here
in the forum's site)

The applet source code is included in the sampleapplet.jar file (the
SampleApplet class is located in the "test" package). The sitemap contains
this:

    <map:match pattern="AppletPage.html">
      <map:generate src="AppletPage.html" type="html"/>
      <map:serialize type="html"/>
    </map:match>

    <map:match pattern="**.class">
      <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
    </map:match>
    <map:match pattern="**.jar">
      <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
    </map:match>

The sampleapplet.jar is located in the lib subdirectory of the directory
containing the sitemap. If I go to the URL of the html page directly -
http://localhost:8080/cocoon/..../AppletPage.html (not through the portal)
everything is ok and the applet runs. The html page is included in the
portal’s coplet. If I get to the page through it, it doesn’t work. If I
delete the applet from the page, the page is displayed right. Has anyone
already used applets in portal's coplets and have an idea what I am doing
wrong?
-- 
View this message in context: http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10859375
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: Applet in portal coplet

Posted by bary <pe...@stonline.sk>.
Hi Andreas,

I have tried your suggestion, but it didn't work when I only changed the
matching pattern for jar files. I have tried to change also the matching
pattern for class files. Then it seemed, that the it can find already the
neccessary files, but an exception occured:

java.lang.ClassFormatError: Incompatible magic value 1347093252 in class
file test/SampleApplet
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


Any ideas, how to solve this??



Andreas Kuehne-2 wrote:
> 
> Hi Bary,
> 
> I would guess once you're with the coplet you use a different path than
> called directly. Are there any strange accesses reported within the log
> file ?
> 
> Anyway, try to use a path wildcard matcher for the jar like this :
> 
>     <map:match pattern="**/*.jar">
>       <map:read src="lib/{2}.jar" mime-type="application/java-archive"/>
>     </map:match>
> 
> 
> Good luck
> 
> Andreas
> 
> ----- Original Message ----
> From: bary <pe...@stonline.sk>
> To: users@cocoon.apache.org
> Sent: Tuesday, May 29, 2007 8:02:12 PM
> Subject: Applet in portal coplet
> 
> 
> Hi!
> 
> I am trying to run an applet in cocoon under portal. I have included it in
> the html page this way:
> 
> <objectX classid="java:test.SampleApplet.class" archive="sampleapplet.jar"
> width="800" height="600" codetype="application/java">
> </objectX>
> 
> I have tried also:
> 
>         <APPLETX
>           CODE="test.SampleApplet.class"
>           archive="sampleapplet.jar"
>                 NAME="SampleApplet"
>           WIDTH=800
>           HEIGHT=600>
>         </APPLETX>
> 
> (The X is written behind tag object and applet to don't be interpreted
> here
> in the forum's site)
> 
> The applet source code is included in the sampleapplet.jar file (the
> SampleApplet class is located in the "test" package). The sitemap contains
> this:
> 
>     <map:match pattern="AppletPage.html">
>       <map:generate src="AppletPage.html" type="html"/>
>       <map:serialize type="html"/>
>     </map:match>
> 
>     <map:match pattern="**.class">
>       <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
>     </map:match>
>     <map:match pattern="**.jar">
>       <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
>     </map:match>
> 
> The sampleapplet.jar is located in the lib subdirectory of the directory
> containing the sitemap. If I go to the URL of the html page directly -
> http://localhost:8080/cocoon/..../AppletPage.html (not through the portal)
> everything is ok and the applet runs. The html page is included in the
> portal’s coplet. If I get to the page through it, it doesn’t work. If I
> delete the applet from the page, the page is displayed right. Has anyone
> already used applets in portal's coplets and have an idea what I am doing
> wrong?
> -- 
> View this message in context:
> http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10859375
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10888027
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


RE: Applet in portal coplet

Posted by Jeroen Reijn <j....@hippo.nl>.
Hi Bary,

you can set the log levels in the logkit.xconf in your cocoon/WEB-INF/ directory.

Kind regards,

Jeroen Reijn


-----Original Message-----
From:	bary [mailto:peter.bartalos@stonline.sk]
Sent:	Thu 31-5-2007 21:20
To:	users@cocoon.apache.org
Cc:	
Subject:	Re: Applet in portal coplet


Hi Andreas,

can you tell me how should I set the log level for the category 'sitemap' up
to 'DEBUG'?



Andreas Kuehne-2 wrote:
> 
> Hi Bary,
> 
> try to set the log level for the category 'sitemap' up to 'DEBUG' .
> 
> Next time you call into the server the sitemap log will give you detailed
> information which matcher solves your request ( or wich didn't ! ) and you
> can track down your problem.
> 
> I would bet that you see completely wrong content, not the classes you
> expected. Maybe you get the default error page, which does a really bad
> job acting as a java class ;-)
> 
> 
> Good luck
> 
> Andreas
> 
> ----- Original Message ----
> From: bary <pe...@stonline.sk>
> To: users@cocoon.apache.org
> Sent: Thursday, May 31, 2007 8:13:12 AM
> Subject: Re: Applet in portal coplet
> 
> 
> Hi Andreas,
> 
> I have tried your suggestion, but it didn't work when I only changed the
> matching pattern for jar files. I have tried to change also the matching
> pattern for class files. Then it seemed, that the it can find already the
> neccessary files, but an exception occured:
> 
> java.lang.ClassFormatError: Incompatible magic value 1347093252 in class
> file test/SampleApplet
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(Unknown Source)
>     at java.security.SecureClassLoader.defineClass(Unknown Source)
>     at sun.applet.AppletClassLoader.findClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at sun.applet.AppletClassLoader.loadClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at sun.applet.AppletClassLoader.loadCode(Unknown Source)
>     at sun.applet.AppletPanel.createApplet(Unknown Source)
>     at sun.plugin.AppletViewer.createApplet(Unknown Source)
>     at sun.applet.AppletPanel.runLoader(Unknown Source)
>     at sun.applet.AppletPanel.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> 
> 
> Any ideas, how to solve this??
> 
> 
> 
> Andreas Kuehne-2 wrote:
>> 
>> Hi Bary,
>> 
>> I would guess once you're with the coplet you use a different path than
>> called directly. Are there any strange accesses reported within the log
>> file ?
>> 
>> Anyway, try to use a path wildcard matcher for the jar like this :
>> 
>>     <map:match pattern="**/*.jar">
>>       <map:read src="lib/{2}.jar" mime-type="application/java-archive"/>
>>     </map:match>
>> 
>> 
>> Good luck
>> 
>> Andreas
>> 
>> ----- Original Message ----
>> From: bary <pe...@stonline.sk>
>> To: users@cocoon.apache.org
>> Sent: Tuesday, May 29, 2007 8:02:12 PM
>> Subject: Applet in portal coplet
>> 
>> 
>> Hi!
>> 
>> I am trying to run an applet in cocoon under portal. I have included it
>> in
>> the html page this way:
>> 
>> <objectX classid="java:test.SampleApplet.class"
>> archive="sampleapplet.jar"
>> width="800" height="600" codetype="application/java">
>> </objectX>
>> 
>> I have tried also:
>> 
>>         <APPLETX
>>           CODE="test.SampleApplet.class"
>>           archive="sampleapplet.jar"
>>                 NAME="SampleApplet"
>>           WIDTH=800
>>           HEIGHT=600>
>>         </APPLETX>
>> 
>> (The X is written behind tag object and applet to don't be interpreted
>> here
>> in the forum's site)
>> 
>> The applet source code is included in the sampleapplet.jar file (the
>> SampleApplet class is located in the "test" package). The sitemap
>> contains
>> this:
>> 
>>     <map:match pattern="AppletPage.html">
>>       <map:generate src="AppletPage.html" type="html"/>
>>       <map:serialize type="html"/>
>>     </map:match>
>> 
>>     <map:match pattern="**.class">
>>       <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
>>     </map:match>
>>     <map:match pattern="**.jar">
>>       <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
>>     </map:match>
>> 
>> The sampleapplet.jar is located in the lib subdirectory of the directory
>> containing the sitemap. If I go to the URL of the html page directly -
>> http://localhost:8080/cocoon/..../AppletPage.html (not through the
>> portal)
>> everything is ok and the applet runs. The html page is included in the
>> portal’s coplet. If I get to the page through it, it doesn’t work. If I
>> delete the applet from the page, the page is displayed right. Has anyone
>> already used applets in portal's coplets and have an idea what I am doing
>> wrong?
>> -- 
>> View this message in context:
>> http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10859375
>> Sent from the Cocoon - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10888027
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10900334
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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





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


Re: Applet in portal coplet

Posted by bary <pe...@stonline.sk>.
Hi Andreas,

can you tell me how should I set the log level for the category 'sitemap' up
to 'DEBUG'?



Andreas Kuehne-2 wrote:
> 
> Hi Bary,
> 
> try to set the log level for the category 'sitemap' up to 'DEBUG' .
> 
> Next time you call into the server the sitemap log will give you detailed
> information which matcher solves your request ( or wich didn't ! ) and you
> can track down your problem.
> 
> I would bet that you see completely wrong content, not the classes you
> expected. Maybe you get the default error page, which does a really bad
> job acting as a java class ;-)
> 
> 
> Good luck
> 
> Andreas
> 
> ----- Original Message ----
> From: bary <pe...@stonline.sk>
> To: users@cocoon.apache.org
> Sent: Thursday, May 31, 2007 8:13:12 AM
> Subject: Re: Applet in portal coplet
> 
> 
> Hi Andreas,
> 
> I have tried your suggestion, but it didn't work when I only changed the
> matching pattern for jar files. I have tried to change also the matching
> pattern for class files. Then it seemed, that the it can find already the
> neccessary files, but an exception occured:
> 
> java.lang.ClassFormatError: Incompatible magic value 1347093252 in class
> file test/SampleApplet
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClass(Unknown Source)
>     at java.security.SecureClassLoader.defineClass(Unknown Source)
>     at sun.applet.AppletClassLoader.findClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at sun.applet.AppletClassLoader.loadClass(Unknown Source)
>     at java.lang.ClassLoader.loadClass(Unknown Source)
>     at sun.applet.AppletClassLoader.loadCode(Unknown Source)
>     at sun.applet.AppletPanel.createApplet(Unknown Source)
>     at sun.plugin.AppletViewer.createApplet(Unknown Source)
>     at sun.applet.AppletPanel.runLoader(Unknown Source)
>     at sun.applet.AppletPanel.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> 
> 
> Any ideas, how to solve this??
> 
> 
> 
> Andreas Kuehne-2 wrote:
>> 
>> Hi Bary,
>> 
>> I would guess once you're with the coplet you use a different path than
>> called directly. Are there any strange accesses reported within the log
>> file ?
>> 
>> Anyway, try to use a path wildcard matcher for the jar like this :
>> 
>>     <map:match pattern="**/*.jar">
>>       <map:read src="lib/{2}.jar" mime-type="application/java-archive"/>
>>     </map:match>
>> 
>> 
>> Good luck
>> 
>> Andreas
>> 
>> ----- Original Message ----
>> From: bary <pe...@stonline.sk>
>> To: users@cocoon.apache.org
>> Sent: Tuesday, May 29, 2007 8:02:12 PM
>> Subject: Applet in portal coplet
>> 
>> 
>> Hi!
>> 
>> I am trying to run an applet in cocoon under portal. I have included it
>> in
>> the html page this way:
>> 
>> <objectX classid="java:test.SampleApplet.class"
>> archive="sampleapplet.jar"
>> width="800" height="600" codetype="application/java">
>> </objectX>
>> 
>> I have tried also:
>> 
>>         <APPLETX
>>           CODE="test.SampleApplet.class"
>>           archive="sampleapplet.jar"
>>                 NAME="SampleApplet"
>>           WIDTH=800
>>           HEIGHT=600>
>>         </APPLETX>
>> 
>> (The X is written behind tag object and applet to don't be interpreted
>> here
>> in the forum's site)
>> 
>> The applet source code is included in the sampleapplet.jar file (the
>> SampleApplet class is located in the "test" package). The sitemap
>> contains
>> this:
>> 
>>     <map:match pattern="AppletPage.html">
>>       <map:generate src="AppletPage.html" type="html"/>
>>       <map:serialize type="html"/>
>>     </map:match>
>> 
>>     <map:match pattern="**.class">
>>       <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
>>     </map:match>
>>     <map:match pattern="**.jar">
>>       <map:read src="lib/{1}.jar" mime-type="application/java-archive"/>
>>     </map:match>
>> 
>> The sampleapplet.jar is located in the lib subdirectory of the directory
>> containing the sitemap. If I go to the URL of the html page directly -
>> http://localhost:8080/cocoon/..../AppletPage.html (not through the
>> portal)
>> everything is ok and the applet runs. The html page is included in the
>> portal’s coplet. If I get to the page through it, it doesn’t work. If I
>> delete the applet from the page, the page is displayed right. Has anyone
>> already used applets in portal's coplets and have an idea what I am doing
>> wrong?
>> -- 
>> View this message in context:
>> http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10859375
>> Sent from the Cocoon - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10888027
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Applet-in-portal-coplet-tf3835576.html#a10900334
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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