Monday Feb 28, 2011

GlassFish 3.1 and NetBeans 7.0

Folks have been working feverishly to put the finishing touches on GlassFish Server 3.1... and it is strutting it's stuff on the virtual red carpet this morning... a finished product.

NetBeans 7.0 is still under development and will ship with GlassFish Server 3.1 when it is released . The dev build downloads have been bundling the latest promoted builds of GlassFish Server 3.1

The integration plugin has also allowed users to download the 'latest promoted build' for some time. I am making the code changes that will make the 3.1 FCS bits 'the bits' that get downloaded when the user decides to Download Now... the 3.1 server.

I have posted a number of blog entries that outline some of the features that are supported by GlassFish Server 3.1 and the integration with NetBeans:

Register an existing 3.1 install in NetBeans 7.0
The registration wizard automatically detects which kind of GlassFish Server (3.0 or 3.1) you are trying to register. In earlier implementations of the registration wizard the user had to select the version correctly.
Download and 'install' GlassFish Server OSE 3.1
The plugin had been allowing users to download and install promoted builds while the 3.1 release has been under development. Now that the server has shipped, the plugin allows users to download the release bits.
Restart a remote domain
This feature is actually supported by 3.0 and 3.1.
Enable/disable deployed applications
Users have been able enable and disable deployed applications and modules with asadmin. It wasn't considered to be a must have feature of plugin. That changed when the application versioning feature went live in 3.1 builds. When it became really easy for a project to become disabled (by deploying a new version of the project), it became important to be able to enable the older version after the user undeployed the latest version of project.
Restart a remote domain in debug mode
This is a feature of the plugin that only works with 3.1. This allows users to Debug->Debug Project when they are working with a project that targets a remote domain.
View the server log of a remote domain
This is a feature of the plugin that only works with 3.1, since it depends on the extended features of the REST interface of 3.1.
Create glassfish-\*.xml files for descriptors and resources.
These are new descriptor files associated with 3.1.
Web service management nodes in the Servers explorer
This is a feature of the plugin that only works with 3.1, since it depends on the extended features of the REST interface of 3.1.
Application scoped resources
Users can take advantage of this 3.1 feature by altering the location of the glassfish-resources.xml file in their projects that target 3.1. The integration plugin tracks the file's location so changes that are triggered by wizards and the like get written into the file correctly.
Wizards to create Oracle WebLogic Server deployment descriptors
This was added to the 3.1 plugin, so users would be able to create 'empty' descriptors for projects that do not actually target WLS.

Thursday Dec 16, 2010

Fewer Wizards, More Magic

summary of recent changes in the registration wizard for GlassFish Server 3.0.x and GlassFish Server 3.1[Read More]

Sunday Sep 19, 2010

IDE Feature, now available from the command-line

Folks that use NetBeans and GlassFish together have enjoyed the benefits of having the IDE automatically register and update resources for many years. This is one of the features that folks doing command-line based deployment have requested for many years, too. For those folks that have been waiting, I have good news. The feature is in GlassFish Server 3.1, though it is going by the name Application Scoped Resources. Jagadish provides a lot of details about application scoped resources and Alexis produced a screen cast that demonstrates application scoped resources.

After seeing all their hard work, I decided to see how I could support the feature in NetBeans.

We have been creating a file called sun-resources.xml to persist resource definitions in NetBeans for awhile. I recently made the changes necessary to start naming that file glassfish-resources.xml when a project targets GlassFish Server 3.1.

The file is currently used by the IDE to drive its automatic resource registration, if it is present in the 'Server Resources' logical folder for a project when the project is deployed. Move this file to someplace else to prevent the IDE from creating and updating resources. If you Cut the file out of the Server Resources logical folder and Paste it into

  1. the WEB-INF folder under the 'Web Pages' logical folder, you will have a Web Application project that leverages application scoped resources, OR
  2. the 'Configuration Files' logical folder, you will have an EJB Module or Enterprise Application project that leveraged application scoped resources,


Two projects, transformed to leverage application scoped resources.

The IDE doesn't do the resource registration and updates after this change. The server will when the app is deployed.

IDE features that would update the glassfish-resources.xml file will update the file in its new location after you have moved it out of the 'Server Resources' logical folder, automatically.

If you use JPA, you need to make one change to the persistence.xml file that is generated by NetBeans when you create your entity beans. You will need to change the value of the jta-data-source element. For example, if your persistence.xml says

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 
        xmlns="http://java.sun.com/xml/ns/persistence" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="EJBModule23PU" transaction-type="JTA">
    <jta-data-source>jdbc/myJDBCresource
    <properties/>
  </persistence-unit>
</persistence>
you will need to change it to say
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 
       xmlns="http://java.sun.com/xml/ns/persistence" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="EJBModule23PU" transaction-type="JTA">
    <jta-data-source>java:app/jdbc/myJDBCresource
    <properties/>
  </persistence-unit>
</persistence>

If you use JDBC directly in your code, you will need to make sure that you create a glassfish specific deployment descriptor to map the logical JDBC resource to the actual resource's JNDI name.

I have to admit, none of this would work without the hard work that Jagadish and Mitesh had to do to in the server code to get this feature working. Thanks guys. You rock.

You can start to leverage application scoped resources in modules and apps that use JPA on GlassFish Server 3.1 promoted builds 20 (and higher).

Friday Sep 10, 2010

Web Service Nodes of a GlassFish Server 3.1 instance

NetBeans has supported web service development for quite a while but... I always hit an issue when I develop web services clients that bothered me... I never knew the wsdl url for services that I had deployed. So, if I was creating a client for a web service, I would need to have the service's implementation project available OR I would need to fire up the admin gui to find out what the wsdl url is to complete either of these two dialogs:


The Add Web Service dialog


The Create Web Service Client dialog

I got tired of feeling stupid and opening the admin gui to lookup the wsdl url (or to run the 'tester'), so I started to look for a solution for folks that do web service development against GlassFish Server 3.1.... and here it is in a single screenshot:


Web services on a registered server exposed with
an action to test the service and
an action to copy the wsdl url to the clipboard

A special shoutout to Ludovic Champenois and Jitendra Kotamraju for exposing the data that I needed, restfully.

NOTE: To see these new nodes you will need to get a recent nightly build of NetBeans 6.10 that includes GlassFish Server 3.1 build 20 or higher (or a post September 9, 2010 nightly build of GlassFish Server 3.1)

Sunday Aug 22, 2010

Create domains that use the default ports

Some will call this a new feature. Some will call this a bug fix.

I call it a chance to slap my forehead, really hard, again.

A couple years ago, we made it really hardIMPOSSIBLE to use NetBeans to create a domain that uses the 'default ports'. The strategy we decided to employ was one that would let users create multiple domains that could run at the same time.

That has changed, today.

If you want to create a domain that can run while another domain is running, you will need to uncheck the 'Use default ports' control. If there is some process active on the default ports (like 4848 or 8080), the dialog opens with 'Use default ports' unselected AND disabled. If you hover over the disabled control, the tool tip will provide more details about the 'problem'.

Friday Aug 20, 2010

GlassFish Server 3.1 builds integrated into NetBeans dev builds


Big 'Thank you' to Dmitry Lipin.

Monday Aug 02, 2010

Supporting glassfish-resources.xml

In my initial blog post about GlassFish Server 3.1 support in NetBeans dev builds, I mentioned that projects that target 3.1 will get glassfish-\*.xml deployment descriptors instead of sun-\*.xml deployment descriptors. There are a number of other files that are getting name and content changes in 3.1. One of the files that is getting changed is the resource definition file, previously known as sun-resources.xml.

If you create a project that targets GlassFish Server 3.1 and that project needs to define resources, the definitions will be persisted in a file named glassfish-resources.xml.


WebApp431 (web app for three one) targets GlassFish Server 3.1


The content of an automatically generated glassfish-resources.xml file.
About


Vince Kraemer writes the entries in this blog.

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
Blogroll

No bookmarks in folder

automarks