It's been a while since I worked with GWT. I did it for a pet project, when I was into all the databases stuff. It was about database normalization. You know, to avoid redundancies, which of course you denormalize when you copy your entities to Lucene or a NoSQL database. But this post isn't about that.
I wanted to start a simple GWT project. Copying the one in the tutorial. So I launched my new IDEA Ultimate environment (those $100 have to pay off), which has built-in GWT support. This has to take only a few minutes I thought. Right...
First, I wanted to run the project in production mode, deploying it to a Tomcat 6. It said the deploy was successful, yet nothing was there. I checked Catalina Home, Catalina Base, all those variables. After hours I decided to remove the Tomcat folder and create a new one, so I downloaded it again from the Apache site, unzipped it, and set it up in IDEA. Then I checked with great detail all files in conf, that everything was there, and suddenly, it worked. What happened? Only deity knows...
So, now let's make it run in dev mode. I read about a new mode in GWT 2.5: "Super Dev Mode" and IDEA suports it. Let's try it.
Well, supposedly it runs a compiler server and you add bookmarks links so when you work on your GWT page, you can rebuild your javascript code "on the fly". But where was my GWT page? It certainly didn't work with my app that was running on Tomcat (in production mode). I guess Super Dev Mode needs more polishing.
Let's try the old and tested "Classic" Dev Mode. It started successfully. Now I need to install the GWT plugin for Chrome. Easy you say? Nahh.. It seems that this plugin is not supported (at least yet) if you run Chrome on Windows 8 (or Server 2012, in my case). Why? Well, people are complaining in the forums. After being defeated once more, I downloaded and installed Firefox. Aha! It seems that there is no official GWT extension for Firefox. Luckily there was an unofficial one and it seemed to work.
So this was the status of a little GWT demo which was supposed to be running in minutes but took me hours. Now at least I can start adding more widgets and panels. I hope I can run the GWT plugin for Chrome again without resorting to virtual machines.
As usual, thanks to StackOverflow for helping me finding some answers, or at least people that had the same questions.
Monday, December 3, 2012
Launching a GWT Demo with IntelliJ IDEA
Thursday, September 6, 2012
Oracle Database XE listening port
I installed an instance of Oracle Database XE (version 11g) at my home machine. The idea was to connect an (also Oracle) Glassfish server to it. So, I start the server, and bam! Port 8080 is busy. By whom? I wonder, if the last time I was using this computer, I started a Tomcat server successfully.
Well, what do you know, there was a service installed by the Oracle Database that decided to occupy that port. Its name was something like Oracle listener. So I shut it down. Now Glassfish works fine.
I configure the datasource using Glassfish Admin Tool. I set everything, but it complains that it cannot connect to the database. I wonder again, because I had a Oracle SQL Developer open and connected to the database, and everything was working fine there.
After revising the parameters for the millonth time (having OracleDataSource Javadoc at hand on a separate browser tab), I decide to close the SQL Developer connection and reopen it. Aha! It cannot establish a connection. Then the light bulb turns on, and I decide to restart that service, but with Glassfish running so it cannot claim the 8080 port. It starts fine. At first I still cannot connect, this time complaining that the SID is wrong, but after a minute, the database accepts the SID, I can connect the SQL Developer again to the database, I can also connect my JDBC Datasource (in Glassfish) to the Database... and we all rejoice.
Monday, August 15, 2011
Migrating from JBoss 4.3 to Jboss 5.1
In several of my previous jobs, which involved an enterprise application that ran on an application server, it usually was the one made by JBoss. The downside is that I know next to nothing about Websphere, Glassfish, and other competing servers, but the upside is that I'm pretty familiar with JBoss.
JBoss version 4, that is. And now, in 2011, I found out that the new project I'm working on, also uses JBoss 4. Yes, I know, it's Jboss 4.3 EAP, enterprise supported by Red Hat, which not long ago I found out is not the same as version 4.2, as the messaging system is different. But still, it just feels so old! JBoss AS is version 7 already, which I have to say, boots REALLY fast, and I've got the feeling that I'll be using JBoss 7 at work maybe in the year 2015.
Now, you'll say: but neither JBoss 6 nor 7 are not full JEE certified! They even haven't got EAP versions! (I think Jboss 7.1 will be EAP). So this time I focused on trying to run the current system on JBoss 5.1
This is not the first time I do this. That was last year, on another project, but couldn't succeed and ran out of time. Luckily this time I did have success. What happened last time was that the queues were in JBossMQ, and I didn't know how to migrate them to JBoss Messaging. This time, as the system runs in JBoss 4.3, it's already configured for JBoss Messaging, so that part was easy.
Also, the WARs used the Spring Framework, so there are no EJBs or EARs to convert. That also made the migrating process easier, although it made less sense to migrate, as it was only for the microkernel of JBoss 5, the JMS and the new version of JTA. No new EJB container nor Hibernate that mattered this time.
But still there were a few quirks:
- Classpath: One of the projects included a JAR library with JAXB implementation, and since that's included in Java 6, there was an exception because you had the same classes in different classloaders on the same hierarchy and JBoss 5.1 was picky about that.
- Libraries in SAR package: They needed to be in root of the SAR instead of in the lib folder. There is a workaround (or maybe it's the official way) by using jboss-structure.xml to specify where the libraries are, but haven't used that.
Labels: compatibilities, jboss, migration
Monday, August 8, 2011
Googlon
Today I solved the Googlon Quiz in order to enter the Google Developer Day here in Buenos Aires. Since I didn't have much time I used plain old Java. I think this particular exercise would have been much easier in Scala, had I known the language.
Sunday, August 7, 2011
Different languages for the JVM
A few weeks ago I started learning Groovy and Grails. Even though I'm quite proficient with Java and the Spring Framework for building web pages, I wanted to know if Grails would lead me to an even faster way.
I downloaded a few examples and I have to say that I like the convention over configuration scheme of Grails, but was not so comfortable with Groovy's approach. I also tried Griffon as the supposed project had a client-server architecture and because of the requirements I wasn't sure if a web-based client was enough so I wanted to try a desktop alternative.
Griffon follows Grails conventions but seems less mature. Also, I found IntelliJ to be the best IDE (tried also STS and Netbeans) for Groovy apps.
In the meantime, the main subject for the Java User Group meeting that was coming was Scala. I'm lucky to have the, according to reviews, great book Programming in Scala, and will be starting reading it soon. I heard that having Scala it makes little sense to learn Groovy, so maybe a better use of my time will be to learn Scala and the Play Framework.
As a matter of fact, I was supposed to play with Scala today, but my procrastination lend me to install JRuby and Jython, and ended playing with the last one, after I learned that the popular Django framework was made in Python.
So I made a test web site following a Django-Jython tutorial, but it seems that there is little connection with the rest of the Java world. My goal was to convert the site to a web archive (.war), deploy it in JBoss, and connect Django with the JMS and the transaction manager. I don't know, maybe it's supposed to be used standalone.
I think I'll go back to Scala now.
Tuesday, August 26, 2008
And what about Project Management?
Related to my previous post in which I expressed my desire to learn more "theory" about Java, I know that not only the path of the good developer is in front of me, but also the path of a good manager as well. Two sides of the same coin? The need to learn about resources and human skills ?
I know I have to do it, I think it's important for my career to learn it and if possible to be one. Some jobs have a mixed role between tech leaders, project leaders, project managers and such. Others don't.
In contrast to Java, this will be almost theory with no practice (Hello? Does anyone want to hire me as a manager? I know I can do it). Well, I do have certain background when I was leader at some projects for college, but that's the tip of the iceberg.
Some of the texts I'm going to read are:
- Project Management Body of Knowledge
- Behind Closed Doors - Secrets of Great Management
- Some book about Agile. Not sure which one yet.
Now for a poll! What's cooler: project management or artificial intelligence?
Labels: project management
Java The Master
So, lately my main programming skills have been focused on the Java language. I programmed Java in my previous jobs and in my current one, and I think I'm able to become a "Java Senior". Nevertheless, I'm still being seen as a SemiSenior by companies, therefore I have a new quest: to master Java. This all started when I entered at Java Black Belt and I realised that there is so much I have to learn about.
How? not sure yet. As I usually worked in core technologies (usually for a backend server) now I'm going to learn what I should know:
- A better understanding of the Spring Framework. The beans, the IOC, its MVC, if possible something with its aspects (comparison with AspectJ?)
- A better understanding of Hibernate, ORM and JPA. Some people say you shouldn't write SQL anymore. Others say Hibernate won't fit complex requirements (or performance). Let's see and try.
- The Struts Framework (second version). How does Struts makes my life easier? Let's build some nice server! Comparison with Spring MVC?
- EJB 3: Is EJB obsolete? I don't know but it won't hurt to know something about it.
- Servlets. Tomcat won't be a mistery anymore. Let's learn about web.xml! And the most interesting part: let's see how the servlets connects to http from one side and to an mvc or application server from the other side.
- Ant! I used Ant several times, but now I have a 700-pages book about it, so something tells me there's a lot about Ant that I don't know (by the way, I need a Maven book!)
- JTA: Do you know I love transactions? If I have to choose to work in an open source project, that would be the commons-transaction from Jakarta. Someone said XA?
- JMM: A few days ago I read the JSR about Java Memory Model. Nice! Some crazy stuff may result if you don't properly synchronize your fields that are read by several threads. But really! Everyone in Java should read it! Search for JSR 133 and you'll find it.
- SCJP: Aha! The top of the cream! I'm not sure if I'll take it but I should learn enough to be confident that I would pass it.
Labels: frameworks, java, study, work
