Problem in XDoclet generation when using java 1.5 Generics

  1. MyEclipse IDE > Off Topic

This topic contains 13 replies, has 5 voices, and was last updated by  Deddiekoel 14 years, 7 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #233716 Reply

    Hi,

    Me and my colleagues have a large collection of Session EJB’s set up for a range of applications we have running on JBoss.

    Recently I have upgraded to Java 1.5 and started to use some of the funky new features like Generics.

    Unfortunately this seems to cause a major problem with generating the XDoclet code as it chucks the following load of exceptions: –

    Buildfile: C:\Documents and Settings\deanw.000\workspace\AccountsAppEJB\.xdoclet-build.tmp.xml
    N65540:
    [ejbdoclet] (XDocletMain.start 47 ) Running <remoteinterface/>
    [ejbdoclet] Error parsing File C:\Documents and Settings\deanw.000\workspace\AccountsAppEJB\src\com\novatech\ejb\AccMain.java:Encountered “<” at line 131, column 26.
    [ejbdoclet] Was expecting one of:
    [ejbdoclet] <IDENTIFIER> …
    [ejbdoclet] “[” …
    [ejbdoclet] “.” …
    [ejbdoclet] “(” …
    [ejbdoclet] Error parsing File C:\Documents and Settings\deanw.000\workspace\AccountsAppEJB\src\com\novatech\interfaces\AccMain.java:Encountered “<EOF>” at line 14, column 11.
    [ejbdoclet] Was expecting:
    [ejbdoclet] <IDENTIFIER> …
    [ejbdoclet] Error parsing File C:\Documents and Settings\deanw.000\workspace\AccountsAppEJB\src\com\novatech\interfaces\AccMainHome.java:Encountered “<EOF>” at line 14, column 11.
    [ejbdoclet] Was expecting:
    [ejbdoclet] <IDENTIFIER> …

    I’m guessing it doesn’t like the fact that when specifying the generics for something like a LinkedList you surround it with <> such as: –

    LinkedList<String> foo = new LinkedList<String>();

    Does anyone know of a way round this as I’m starting to go bald from all the hair pulling I’m doing 😕

    #233733 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev, this is a general XDoclet + Generics issue.

    As far as I know generic support is commign in XDoclet 2… which has yet to make an official release from what I can see.

    #233744 Reply

    Ahh well… hopefully won’t have to wait too long

    #233779 Reply

    Greg
    Member

    The latest release of XDoclet 1.2.X now has support for java5 syntax including generics. SO we will be upgrading our XDoclet libraries that are bundles in MyEclipse for the next release (4.0M3).

    #234987 Reply

    Randy
    Member

    Anybody get this to work? I still get errors

    the code it complains on is:
    List<String> returnedResults = this.rdm.getCurrentModelNumbers();

    and the error is:
    [hibernatedoclet] (XDocletMain.start 47 ) Running <hibernate/>
    [hibernatedoclet] Error parsing File /usr/local/randy/workspace/AssetmgmtPersistence/src/com/guidant/assetmgmt/test/TestResearchDeviceManagement.java:Encountered “<” at line 263, column 9.
    [hibernatedoclet] Was expecting one of:
    [hibernatedoclet] “;” …
    [hibernatedoclet] “=” …
    [hibernatedoclet] “++” …
    [hibernatedoclet] “–” …
    [hibernatedoclet] “+=” …
    [hibernatedoclet] “-=” …
    [hibernatedoclet] “*=” …
    [hibernatedoclet] “/=” …
    [hibernatedoclet] “&=” …
    [hibernatedoclet] “|=” …
    [hibernatedoclet] “^=” …
    [hibernatedoclet] “%=” …
    [hibernatedoclet] “<<=” …
    [hibernatedoclet] “>>=” …
    [hibernatedoclet] “>>>=” …
    [hibernatedoclet] “.” …
    [hibernatedoclet] “[” …
    [hibernatedoclet] “(” …
    [hibernatedoclet] “:” …
    [hibernatedoclet] <IDENTIFIER> …
    _xdoclet_generation_:

    Another thing I noticed (not sure if this is really an issue) is that the xdoclet path is pointing to a previous build in ME_HOME/eclipse/plugins:
    com.genuitec.jboss.ide.eclipse.xdoclet.run_3.9.210:

    and not 310 like most of the stuff.

    TIA!

    #234988 Reply

    Randy
    Member

    Forgot to include this stuff.
    – System Setup ——————————-
    Operating System and version: GentooLinux
    Eclipse version: 3.1
    Eclipse build id: I20050627-1435
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins: Subclipse
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 3 jars, 4 dirs
    MyEclipse version: 4.1 M3
    Eclipse JDK version: 1.5 sun
    Application Server JDK version:
    Are there any exceptions in the Eclipse log file?

    If this is a DB related question please answer the following:

    RDBMS vendor and version:
    JDBC driver vendor and version, and access type (thin, type-2, etc):
    Connection URL:
    Eclipse error logs related to com.genuitec.eclipse.sqlexplorer packages:

    – Message Body ——————————-

    #234989 Reply

    Riyad Kalla
    Member

    Another thing I noticed (not sure if this is really an issue) is that the xdoclet path is pointing to a previous build in ME_HOME/eclipse/plugins:
    com.genuitec.jboss.ide.eclipse.xdoclet.run_3.9.210:

    This is most likely the problem, navigate to your XDoclet settings (Window > Prefs > MyEclipse > xdoclet) and click Restore defaults, then refresh. Then drill down one more level to COde Assist and click restore defaults and click refresh there as well. Then try and re-run XDoclet, see if ti picks up the new 310 paths.

    #234990 Reply

    Randy
    Member

    I tried it and no joy.

    BTW, the paths were actual filesystem paths, and not lib paths. I just navigated to the MyEclipse_Install_Dir/eclipse/plugins and did an ls *xdoc* and noticed the 210 extension.

    Tx!
    HTH

    #234991 Reply

    Riyad Kalla
    Member

    Hmm very frustrating, can you try removing MyEclipse and doing a fresh install of it (not an update) and see if that works? All your settings are stored in your workspace, so you shouldn’t need to reconfigure anything.

    #234992 Reply

    Randy
    Member

    Actually I did this yesterday for a spring related problem. But I am perfectly willing to do it again.

    Just to be sure,

    Eclipse -> Help ->Software Updates ->Manage Configuration
    Select MyEclipse and Disable.

    After restart, shutdown Eclipse.

    rm -rf MYECLIPSE_INSTALL_HOME.

    Now install MYECLIPSE.

    Correct?

    Tx!
    Randy

    #234997 Reply

    Randy
    Member

    Got a fix. turns out the version of xjavadoc is 1.1 that is shipped with xdoclet/ME. From what I’ve seen, version 1.5 is the one that has
    good jdk 1.5 support.

    I downloaded it from here:
    http://prdownloads.sourceforge.net/xdoclet/xjavadoc-1.5-snapshot050611.jar?download

    I renamed the one in ~/MyEclipse/eclipse/plugins/com.genuitec.jboss.ide.eclipse.xdoclet.core_3.9.210 and copied the 1.5 one
    in it’s place, and tada! Generics work!

    Here is some relavant links:
    http://raibledesigns.com/page/rd?anchor=xdoclet_for_jdk_5

    Jira bug report:
    http://opensource.atlassian.com/projects/xdoclet/browse/XJD-41;jsessionid=GKMHGDMAAJII

    #235000 Reply

    Riyad Kalla
    Member

    Randy,
    Thank you very much for this detail, this will make it much easier to get fixed ASAP.

    #235002 Reply

    Randy
    Member

    No prob! Wait until you get my bill!

    ;->

    Gotta admit, i’m really liking where V4 is going. runs great on linux too.

    Tx again!

    R

    #235857 Reply

    Deddiekoel
    Member

    Thanks! Just getting started with MyEclipse and was pretty bummed about the errors due to generics! Replaced the xjavadoc jar and everything is working now!

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: Problem in XDoclet generation when using java 1.5 Generics

You must be logged in to post in the forum log in