PEAT Online Course -
How To Improve Your Personal Performance in Java work Technology

  • YOU + CONTROL
  • Focus
  • Autonomy
  • Proficiency
  • Purpose
  • Covid-19!!!
  • Deep Hidden Meaning
  • FREE updates
EARLY ACCESS (VIP)
Exclusively on
VIMEO ON-DEMAND

Eclipse Compiler versus the Sun JDK Java Compiler: WDDTG

29 April 2010 Comments off

1 minute

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?


Hey all! Thanks for visiting. I provide fringe benefits to interested readers: checkout consultancy, training or mentorship Please make enquiries by email or
call +44 (0)7397 067 658.

Due to the Off-Payroll Working plan for the UK government, I am enforcing stricter measures on contracts. All potential public sector GOV.UK contracts engagements must be approved by QDOS and/or SJD Accounting. Please enquire for further information.