Wednesday January 16, 2008
Insert Witty Irony Herevince kraemer's Weblog
All
|
5 in 5
|
Compile Time
|
Ease of Evolution
|
General
|
GlassFish
|
Gotchas
|
Java
|
Music
|
NetBeans
Is Javascript the C of the Web Last night, while the wheelers and dealers of MySQL, Sun, Oracle and BEA were signing on dotted lines the tech crowd was at Google's building 43 for the Silicon Valley Web and Java Users group meeting to hear a presentation about GWT.
Bob Vawter's presentation was excellent. He covered the basics quickly and took questions. His presentation provided answer to some of the things that make folks go, "Hmmm", when they look at the output of the GWT compiler.... Like, "What are all those obtuse numerically named files all about?" There was a raffle for a number of books. I won a book. Why does this entry have its title? While Bob was talking about GWT, it reminded me of working at Interactive Software Engineering, now known as Eiffel Software. The Eiffel compiler used a similar "trick" of transforming a strongly typed language (Eiffel) into a weakly typed language (C). From the outside, it looks like GWT is doing something similar with Javascript playing the part of C. Another parallel between GWT and the Eiffel compiler was the amount of optimization it could do. After expressing his sample in a rich language, Java, the compiler optimized almost ALL that richness out of the resulting Javascript code... making it much leaner. (2008-01-16 21:18:17.0) Permalink Java API design antipattern and tip The Antipattern: Don't Create an Event Object for Your Listener Interface's Methods I discovered this while trying to implement against a Listener interface that just sent in the "interesting" parts of the event... A String or two. I needed to find out the source of the event (which is a pretty standard member of an Event interface), so that I could react to the event. This is easy to resolve by creating the listener with an additional member for the "expected" source. Or it is easy to resolve until you try to garbage collect these listeners that know their source... An Event/Listener pair helps your API mature gracefully. Additional members/accessors can get added to the Event side of the interface without requiring changes in code that implements the Listener, unless the listener wants to USE that new member/accessor.
In the interest of transparency and honesty; I have to admit that I helped review and approve the Listener interface that lead to this entry. It just goes to show the value of having to write REAL code against an interface before you say, "Oh. That looks fine."
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 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 Start writing apps for Tivo in NetBeans; updates for HME 1.4 I gave my wife a Tivo box Christmas. And I got a new toy to play with.... One of the first things I did was look for how to hac... create applications for... it. And there was a ton of resources about it. Some of the folks associated with NetBeans have an article about developing Tivo application using NetBeans. Unfortunately, it seems like the Tivo HME team is a bit more liberal about API evolution than the NetBeans team. I had to use the following code to create the app that Tim Boudreau blogged back in February, 2005.
package tivotest;
import com.tivo.hme.sdk.Application;
import com.tivo.hme.interfaces.IContext;
import com.tivo.hme.sim.Simulator;
import java.awt.Color;
public class Main extends Application {
public static void main(String[] args) {
try {
Simulator.main(new String[] {Main.class.getName()});
} catch (Exception ex) {
System.out.println("I don't know what to do!!!");
}
}
public void init(IContext context) {
getRoot().setResource(createText("default-36-bold.font",
Color.white, "Hello from an application!"));
}
}
The bigggest changes between Tim's code and this:
Java Web Start fast and easy... I wrote my entry about creating a Java Web Start-able application client, without really knowing much about Java Web Start. So, I read through the white paper that Eduardo cited on The Aquarium to learn more about it. After I read through the paper, I realized how much work NetBeans 5 and the GlassFish Project's is doing for the developer...
Then I got to thinking, does an application client need to access resources from the server? The answer is no. It might, but doesn't have to. That means that a developer could create a "plain old java application", wrap it up in an Enterprise Application and let the GlassFish Project's deployment mechanism do the tedious housekeepinng. Their app would be JWS enabled with hardly any effort. Sweet! (2005-12-27 12:07:23.0) Permalink Comments [2] See the Java Console on Mac OS X While trying out GlassFish Project's Java EE 5 implementation on Mac OS X 10.4, I ran into hiccup with application clients. I soon discovered that other folks had hit the same issue, and some hints at a solution. Note: the response from the developer, tjquinn, is one of the most complete responses I have ever read in a bug report. All I needed to do was translate his response into Apple.
After some poking around, I found the 'Java Preferences' utility in /Applications/Utilities/Java/J2SE 5.0. This utility let you set the proper flags to open the Java Console.
![]() The Java Preferences interface: Java Console radio button visible Once I set it up, I was able to see the output of batch oriented application clients that get launched by Java Web Start. (2005-12-22 11:31:52.0) Permalink
App Server 8.1 and Ubuntu 5.10 David Coldrick had an interesting entry about Ubuntu, so I thought I would give the "Breezy Badger" release a try.
Running GlassFish in Mac OS X Disclaimer first. This information is about software that is currently under ACTIVE DEVELOPMENT. By the time you read it, it may not be accurate. When you download a GlassFish jar-ball and try to install it on Mac OS X, you may see output that looks like this when you follow the installation instructions (ant -f setup.xml):
Basically, setup.xml exec's asasdmin to create an initial domain. One of the steps in creating the initial domain requires that asadmin start Derby, to create an ejbtimer database (as best I can tell). Derby needs a special system property defined to execute under Mac OS X. Setup.xml and asadmin don't set the value of the property correctly. The property is derby.storage.fileSyncTransactionLog. It must have the value true. The easiest thing to do, is edit bin/asadmin and add -Dderby.storage.fileSyncTransactionLog=true to the command that is executed. Restarting the installation process `ant -f setup.xml` seems to execute sucessfully after that. Tags: GlassFish (2005-07-02 19:58:25.0) Permalink Comments [1] |
Calendar
RSS Feeds
All /5 in 5 /Compile Time /Ease of Evolution /General /GlassFish /Gotchas /Java /Music /NetBeans About Me![]() Short Bio SearchLinks
Navigation
ReferersToday's Page Hits: 410 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||