Archive

Archive for the ‘Web’ Category

Atmosphere : Resin and Websockets

August 10, 2010 Leave a comment

I want to let you know that since the release of Caucho Resin 4.0, Atmosphere applications can be deploy on Resin and will be supported natively. Resin 4.0 implements Servlet 3.0.

That’s really good. Another web server that is supported.

What about the Websocket’s Caucho implementation… nah ! There implementation is too buggy right now. I suppose the code it using a early release of the Websocket specs, and never updated it. Anyway, Websocket application won’t work on Resin 4.0 :(

We posted a thread on there forum here : http://forum.caucho.com/showthread.php?t=10680

but still didn’t received news from them. So until they fix it, I suggest that you try your Websocket application on another web server like Glassfish.

You can follow me on Twitter

Native Websphere support for Atmosphere not yet

August 9, 2010 Leave a comment

Just a little note that we try to add Websphere native support for Atmosphere. We work really hard to find an API that could allow us to do that, but is simply impossible.

We were able to get in touch with the dev team of Websphere and the dev team of WebSphere Application Server Feature Pack for Web 2.0. They have demo that used bayeux for comet application or JMS to simulate asynchronous connections, but it’s not a complete asynchronous solution.

Even with the addon WebSphere Application Server Feature Pack for Web 2.0, you can’t suspend and resume a connection. Websphere server doesn’t support that. It’s not supported in WAS 7.0, but in 8.0 alpha there should be Servlet 3.0 support.

Until IBM do something about that, or wait for WAS 8.0, you will still be able to deploy Atmosphere application on WAS but it will use BlockingIO (one blocking thread by connection).

If that is not enough for you, I suggest Glassfish as alternative. Of course, we will continue to monitor the situation. Maybe the community call could be enough to wakeup them :)

You can follow me on Twitter

Native Websphere support for Atmosphere not yet

August 9, 2010 Leave a comment

Just a little note that we try to add Websphere native support for Atmosphere. We work really hard to find an API that could allow us to do that, but is simply impossible.

We were able to get in touch with the dev team of Websphere and the dev team of WebSphere Application Server Feature Pack for Web 2.0. They have demo that used bayeux for comet application or JMS to simulate asynchronous connections, but it’s not a complete asynchronous solution.

Even with the addon WebSphere Application Server Feature Pack for Web 2.0, you can’t suspend and resume a connection. Websphere server doesn’t support that. It’s not supported in WAS 7.0, but in 8.0 alpha there should be Servlet 3.0 support.

Until IBM do something about that, or wait for WAS 8.0, you will still be able to deploy Atmosphere application on WAS but it will use BlockingIO (one blocking thread by connection).

If that is not enough for you, I suggest Glassfish as alternative. Of course, we will continue to monitor the situation. Maybe the community call could be enough to wakeup them :)

You can follow me on Twitter

Grizzly Deployer (1.9.19) new features

August 7, 2010 Leave a comment

It has been a while since a blog about Grizzly, I was too busy adding new features. The Grizzly Deployer’s community grows and requested theses new features.

Here a quick list of the changes :

  • Websockets support
  • Watch folder
  • Can starts without applications to deploy
  • Can be embedded and extended easily
  • and few bug fixes (thanks to the community)

A little overview or remainder of what is Grizzly Deployer

Grizzly Deployer is a bundle of Grizzly project that act as a web container. It will allow you to deploy applications (war, servlet).
Works fine for Comet, Atmosphere, JSP applications … For more details, I suggest this link Introduction to the first release of Grizzly Deployer

First, lets take a look at the command line parameters.


Usage: com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer

  -a, --application=[path]    Application(s) path(s).

                              Application(s) deployed can be :
                              Servlet(s), war(s) and expanded war folder(s).
                              To deploy multiple applications
                              use File.pathSeparator

                              Example : -a /app.war:/servlet/web.xml:/warfolder/

  -p, --port=[port]           Runs Servlet on the specified port.
                              Default: 8080

  -c, --context=[context]     Force the context for a servlet.
                              Only valid for servlet deployed using
                              -a [path]/[filename].xml

  --dontstart=[true/false]    Won't start the server.
                              You will need to call the start method.
                              Useful for Unit testing.
                              Default : false

  --libraryPath=[path]        Add a libraries folder to the classpath.
                              You can append multiple folders using
                              File.pathSeparator

                              Example : --libraryPath=/libs:/common_libs

  --autodeploy=[path]         AutoDeploy to each applications.
                              You could add JSP support.
                              Just add a web.xml that contains Jasper

                              Example : --autodeploy=/autodeploy

  --webdefault=[path]         webdefault to be used by all applications, can be file or dir with multipe web.xmls.
                              If you want to add only one webdefault point it to web.xml file,
                              If you want multiple files to be included put them in one dir and provide this location here.

                              Example : --webdefault=webdefault.xml

  --cometEnabled=[true/false] Starts the AsyncFilter for Comet.
                              You need to active this for comet applications.
                              Default : false

  --websocketsEnabled=[true/false] Starts the AsyncFilter for Websockets.
                              You need to active this for websockets applications.
                              Default : false

  --forceWar=[true/false]     Force war's deployment over a expanded folder.
                              Will deploy the war instead of the folder.
                              Default : false

  --ajpEnabled=[true/false]   Enable mod_jk.
                              Default : false

  --watchInterval=[seconds]   Watch interval to scan for new applications to deploy in work folder.
                              Default : -1 ; disabled

  --watchFolder=[path]        Folder to scan for new applications to deploy in work folder
                              Default : none

Websocket support

The first feature added was Websockets support. It can be enabled at command line by using the parameter –websocketEnabled=true . That will allow you to deploy Websocket applications.

Watch folder

This feature is interesting, because most of the web container have it. Grizzly Deployer will watch a specific folder to applications to deploy. When this feature was added, I remove the need to specify a application to deploy by command line.
To enable this feature you need to use the command line parameter –watchFolder=[path]. It can be used with this other parameter : –watchInterval=[seconds].

The parameter –watchInterval is used to create a watchdog that will monitor the watch folder. If the parameter –watchInterval is not present, when Grizzly Deployer starts, it will check
all applications that are in the watch folder at launch time and will deploy them, but it won’t monitor the folder after that.

When both of theses parameters are used, it will create a watchdog that will deploy and undeploy application put in the watch folder, and remove from that folder. If you deploy an application at command line and put another application with the
same context name in the watch folder, the application in the watch folder won’t be deploy twice.

Embedded Grizzly Deployer

Grizzly Deployer could already be embedded trough his API, but we got few feedback about to make it simplier. The problem wasn’t the API, it just that most people will only use the main part of Grizzly Deployer : deploy a war.

So to make it easier and faster to implement, I did a little refactoring. We now have 2 main config classes we could use to launch an Embedded Grizzly Deployer : DeployerServerConfiguration and DeployableConfiguration.

DeployerServerConfiguration

That file is used to launch Grizzly Deployer. It contains the same command line parameters. In fact, at runtime, the command line parser use that classe.


    GrizzlyWebServerDeployer deployer = new GrizzlyWebServerDeployer();
    
    DeployerServerConfiguration conf = new DeployerServerConfiguration();
    conf.cometEnabled = true;
    conf.watchFolder="C:/temp/webapps/";
    conf.watchInterval=15;
    deployer.launch(conf);                             

Once grizzly Deployer is launched in your application, you can deploy a war later. For that, you use this class : DeployableConfiguration.


    DeployableConfiguration warConfig = new DeployableConfiguration();  
    warConfig.location = "C:/temp/webapps/grizzly-jmaki.war";
    
    deployer.deployApplication(warConfig);                           

You can follow me on Twitter.

Categories: Grizzly, Web Tags: , , ,

GWS Deployer 1.9.17 : Reloaded : New Features Part 3 : PHP Support

May 24, 2010 Leave a comment

In a previous post : PART2 I describe how to run JSP over Grizzly. Now I’ll show you how to run PHP over Grizzly.

here a sample web.xml file for PHP support. (I’m using Quercus, but you could use native PHP too).


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<description>Caucho Technology's PHP Implementation</description>

<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.php</welcome-file>
</welcome-file-list>

</web-app>

The last step is to put the required jars into the classpath.
You could put them in the command line with -cp or –classpath or you could use Deployer’s param :

–libraryPath=[path]

Example : –libraryPath=/libs:/common_libs

With that you can have PHP support only if you want.

Follow us on Twitter

Categories: Grizzly, Web Tags: , , ,

GWS Deployer 1.9.17 : Reloaded : New Features Part 2 : JSP Support

May 24, 2010 Leave a comment

Grizzly Deployer got lot of activity recently over mailing list, so I took the time to give you a new feature
that been added to the release 1.9.17. The Autodeploy command.

You should see that option like a default web.xml config that will be append to all your webapps
that you will deploy. You can activate this feature by adding this param to the command line :

java -jar grizzly-http-servlet-deployer-1.9.18-SNAPSHOT.jar –autodeploy=[path]

Example : –autodeploy=/folder/autodeploy

You need to create one of more web.xml files that you will put in that folder. Each web.xml config will be append to all your webapps.

here a sample for JSP support using Jasper.


<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>

</web-app>

The last step is to put the required jars into the classpath.
You could put them in the command line with -cp or –classpath or you could use Deployer’s param :

–libraryPath=[path]
Example : –libraryPath=/libs:/common_libs

With that you can have JSP support only if you want.

Follow us on Twitter

Categories: Grizzly, Web Tags: , , ,

GWS Deployer 1.9.17 : Reloaded : New Features Part 1

May 24, 2010 Leave a comment

It has been a while since my last post, but I’m back :)

I worked hard on new features that will bring GWS Deployer to another level. You can check the features that were there before 1.9.17 in my previous post here

It will be easier to list the new features by looking at the command line parameters.


Usage: com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer

--application=[path]* Application(s) path(s).
--port=[port] Runs Servlet on the specified port.
--context=[context] Force the context for a servlet.
--dontstart=[true/false] Won't start the server.
--libraryPath=[path] Add a libraries folder to the classpath.
--autodeploy=[path] AutoDeploy to each applications
--cometEnabled Starts the AsyncFilter for Comet
--forceWar Force war's deployment over a expanded folder.
--ajpEnabled Enable mod_jk.
--help Show this help message.
--longhelp Show detailled help message.

* are mandatory

The first new parameter is : –longhelp

This parameter will give a better explanation and default values.

 
java -jar http-servlet-deployer-1.9.17-SNAPSHOT.jar --longhelp


Usage: com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer

-a, --application=[path]* Application(s) path(s).

Application(s) deployed can be :
Servlet(s), war(s) and expanded war folder(s).
To deploy multiple applications
use File.pathSeparator

Example : -a /app.war:/servlet/web.xml:/warfolder/


-p, --port=[port] Runs Servlet on the specified port.
Default: 8080

-c, --context=[context] Force the context for a servlet.
Only valid for servlet deployed using
-a [path]/[filename].xml

--dontstart=[true/false] Won't start the server.
You will need to call the start method.
Useful for Unit testing.
Default : false

--libraryPath=[path] Add a libraries folder to the classpath.
You can append multiple folders using
File.pathSeparator

Example : --libraryPath=/libs:/common_libs

--autodeploy=[path] AutoDeploy to each applications.
You could add JSP support.
Just add a web.xml that contains Jasper

Example : --autodeploy=/autodeploy

--cometEnabled=[true/false] Starts the AsyncFilter for Comet.
You need to active this for comet applications.
Default : false

--forceWar=[true/false] Force war's deployment over a expanded folder.
Will deploy the war instead of the folder.
Default : false

--ajpEnabled=[true/false] Enable mod_jk.
Default : false

Default values will be applied if invalid values are passed.

* are mandatory

Follow us on Twitter

Categories: Grizzly, Web Tags: ,
Follow

Get every new post delivered to your Inbox.