Tuesday Nov 25, 2008

Modifying the CustomerDBSpring sample REST application to run on Glassfish V3



Netbeans 6.5 comes with sample applications (CustomerDB and CustomerDBSpring)  that demonstrate how to use the Jersey REST APIs. By default these deploy on Glassfish V2.


If you want to try this on Glassfish V3, you will need to change your persistence.xml to use EclipseLink instead of Toplink. (EclipseLink is the new JPA provider in V3 ).  This should do the trick:



<persistence-unit name="CustomerDBSpringPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/sample</jta-data-source>
    <class>customerdb.Customer</class>
    <class>customerdb.DiscountCode</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="eclipselink.target-database" value="Derby"/>
      <property name="eclipselink.logging.level" value="FINE"/>
    </properties>
 </persistence-unit>


Wednesday Feb 21, 2007

Seam Security demo running on Glassfish



After a little hacking, I have the new JBoss Seam booking demo running under GlassFish. This is based on Seam 1.1.6GA and uses the new Seam security model (which looks very cool).

The sample source code that ships with the Seam 1.1.6 glassfish demo is missing some crucial settings:
  • Your web.xml needs a ejb-ref definition to the new Authenticator bean
  • Seam security requires a drools securtyRules.drl config file
  • You need to include the associated drools libraries (even if you don't use drools)
  • components.xml needs to declare the location of the drools securtyRules.drl file


I also reworked the demo to make it open as a Netbeans Enterprise project.  If you want to run this, you will need:

  • GlassFish. I used the latest 9.0 UR1 build
  • Netbeans. I used Netbeans 5.5.1 (it has some fixes to integrate with later GlassFish builds)
  • The Seam 1.1.6GA distribution

You can download the NetBeans project file at  http://mediacast.sun.com/share/warren/seamBooking.zip


You will need to define a few Libraries using the NetBeans library manager.  I wish there was a nice way of exporting library definitions in NetBeans - but until then I have resorted to the hack of packing up my library definitions from ~/.netbeans/....  as a zip file. If you are brave, you can try dropping these into your own private NetBeans library folder (after editing the library paths), or failing that, have a look at the xml defs and it should be fairly obvious which jar files you need to include. 

Here are the Netbeans library xml definitions: http://mediacast.sun.com/share/warren/SEAM-Libraries.zip


Enjoy





powered by performancing firefox

Thursday Aug 03, 2006

SEAM and Glassfish, new JSF fixes



Good news for fellow glassfisher's who want to play with SEAM.

According to this thread the JSF problems that impacted SEAM have now been fixed. You will want to be running Glassfish V1 B04 or later, or Glassfish V2 B10+.

About

Things that amuse me

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News

No bookmarks in folder

Blogroll