 |
Community: Java Enterprise Archives
PHP talk at a Java conference?
Posted by ludo on June 20, 2008 at 08:58 AM | Permalink
| Comments (2)
Bonjour,
Next week, I'll be in Zurich for the Jazoon
conference
with the GlassFish crew. This is a Java conference, and I'll be talking
about....PHP and OpenSolaris and the OpenSolaris WebStack (Apache,
MySQL, PHP,...). What!!! PHP at a Java conference? Am I crazy?
I hope not. OpenSolaris
2008.05 is not your father's Solaris. It is something I can
use and it comes with a modern AMP stack. So what is the relationship
with Java then? Well, since I am a GlassFish developer (and NetBeans
developer, and Eclipse developer), I'll be talking about the possible
integrations of the AMP stack and GlassFish:
- Configuring the OpenSolaris Apache and GlassFish with
mod_jk to have parts of your Apache web site served with GlassFish
- Configuring the PHP-Java
Bridge on OpenSolaris to extend your PHP applications with
'legacy calls' to Java processing performed under GlassFish
- Using daily builds of NetBeans 6.5 that have killer support
for:
- Editing and debugging JavaScript
- Creating PHP project, editing and debugging PHP files
with the OpenSolaris AMP stack. Yeahhh! NetBeans can do PHP!
- Adding jMaki Ajax snippets into PHP projects
- Using GlassFish V2 and V3 (V3 plugin is *now* part of the
NetBeans 6.5 builds) Java EE project to demonstrate the PHP-Java
interoperability
And on Monday, we will host a Jazoon
GlassFish day, so if you are around, please stop by
and ask as many crazy questions you want. The GlassFish team will be
there and well represented. Thanks Alexis for organizing this GlassFish
day.
Next stop will be Ajaccio and Britany, but definitely not for work:-)
Ludo
GlassFish V3 TP2 and NetBeans 6.1
Posted by ludo on May 04, 2008 at 04:18 AM | Permalink
| Comments (1)
Bonjour,
GlassFish
V3 TP2 is now available. If you want to use it, or even
download it from
NetBeans 6.1, just fire the IDE, go the
tools->plugins menu and refresh the list of modules, you should
see 2 modules, one for Java EE development and one for jRuby projects.
Just watch the images to see how you can get both the NetBeans modules,
and then download the GlassFish V3 TP2 runtime, and see the 2 new
libraries registered by the Server: EclipseLink to do JPA entity beans
work and Grizzly Comet to do cool Comet Applications...
Most of the Java EE support from NetBeans 6.1 works with GlassFish V3
TP2 (Db to JPA, JPA to JSF, jMaki, Jersey RestFul services,...) and if
you are a jRuby on Rails developers, you can now select the GlassFish
server as s deployment target for your NetBeans jRoR projects...
Just scroll through the following images, and you'll know everything
about this new NetBeans/GlassFish integration:












Ludo.
CommunityOne JavaOne 2008
Posted by ludo on April 30, 2008 at 09:44 AM | Permalink
| Comments (0)
Bonjour,
Here comes the JavaOne/CommunityOne craziness again next week. The
conference week will mark the end of long hours and days of preparation
in many different topics:
- OpenSolaris Indiana Web Stack integration (Apache, MySQL,
PHP)
- GlassFish V3 TP2
- GlassFish V3 TP2 plugin for NetBeans 6.1 (for Web
Applications and jRuby On Rails Applications)
- GlassFish V3 TP2 plugin for Eclipse 3.3
- jMaki version 1.8: Plugins for NetBeans(JSP, PHP, Ruby,
Phobos) and Eclipse (JSP)
OpenSolaris Indiana Web Stack integration (Apache, MySQL, PHP)
I'll be presenting to the CommunityOne
OpenSolaris Sessions the current status of AMP support in the brand new
OpenSolaris distro. Details
here. Topics will be Apache, MySQL, PHP support in Indiana,
NetBeans PHP support, IPS repository support, Desktop Integration,
possibly PHP Debugging on OpenSolaris, and Dtrace Support.

CommunityOne is on Sunday, May 4th, the day before JavaOne.
Here is the list of talks for the OpenSolaris track:
- Getting Started with OpenSolaris; New Features &
Building OpenSolaris Packages -- David Comay, Stephen Hahn
- OpenSolaris Operating System and SAMP (Solaris OS, Apache,
MySQL, PHP) Support for Web 2.0 Development: Developer
Experience -- Ludovic Champenois, Jyri Virkki
- A Student and New User View of the OpenSolaris OS -- James
Hughes
- Develop, Consolidate, and Manage Virtual Environments
entirely in Open Source -- Achim Hasenmueller, Joost Pronk
- OpenSolaris Operating System for Intel: Present and Future
-- David Stewart, Intel Corporation
- The OpenSolaris™ Operating System and Storage --
James Hughes
- OpenSolaris™ Operating System and Wireless
Networking Advances -- Geeta Krishna, Intel Corporation
- OpenSolaris™ Installfest: Get it NOW!
There will be an after party at Moscone Center this sunday (May 4th).
From 6-8pm, there will be a CommunityOne event featuring OpenSolaris at
Moscone in SF which featuring a live DJ and have a Cinco De Mayo theme.
I'll be also talking for the CommunityOne GlassFish track:
- S295418 - Tools for GlassFish V3 (Java EE Platform and
Scripting Environment) -- Ludovic Champenois, Vivek Pandey
Of course, GlassFish V2 is available in the OpenSolaris IPS repository:

You can use the Package Manager GUI to download GlassFish V2 in
Opensolaris:

GlassFish V3 TP2
Glassfish V3 is the next version after the excellent GlassFish
V2...Duhhh...But wait OSGI support, , EJB inside Web Applications (yes,
not in EJB Modules), JPA with EclipseLink JPA provider, jRuby on Rails
Applications support, Phobos support, Jython/Django, Groovy (with
JSF/Groovy support...wait for some killer demos), IPS based update
Center, NetBeans support, Eclipse support, ANT support, Embed ability
support, sub second startup time, Cometd support (lots of cool demos at
JavaOne), Jersey RestFul Web Services support, jMaki support, already
really good web performance (thanks Grizzly and Java NIO, thanks!)...
...
Apr 9, 2008 8:44:48 PM
INFO: Created and Initialized container: ejbName:
NewSessionEJBBean
Apr 9, 2008 8:44:48 PM
com.sun.enterprise.v3.deployment.DeployCommand execute
INFO: Deployment of WebApplicationWithEJBs done
is 638 ms
...
GlassFish V3 TP2 plugin for NetBeans 6.1 (for Web
Applications and jRuby On Rails Applications)
NetBeans 6.1 IDE just shipped, but wait.... go the the Update Center,
and download the GlassFish V3 TP2 plugins, one for Java EE support, one
for the jRuby on Rails projects to get all the incredible Java EE or
jRuby developer features that are packed in the IDE with a V3 target...
You cannot beat NetBeans 6.1 for Java EE and Ruby features, no way!!!
GlassFish V3 TP2 plugin for Eclipse 3.3
For the Eclipse enthusiasts, GlassFish V3 TP2 server has a plugin as well, so
that you can develop Dynamic Web Projects (via WTP) and deploy/debug
them with a GlassFish V3 target, including JPA EclipseLink database
applications. Or and if you recall GlassFish V3 TP2 is OSGI
based, then, you'll understand a bit more this screen showing GlassFish
OSGI modules running embedded inside the Eclipse IDE:
GlassFish V3 TP2 running embedded inside Eclipse 3.3
See the list of OSGI bundles in this "About Eclipse" dialog:
jMaki version 1.8: Plugins for NetBeans(JSP, PHP, Ruby,
Phobos) and Eclipse (JSP)
The new jMaki plugins for NetBeans 6.1 and Eclipse will show up later
this week on the update centers or the https://ajax.dev.java.net site
So, I guess you have now a sense of the crazy days before CommunityOne
and JavaOne. Hope to see you there in person next week,
Merci,
Ludo
Eclipse Foundation and GlassFish community
Posted by ludo on March 17, 2008 at 01:21 PM | Permalink
| Comments (0)
Bonjour,
I just love it when things are aligned. Today, it is about Eclipse and
Sun, or I should say Eclipse Foundation and the GlassFish community.
Read it at http://www.eclipse.org/org/press-release/20080317_Eclipselink.php
: EclipseLink will be used in GlassFish V3
Application Server (Java EE 6) and it will be the reference
implementation for JPA
(Java Persistence API) 2.0.
Correct me if I am wrong, but it seems to be the first press release
ever done mentioning those 2 names: Eclipse Foundation and Sun
Microsystems. If you are an Eclipse user, I hope you have noticed the
*only* company name that is displayed in the Eclipse splash screen. If
not, pay attention the next time you see the screen...
As you might know, I've been involved a lot in the J2EE and Java EE
support in NetBeans, and honestly, I can tell this is one of the best
support you can get for Java EE developers. And I have also been
involved in the GlassFish (V1, V2 and V3) plugin for Eclipse as well as
the jMaki plugin for Eclipse. It is good to be able to reach as many
developers as possible and give them access to one of the best
application server out there.
This week, EclipseCon
conference is happening in Santa Clara, and Carla Mott and I will be
speaking about GlassFish V2, GlassFish V3, jMaki and
Eclipse: See http://www.eclipsecon.org/2008/?page=sub/&id=36.
Our talk is Thurday, March 20th at 10:30 am Grand BallRoom F: Eclipse:
Enterprise Apps and Rich Front-end using GlassFish and jMaki.
If you are not familiar about the GlassFish Application Server support
in Eclipse, please read these pages:
- https://glassfishplugins.dev.java.net/
- http://weblogs.java.net/blog/ludo/archive/2007/06/glassfish_tooli.html
- https://glassfishplugins.dev.java.net/eclipse33/index.html
- and watch the screencat at http://weblogs.java.net/blog/arungupta/archive/2007/06/screencast_ws6.html
Both the GlassFish plugin and the jMaki plugin are being updated this
week (tomorrow?) for a better GlassFish V3 support and a brand new
jMaki 1.1 beta support. We are just doing the final testing today.
Enjoy, and as always, feedback is welcome,
Ludo
Web Stack in SXDE
Posted by ludo on February 05, 2008 at 07:42 AM | Permalink
| Comments (1)
Hi,
today, Sun is releasing a new version of Solaris Express developer
Edition (SXDE) that you can download for free at
http://developers.sun.com/sxde
The reason why this release is significant is that for the first time,
a complete Web Stack is integrated and ready to use after the
installation of the operating system (DVD or VMWare image) on your
laptop of desktop.
This release includes the latest tools (NetBeans 6.0 and
NetBeans PHP support, Sun Studio), and technologies (JDK 1.6, Apache
2.2, PHP 5.2.4, MySQL 5, PostgresQL 8, Ruby, GlassFish Java
EE 5), to create applications for the Open Solaris OS, Java
Application Platforms, and Web 2.0.
I've created
a screencast that explains how to initialize the Web Stack
for a Solaris Desktop user, how to start the Apache2 and MySQL servers,
how to administer the stack, how to create and run a simple demo, how
to use the NetBeans PHP IDE to create, deploy and debug PHP
applications, all these steps done in a rushing 10 minutes. So fasten
your seat belt.
ScreenCast
available here.
Now if you do not have the time or the bandwith to watch the screen
cast, you can view a few images taken from the screencast below:
Default Welcome page in Firefox (bundled) for SXDE 1/08:

Desktop Menu to Initialize the Web Stack:

Desktop Menus after the initialization of the Web Stack:

Web Stack Options UI console:

Registering a MySQL database connection in the NetBeans PHP
IDE:
Running a PHP Project via the NetBeans PHP IDE

Debugging a PHP project int he NetBeans PHP IDE:
As you see, it is so simple that I was even able to create a debug a
PHP application is less than 10 minutes. So give it a try, this is
going to be a great year for Open Solaris and Web developers.
Install SXDE 01/08 (free at
http://developers.sun.com/sxde)
on your desktop or laptop, using VMWare (Mac, PC,...) or not,
and give it a try,
Ludo
100% Java Quercus PHP engine running in GlassFish Java EE 5 Application Server...
Posted by ludo on March 09, 2007 at 09:53 PM | Permalink
| Comments (16)
Bonjour, Comment Java?
I spent a few hours playing with Quercus,
the Caucho Technology's 100% Java implementation of PHP 5,
trying to make it run with the GlassFish Java EE 5 application Server.
Quercus comes with many
PHP modules and extensions like PDF, PDO, MySQL, and JSON.
Download the quercus
engine
war file.
Unzip this
quercus-3_1-snap.war war
file, and copy the 2 files quercus.jar and resin-util.jar from the
WEB-INF/lib archive directory to the GlassFish lib/addons directory
(GLASSFISHINSTALLDIR/lib/addons)
If the GlassFish
Application Server is
not using JDK 1.6, but only JDK 1.5, you'll also need the
javax.scripting.* JSR 223 apis. You can get the jsr223-api.jar file
from the Phobos
CVS repository, and store it as well under the
GLASSFISHINSTALLDIR/lib/addons
directory.
One final configuration
file for php is
needed. It is called
GLASSFISHINSTALLDIR/domains/domain1/config/php.ini and should
contain as a minimum this property value:
default_mimetype=text/html
Nothing more, nothing less.
(If you are
using a different GlassFish domain, just put this php.ini file in the
domain's config directory.
So to recap, this is the
files you
should have on disk for configuring a PHP engine with GlassFish:
- GLASSFISHINSTALLDIR/
- quercus.jar (taken from
the quercus-3_1-snap.war)
- resin-util.jar (taken form
the quercus-3_1-snap.war)
- jsr223-api.jar (taken from
Phobos CVS
repository)
- php.ini that contains default_mimetype=text/html
That's it...
Now using your favorite IDE
(vi, or
NetBeans), you can create a simple Web Application, and what you need
to do is declare the PHP engine as a servlet and the location of the
php.ini file, as follow:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <description>Caucho Technology's PHP Implementation, Running on GlassFish Java EE 5</description> <servlet> <servlet-name>Quercus Servlet</servlet-name> <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class> <init-param> <param-name>php-ini-file</param-name>
<param-value>php.ini</param-value> </init-param> </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>
Now you are all set: this Web App is PHP ready. Just Add PHP
files under the web folder area, where you would put your JSPs files.
The simplest index.php can be:
<?php echo "Hello World"; ?>
If you want to test the Java interoperability, you can go wild
and crazy with this:
<?php echo "Hello mom, look I have a date: "; $a = new java("java.util.Date", 123); echo $a->toString(); ?>
Or even crazier, you can test that the Ajax
jMaki project is working also in PHP applications, including
the ones using the Quercus PHP pure Java engine running int he
GlassFish Java EE 5 container...The sky is the limit.
A complex PHP application is MediaWiki.
Untar the mediawiki PHP application archive inside the WEB-INF area of
your web application, and redeploy it (if you are using NetBeans, you
have almost nothing to do as NetBeans does an update of the deployed
build area when files are modified in the source area). Activate the
Web Application at the correct URL to see if MediaWiki 1.9.3 home page
is correct as below:
Here is the PHP index page...
<?php # Initialise common code require_once('./includes/WebStart.php' );
# Initialize MediaWiki base class
require_once("includes/Wiki.php" );
$mediaWiki = new MediaWiki();
wfProfileIn('main-misc-setup' );
OutputPage::setEncodings(); # Not really used yet
# Query string fields
$action = $wgRequest->getVal( 'action', 'view' ); $title = $wgRequest->getVal( 'title' );
$wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
if ($wgTitle == NULL) { unset( $wgTitle ); }
# # Send Ajax requests to the Ajax dispatcher. # if ( $wgUseAjax && $action == 'ajax' ) { require_once( $IP . '/includes/AjaxDispatcher.php' ); $dispatcher = new AjaxDispatcher(); $dispatcher->performAction(); $mediaWiki->restInPeace( $wgLoadBalancer ); exit; }
wfProfileOut('main-misc-setup' ); # Setting global variables in mediaWiki
$mediaWiki->setVal('Server', $wgServer ); $mediaWiki->setVal('DisableInternalSearch', $wgDisableInternalSearch );
$mediaWiki->setVal('action', $action ); $mediaWiki->setVal('SquidMaxage', $wgSquidMaxage ); $mediaWiki->setVal('EnableDublinCoreRdf', $wgEnableDublinCoreRdf ); $mediaWiki->setVal('EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf ); $mediaWiki->setVal('CommandLineMode', $wgCommandLineMode ); $mediaWiki->setVal('UseExternalEditor', $wgUseExternalEditor ); $mediaWiki->setVal('DisabledActions', $wgDisabledActions );
$wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest ); $mediaWiki->finalCleanup( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
$mediaWiki->doUpdates($wgPostCommitUpdateList ); $mediaWiki->restInPeace($wgLoadBalancer ); ?>
The setup page as rendered with Pure Java Quercus PHP engine on
GlassFish: (Sorry, I did not have the time to configure the MySQL
database yet)
For more info, read http://quercus.caucho.com/
and the documentation under http://quercus.caucho.com/quercus-3.1/index.xtp
.
The pure Java PHP engine is still an Alpha version, so please
try it, break it and give feedback. The list of PHP applications the
caucho team will be testing is very impressive:
And do not forget that the Ajax jMaki project
is PHP friendly, and JSP friendly, and Server Side JavaScript
Phobos friendly...
A Plus,
Ludo
|