Eclipse Compiler versus the Sun JDK Java Compiler: WDDTG
29 April 2010 Comments off
Reading time:
1 minute
Word count:
184
Eclipse Compiler versus the Sun JDK Java Compiler
What is the different between the following code fragments for a Java EE 5 style Message Driven Bean?
Extract 1
// Code1 @MessageDriven ( activationConfig = { @ActivationConfigProperty(propertyName="connectionFactoryJndiName", propertyValue="xygot.mq.web.Q1CF"), @ActivationConfigProperty(propertyName="destination", propertyValue="xygot.mq.web.Q1"), @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), } ) public class XygotMessageService1 extends AbstractXygotMessageService { }
Extract 2
// Code2 @MessageDriven ( activationConfig = { @ActivationConfigProperty(propertyName="connectionFactoryJndiName", propertyValue="xygot.mq.web.Q1CF"), @ActivationConfigProperty(propertyName="destination", propertyValue="xygot.mq.web.Q1"), @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue") } ) public class XygotMessageService1 extends AbstractXygotMessageService { }
The difference is the first extract compiles with the Eclipse Compiler inside Galileo no problem.
The second extract compiles with an error XygotMessageService1.java:[19,8] illegal start of expression
.
There is an extra comma in the activationConfig initialiser list in the MessageDriven annotation.
This simple error causes several hours of search, frustration and a waste of time, because
it was buried in a large Maven project. Obviously, the MDB were part of
EJB package Maven module inside a multi-module Maven project.
I cannot get those hours back, not ever.
Where
Does
Developer
Time
Go?