Tuesday January 31, 2006
Insert Witty Irony Herevince kraemer's Weblog
All
|
5 in 5
|
Compile Time
|
Ease of Evolution
|
General
|
GlassFish
|
Gotchas
|
Java
|
Music
|
NetBeans
|
Sailfin
Another way to waste a few minutes I have been helping a user duplicate the results of my Appclient calling and Stateles EJB 3.0 example. The user was seeing the Java Console open and then close right back up... I read the user's code a couple times, to no avail... It just did not work. We kept getting this message in the log: Applying default to ejb reference: Unresolved Ejb-Ref client.Main/bean@jndi: beans.DistantGreeting@null@beans.DistantGreeting@Session@null
The Root CauseThe user had implemented the method defined in the DistantGreeting interface but did not "implement DistantGreeting". So, I am joining Cay Horstmann to call for better error messages and diagnotic tools. I have filed a couple issues against GlassFish (issue 208 and 209). Now, I am headed over to NetBeans.org to file a couple issues there... (2006-01-31 14:17:21.0) PermalinkI guess that's what you call ironic... I just read Roumen's entry about a funny video/song about OS' of yester and today [On Window's XP, in Firefox 1.0.7]. So, I started to watch it. I was having a little chuckle. Then the screen saver kicked in... I bumped the mouse to get the screen back, but Firefox and the video were GONE. I laughed so hard I started to cry... Because, "I guess that's what you call ironic." (2006-01-31 12:26:54.0) Permalink Comments [1] A history lesson of deployment strategies A recent entry by Jean-Francoise Arcand, reminded me of an article that I saw a couple years ago. The article covered information about deploying application to SJSAS 8. Folk who have been paying attention may note that the GlassFish Project is based on code that was originally part of SJSAS 8, so the article has information that is relevant today... For example, folks who want to use a "supported" fast deployment method for their J2EE components and application may want to consider combining "Directory Deployment" with "Dynamic Reloading". I have done some tests with dynamic reloading in the past. The reloading mechanism was smart enough to detect whether I had changed a DD file or a class and http://imdb.com/title/tt0097216/. If you are an ant user, you can even write code that will detect if you have just changed a java file and do next to nothing when you build and "redeploy" a web app that just has JSP changes. [For JSP changes, you don't need to touch the dot-reload file...] I haven't done it for a while, so I may need to look it up or reinvent it. NetBeans Note: Folks that use NetBeans may not know that NetBeans does the right thing for JSP web-apps deployed to the SJSAS 8.1, 8.2, and GlassFish. Web-apps are directory deployed (by default) and JSP files are copied to the "deployment" directory when they are saved in the editor. So, you can edit and reload your JSP pages... no redeploy is required! (2006-01-30 11:27:36.0) Permalink Swing-ing to the NetBean Platform I saw this entry from Matt Ryan about an application that he convereted from pure Swing to NetBeans RCP + Swing. I get the impression that the conversion was none too difficult. (2006-01-29 21:34:50.0) Permalink another test in testa/testb (2006-01-29 21:27:58.0) Permalink another test in testa/testb (2006-01-29 21:27:32.0) Permalink Win a prize with your story behind scott/tiger? It is the universal Oracle account. Known to thousand, maybe even millions... But who is "scott" and why is his password, "tiger". If you know, "Do tell." If you don't, make something entertaining up and share it here (or in your own blog, via a link!) The prize....
A nice tie-dyed bubble-bursting flame out t-shirt. The details:
Equinox Hibernate Spring GlassFish Jerome has an interesting entry about using Spring and Hibernate on GlassFish. I looked at the entry that Matt Raible posted, and decided to see if I could help him.... I assume that Matt was trying to get Equinox to run on GlassFish. So, I tried to deploy and run it, myself. Well, I can see why Matt had so much trouble. The installation instructions were very sketchy, but I was able to get things to work. Here is what I did:
I would have used NetBeans 5.0 RC2 to do this, if I had needed to actually look at real code. (2006-01-28 07:35:53.0) Permalink Custom Certificate Dialogs for JWS App Clients Java Web Start is an awesome technology... but like all awesome technologies, it can have a darkside. I went to a site yesterday that had a JWS enabled demo that had a self-signed certificate. When JWS asked me to trust the site, I had to say 'No'. That reminded me that I had to do something similar for the application client that I created in one of my earlier entries. So I started to ask folks about how to get a real certificate associated with my clients. To implement 'Webstartability' (Note to the AP, don't ask Steven Colbert or Michael Adams to define this soon to be 'Word of 2006'. You'll need to ask Tim Quinn) the GlassFish Project's implementation uses a generic client that is reused by all user implemented clients. The shared, generic client is in the lib directory of the GlassFish installation. It is called 'appserv-jwsacc-signed.jar'. It is the file that triggers the security certificate dialog that appears when you start an webstartable app client. [For an example, see this entry If you take a second look in the lib directory, you will also see the file 'appserv-jwsacc.jar'. This is the unsigned version of the generic client. Why is this file there? This file is there, so that you can sign it with YOUR own certificate. By replacing the 'appserv-jwsacc-signed.jar' with a copy of the appserv-jwsacc.jar file that is signed with your certificate and NAMED 'appserv-jwsacc-signed.jar', your users will see a new dialog, when they are asked to trust the certificate... One with your organization's name in it! (2006-01-23 17:42:39.0) Permalink A New Bridges Problem A co-worker and I were discussing ways to blow off steam a couple days ago. His was to put the top down and drive around. Which seems like a good one. His next comment provided more insight into what he meant, "My car gets better milage at 100 mph than it does at 25 mph..." That lead me to a thought... What is the fastest time that someone has "solved" the bridges of the Bay Area problem? This really isn't a variation on the The Bridges of Konigsberg problem. It is a time-trial. The problem is to cross all eight major toll bridges that span the San Fransisco Bay in the shortest time according to your FasTrak statement. Is there a site that catalogs such a trial? I googled and couldn't find one, so I have got to wonder... Does one exist? (2006-01-23 15:55:06.0) Permalink Sun Java System Application Server... Not, Just for NetBeans any more!!! I love to troll... I mean read... the threads on the eclipse zone. This one caught my eye, though. A hidden feature in the GlassFish plugin for Eclipse is the ability to register instances of Sun Java System Application Server 8.x (where x == 1 or 2). And hey, if you want SJSAS 8.2, you can get it from here (Windows), here (Linux)... and more. (2006-01-13 19:53:24.0) Permalink NetBeans users are still ahead of the pack! This is hard to believe... http://java.sun.com/j2ee/1.4/download.html still hasn't been updated with Sun Java System Application Server 8.2, yet.. If you want the Latest and Greatest App Server from SunYou gotta get it...HERE (2006-01-13 19:35:17.0) PermalinkNetBeans gives you the hottest J2EE bits first! That is right kids... I took these screen shots at Jan 12, 2005 at 7:10 pm PST...
http://java.sun.com/j2ee/1.4/download.html has
http://www.netbeans.info/downloads/download.php has
That's right. NetBeans users are the very first in the world to get Sun Java System Application Server 8.2 bits. Who loves you.... (2006-01-12 19:22:50.0) Permalink Lazy people rejoice! I have been making people work too hard in the notes I have been writing in entries about using NetBeans 5 to create Java EE 5 artifacts. If a Web or Enterprise project is targetted for GlassFish, the javaee.jar file is already a library for that project [Explore the project's library node to see it]. Folks will need to remember that javaee.jar needs to be added to General projects (Java Application and Java Class Library) that need to use Java EE 5 annotations. (2006-01-10 08:38:58.0) Permalink Fastest Web Service Development in the West Well, I read through this extensive article about creating Web Services and am ready to give you an alternative approach. After I show you how I approach doing Web Service development, I will compare the two approaches. Get ReadyYou need to install GlassFish and NetBeans 5. I am using GlassFish build 32 and a nightly build of NetBeans 5 (which will be an RC any day now). Once you install these, register the GlassFish instance with NetBeans.Implement A ServiceI will create a web-app based service, just like the other author did.
So, I create a web-app.
I create a class that will implement my service.
I add the service annotations.
package services;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public class Greeting {
@WebMethod public String sayHello(String name) {
return "May I be of service, "+name+"?";
}
}
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">to <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">I deploy the project. Testing the ServiceThe GlassFish implementation of Java EE 5 includes the ability to test web services from within the Admin Console. Testing is just one of the features of the web service management capabilities in the Admin Console.
You can open the Admin console from within NetBeans, using the context menu of the target instance.
There are two sets of pages associated with web services. The first set provides general information about the services deployed on your instance. The other tab in the set allows you to create a catalog of registries.
The second set of pages/tabs allows you to manipulate individual services. The General tab provides all sorts of detailed information and has the Test button.
A new browser window opens when you press the Test button.
After you enter the arguments for the service, pressing the operation button provides the result and detailed informatiion about the SOAP messages exchanged between the service and the client.
Comparison of the two implementation methodsBoth processes use JAX-WS 2.0 to implement a web service. Both methods deploy that service onto GlassFish. Both methods use NetBeans 5.0 as the development environment.The method outlined in the other article stays within the boundries of what NetBeans 5.0 supports. My method goes outside that supported environment slightly, since changing the web-app element disables the web.xml multiview editor. If you need to do a lot of web.xml editing, change the web-app element LAST, so you can take advantage of the GUI editing capabilities. The other method requires that you change the build.xml file for your web application. This is supported. The method that I outline in this entry pushes most of the "work" to the GlassFish deployment processing. This is also supported. It may be a bit less error-prone, since you won't need to remember to edit the build.xml for each SEI that is in the implementation WAR file. ConclusionAt this point, you have a couple different strategies to implement JAX-WS 2.0 web services in NetBeans for deployment to GlassFish. Both are pretty easy to do.You also have a couple different strategies for testing your web services. You have seen some of the Web Service Management features exposed by the Admin Console. UpdatesLudo pointed out a mistake in this note... If you register a project for deployment to a GlassFish domain, javaee.jar is ALREADY a library! To see it, explore the Libraries node of your web project. I have updated this note to account for that. I love it when things get easier! (2006-01-08 09:51:47.0) Permalink Comments [3] |
Calendar
RSS Feeds
All /5 in 5 /Compile Time /Ease of Evolution /General /GlassFish /Gotchas /Java /Music /NetBeans /Sailfin About Me![]() Short Bio SearchLinks
Navigation
ReferersToday's Page Hits: 54 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||