users@grizzly.java.net

Re: Example echo

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 25 Jan 2008 15:04:08 -0500

Hi Peter,

I've downloaded the examples and did:

> jeanfrancois-arcands-computer:~/Desktop jeanfrancoisarcand$ unzip grizzly-http-grizzletcontainer-1.6.0-beta.zip
> Archive: grizzly-http-grizzletcontainer-1.6.0-beta.zip
> inflating: META-INF/MANIFEST.MF
> inflating: apps/com/sun/grizzly/grizzlet/ChatGrizzlet.class
> inflating: apps/lib/framework-1.6-SNAPSHOT.jar
> inflating: apps/lib/http-utils-1.6-SNAPSHOT.jar
> inflating: apps/lib/http-1.6-SNAPSHOT.jar
> inflating: apps/lib/chatgrizzlet.jar
> inflating: apps/images/body-background.png
> inflating: apps/images/header-background.png
> inflating: apps/images/main-background.png
> inflating: apps/index.html
> inflating: apps/javascripts/application.js
> inflating: apps/javascripts/behaviour.js
> inflating: apps/javascripts/moo.fx.js
> inflating: apps/javascripts/moo.fx.pack.js
> inflating: apps/javascripts/prototype.js
> inflating: apps/stylesheets/default.css
> inflating: apps/grizzletContainer.jar
> inflating: lib/framework-1.6-SNAPSHOT.jar
> inflating: lib/http-utils-1.6-SNAPSHOT.jar
> inflating: lib/http-1.6-SNAPSHOT.jar
> inflating: lib/chatgrizzlet.jar
> inflating: grizzletContainer.jar
> jeanfrancois-arcands-computer:~/Desktop jeanfrancoisarcand$ java -jar grizzletContainer.jar 8080 apps com.sun.grizzly.grizzlet.ChatGrizzlet
> Jan 25, 2008 2:53:03 PM com.sun.grizzly.standalone.StaticResourcesAdapter <init>
> INFO: New Servicing page from: /Users/jeanfrancoisarcand/Desktop/apps
> Launching Grizzlet: com.sun.grizzly.grizzlet.ChatGrizzlet
> Server startup in 129 ms

Now in your case (your jar is corrupted), what you need to make sure is:

(1) Jar the CometPojoEcho into a jar under lib/MyGrizzly.jar //name.jar

I just took the ChatDemo (under grizzly/examples) and did:

> [ja120114_at_localhost comet]$ java -jar grizzly-comet-1.7-PHP.jar 8080 apps/ com.sun.grizzly.grizzlet.ChatGrizzlet
> Launching Grizzlet: com.sun.grizzly.grizzlet.ChatGrizzlet
> Server startup in 185 ms

It works fine. Just drop me your echo.jar directly so I can take a look.

Thanks and sorry for all the trouble!

--Jeanfrancois


Peter Murray wrote:
> I have attached the compiled src & src
>
> mvn 2 is used.
>
> it is assumed that this is unjar'ed in the Grizzly/grizzly/examples dir
> for the run.sh and the pom.xml
>
> thanks
>
> Peter
>
>
> ps I have same issue with your grizzlet example.
>
>
>
> On Jan 25, 2008 1:51 PM, Jeanfrancois Arcand
> <Jeanfrancois.Arcand_at_sun.com <mailto:Jeanfrancois.Arcand_at_sun.com>> wrote:
>
>
>
> Peter Murray wrote:
> > Yes, typo....
> >
> > So how do I run a pojo "Grizzly" application?
> >
> > You use the following command:
> > java -jar grizzletContainer.jar 8080 apps
> > com.sun.grizzly.grizzlet.ChatGrizzlet
>
> Right. The GrizzletContainer is something I build for the blog.
>
> >
> > there is no grizzletContainer.jar in the trunk so I looked at the
> > exceptions I got and am trying
> > grizzly-comet-webserver-1.7-SNAPSHOT.jar
> >
> > But this give me the error below.
> > The class is in the dir referenced, or the com/ folder is there.
>
> OK let me take a look as this looks like a bug.
>
> Stay tuned :-)
>
> -- jeanfrancois
>
>
> >
> > thanks
> >
> > Peter
> >
> >
> > On Jan 25, 2008 11:57 AM, Jeanfrancois Arcand
> > <Jeanfrancois.Arcand_at_sun.com <mailto:Jeanfrancois.Arcand_at_sun.com>
> <mailto:Jeanfrancois.Arcand_at_sun.com
> <mailto:Jeanfrancois.Arcand_at_sun.com>>> wrote:
> >
> > Hi Peter,
> >
> > Peter Murray wrote:
> > > Erik,
> > >
> > > Thanks for the code... it seems that the example code is
> not my
> > only problem.
> > >
> > > I put the "echo" example in the grizzely src tree on my
> local box.
> > > I build it with a mvn scrip I created.
> > > I then try to run the code with the following script:
> > > -------
> > > #
> > > export CLASSPATH=./target/classes
> > > echo $CLASSPATH
> > > #src/main/java/com/sun/grizzely/examples/
> > >
> > > java -cp $CLASSPATH -jar
> > >
> >
> ../../modules/bundles/comet/target/grizzly-comet-webserver-1.7-SNAPSHOT.jar
> > > 8888 ./target/classes/com/sun/grizzely/examples
> > > com.sun.grizzely.examples.CometPojoEcho
> >
> > is grizzely or grizzly? Seems you have a typo?
> >
> > Thanks
> >
> > -- Jeanfrancois
> >
> > > ------
> > > ./run.sh
> > > ./target/classes
> > > Jan 24, 2008 10:17:34 PM
> > > com.sun.grizzly.standalone.StaticResourcesAdapter <init>
> > > INFO: New Servicing page from:
> > >
> >
> /Users/petem/Downloads/GlassFish/Grizzly/grizzly/examples/echo/target/classes/com/sun/grizzely/examples
> > >
> > > java.lang.ClassNotFoundException:
> > com.sun.grizzely.examples.CometPojoEcho
> > > at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > > at java.security.AccessController.doPrivileged(Native Method)
> > > ------
> > > I have been looking at
> > >
> >
> http://weblogs.java.net/blog/jfarcand/archive/2007/09/introducing_gri_1.html
> > >
> > > which seems to imply I need to make my project dir look like:
> > >
> > > | 4 drwxrwxr-x 3 ja120114 ja120114 4096 Sep 20
> 22:25 com
> > > 4 drwxrwxr-x 2 ja120114 ja120114 4096 Sep 19
> 17:31 images
> > > 4 -rw-rw-r-- 1 ja120114 ja120114 1634 Sep 19 19:32
> > index.html
> > > 4 drwxrwxr-x 2 ja120114 ja120114 4096 Sep 19 20:59
> > javascripts
> > > 4 drwxrwxr-x 2 ja120114 ja120114 4096 Sep 19 21:01
> > stylesheets|
> > >
> > >
> > > I hope this is not the case.
> > >
> > > Do I need html, js, ... just to run the pojo?
> > > Or am I missing something in my script?
> > >
> > > Thanks
> > >
> > > Peter
> > >
> > >
> > >
> > > --
> > > Peter Murray
> > > murraypetera_at_gmail.com <mailto:murraypetera_at_gmail.com>
> <mailto:murraypetera_at_gmail.com <mailto:murraypetera_at_gmail.com>>
> > <mailto:murraypetera_at_gmail.com
> <mailto:murraypetera_at_gmail.com> <mailto:murraypetera_at_gmail.com
> <mailto:murraypetera_at_gmail.com>>>
> > > +1 914-414-3727
> > > AIM: retepmurray
> > > http://www.linkedin.com/in/peteramurray
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe_at_grizzly.dev.java.net
> <mailto:users-unsubscribe_at_grizzly.dev.java.net>
> > <mailto:users-unsubscribe_at_grizzly.dev.java.net
> <mailto:users-unsubscribe_at_grizzly.dev.java.net>>
> > For additional commands, e-mail:
> users-help_at_grizzly.dev.java.net <mailto:users-help_at_grizzly.dev.java.net>
> > <mailto:users-help_at_grizzly.dev.java.net
> <mailto:users-help_at_grizzly.dev.java.net>>
> >
> >
> >
> >
> > --
> > Peter Murray
> > murraypetera_at_gmail.com <mailto:murraypetera_at_gmail.com>
> <mailto:murraypetera_at_gmail.com <mailto:murraypetera_at_gmail.com>>
> > +1 914-414-3727
> > AIM: retepmurray
> > http://www.linkedin.com/in/peteramurray
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> <mailto:users-unsubscribe_at_grizzly.dev.java.net>
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
> <mailto:users-help_at_grizzly.dev.java.net>
>
>
>
>
> --
> Peter Murray
> murraypetera_at_gmail.com <mailto:murraypetera_at_gmail.com>
> +1 914-414-3727
> AIM: retepmurray
> http://www.linkedin.com/in/peteramurray
>