eskatos's thoughts

Posts Tagged ‘glassfish

asadmin-maven-plugin-0.2 released

with 3 comments

GlassfishI released the second version of asadmin-maven-plugin today.

It added the following features :

  • Issue#1: support for maven projects with “ejb” packaging
  • support for (un)deploying to remote glassfish instance (thanks to Larry Sanderson that provided the patch)

The following issues were fixed :

  • Issue#2: asadmin is not found when only glassfishHome is specified and glassfishHome/bin not in PATH (thanks to streifi that provided a patch)
  • Issue#3: asadmin:start-domain hangs on windows (thanks again to streifi)

Go to the project’s page for more information.

Written by eskatos

July 20, 2008 at 5:45 pm

Posted in Projects

Tagged with , ,

Maven plugins for Glassfish ecosystem

with 7 comments

GlassfishThis post is only a snapshot of what is available at the time of writing to use Glassfish from maven., seen from the perspective of a simple maven plugin developer (simple plugin or simple developer ?).

Before beginning asadmin-maven-plugin, I searched and tried several ways to use Glassfish from maven. Main use case is simply deployment and undeployment of applications.

There are two ways to do this “programmatically” :

  • using the asadmin command, Glassfish specific,
  • and using the JSR-88 api, app-server agnostic

Read the rest of this entry »

Written by eskatos

March 28, 2008 at 12:31 am

Posted in Projects

Tagged with , , ,

A repository for asadmin-maven-plugin

without comments

GlassfishTo ease the use of asadmin-maven-plugin I have set up a public repository that you can add to your maven settings / poms / proxies for maven to be able to download the plugin automagically.

The repositories are :

Here is the xml snippet you could add to your pom.xml file :

    <pluginRepositories>
        <pluginRepository>
            <id>asadmin-maven-plugin-releases-repository</id>
            <name>asadmin-maven-plugin-releases-repository</name>
            <url>http://asadmin-maven-plugin.googlecode.com/svn/trunk/repository/releases</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>asadmin-maven-plugin-snapshots-repository</id>
            <name>asadmin-maven-plugin-snapshots-repository</name>
            <url>http://asadmin-maven-plugin.googlecode.com/svn/trunk/repository/snapshots</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
    </pluginRepositories>

Plus, if you browse the source tree you’ll find two exemple projects, a WAR and an EAR, that use this plugin.

Written by eskatos

March 26, 2008 at 12:30 am

Posted in Projects

Tagged with , , ,

A simple maven plugin for Glassfish: asadmin-maven-plugin

with 2 comments

GlassfishTo seamlessly use Glassfish from maven projects, JSR-88 seems to be answer. The cargo maven plugin has JSR-88 support planned but this will take time.

I published some days ago a maven plugin that simply wraps the asadmin command and aims to provide maven integration for starting, stopping glassfish and deploying and undeploying applications and modules.

Go to the Google Code page of asadmin-maven-plugin to download a preview version named asadmin-maven-plugin-0.1-SNAPSHOT : http://code.google.com/p/asadmin-maven-plugin/

The api is designed for easy extensibility so feel free to submit contributions !
Read the rest of this entry »

Written by eskatos

March 24, 2008 at 4:30 pm

Posted in Projects

Tagged with , ,

Glassfish, Hibernate and WebServices – WSGEN Classpath

with 2 comments

Java XMLFollowing my quick and dirty how-to about using hibernate in glassfish I came across a small pitfall when dealing with metro webservices.

The glassfish’s wsgen classpath on Glassfish is not by domain, ie. the wsgen tool is not run in the domain class-loader.

When trying to deploy a webservice that returns an entity with a hibernate annotation, I got this following error :

Deploy error

Server logs showed the following trace :

/home/paul/Programs/glassfish-v2-b58g/domains/domain1/applications/j2ee-apps/ear-0.1-SNAPSHOT/lib/entities-0.1-SNAPSHOT.jar(app/model/entities/User.class):
        warning: Cannot find annotation method 'value()' in type 'org.hibernate.annotations.Fetch':
        class file for org.hibernate.annotations.Fetch not found
Problem encountered during annotation processing;
see stacktrace below for more information.
java.lang.NullPointerException
        at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.isSubtype(WebServiceAP.java:360)
        ...... SNIP ......
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
error: compilation failed, errors should have been reported
Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException: WSGEN FAILED
        at com.sun.enterprise.webservice.WsUtil.genWSInfo(WsUtil.java:2

Adding the hibernate-annotations.jar file in the glassfish main lib/ directory added the necessary classes to the wsgen classpath.

Written by eskatos

October 16, 2007 at 1:38 am

Posted in Code

Tagged with , , ,

Building an EJB3 app using GlassFish v2, Maven2 and NetBeans 6

without comments

In an article explicitly titled Building an EJB 3.0 application using GlassFish v2, Apache Maven 2 and NetBeans IDE 6.0, Jacek Laskowski explain in detail how Netbeans 6 can be used by maven users willing to use GlassFish as an EJB3 container.

I’m currently doing these type of things with Netbeans 6 but I didn’t know it was feasible with so few command line maven invocations.

Written by eskatos

October 10, 2007 at 11:41 pm

Posted in Tools

Tagged with , , , , ,

Quick and dirty howto : Use Hibernate in Glassfish V2

with 12 comments

UPDATE:

As Leon pointed in comments, it’s not a good idea to put the hibernate jars in the app server classpath like in this post. Hibernate community has published a howto explaining how to use Hibernate in Glassfish

Hibernate


For my first post here I’ll write a quick and dirty howto for using Hibernate inside the Glassfish V2 container.

  1. Download Hibernate projects
  2. Put’em in the domain’s lib dir
  3. Change your persistence.xml file
  4. Enjoy :)

Details are following :
Read the rest of this entry »

Written by eskatos

October 9, 2007 at 9:48 am

Posted in Code, HOWTOs

Tagged with , , ,