facebook

[Closed]XDoclet not generating ejbSelect methods in 4.0.3

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #240496 Reply

    ameghji
    Member

    Hi,

    I’m running Eclipse 3.1.0 and MyEclipse 4.0.3, and XDoclet is not generating ejbSelect methods. Oddly enough, a coworker running MyEclipse 3.9.10 has no such problem.

    The coworker with the working XDoclet setup also has the following error in /workspace/.metadata/.log when XDoclet is run on the project. Since we both have this message, we figure it probably isn’t related to the problem itself, but I’ll post it anyway.

    
    !ENTRY org.eclipse.team.cvs.core 4 0 2005-10-31 11:05:45.793
    !MESSAGE Resource /ArmBeans/.xdoclet-build.tmp.xml is not local.
    !STACK 1
    org.eclipse.core.internal.resources.ResourceException: Resource /ArmBeans/.xdoclet-build.tmp.xml is not local.
            at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:316)
            at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:983)
            at org.eclipse.team.internal.ccvs.core.resources.FileModificationManager.isCleanUpdate(FileModificationManager.java:147)
            at org.eclipse.team.internal.ccvs.core.resources.FileModificationManager.resourceChanged(FileModificationManager.java:122)
            at org.eclipse.team.internal.ccvs.core.resources.FileModificationManager$1.visit(FileModificationManager.java:75)
            at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
            at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
            at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
            at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
            at org.eclipse.team.internal.ccvs.core.resources.FileModificationManager.resourceChanged(FileModificationManager.java:52)
            at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:276)
            at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
            at org.eclipse.core.runtime.Platform.run(Platform.java:783)
            at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:270)
            at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:144)
            at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:180)
            at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:914)
            at org.eclipse.core.internal.resources.File.create(File.java:170)
            at org.eclipse.core.internal.resources.File.create(File.java:183)
            at org.jboss.ide.eclipse.xdoclet.run.util.ProjectUtil.transformBuildFile(ProjectUtil.java:430)
            at org.jboss.ide.eclipse.xdoclet.run.ui.XDocletRunAction$2.run(XDocletRunAction.java:319)
            at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
    !SUBENTRY 1 org.eclipse.core.resources 4 369 2005-10-31 11:05:45.794
    !MESSAGE Resource /ArmBeans/.xdoclet-build.tmp.xml is not local.
    

    Any help would be greatly appreciated — this error is somewhat of a showstopper at this point.

    Here’s my configuration summary:

    
    *** Date: Mon Oct 31 11:08:48 EST 2005
    
    *** System properties:
    OS=Linux
    OS version=2.6.8.1-12mdksmp
    Java version=1.4.2_09
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    
    Version: 4.0.3 GA
    Build id: 20051025-4.0.3-GA
    
    *** Eclipse details:
    Eclipse SDK
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Platform
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Java Development Tools
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Project SDK
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse RCP
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Plug-in Development Environment
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse startup command=-os
    linux
    -ws
    gtk
    -arch
    x86
    -launcher
    /home/ameghji/Applications/eclipse/./eclipse
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    8e800b
    -clean
    -vm
    /usr/bin/java
    
    #240536

    Riyad Kalla
    Member

    I’ve asked one of the developers to look into this.

    #240549

    Greg
    Member

    Have you been able to correctly generate EJB select methods in a previous version of MyEclipse and are now unable to? If you have never correctly generated an EJB select method, then the problem is likely a EJB/XDoclet configuration issue and not a MyEclipse problem.

    So, for us to be able to help further, can you post some more details about your EJB class and your XDoclet tags? Some sample source code would be helpful as well. Thanks.

    #240573

    ameghji
    Member

    greg,

    We’ve been able to generate ejbSelect methods in the past, and currently have 1 member of our team on 3.9.10 who has in the meantime become our official xdocletter. 😆 The other 2 are running on 4.0.3 and get the same results as I posted above.

    Hopefully this will help:

    
        /**
         * @ejb.select query="SELECT DISTINCT o.name from Service o where o.service_id = ?1"
         *                result-type-mapping="Local"
         * @param ID we are using for the lookup
         * @return String of service name
         * @throws FinderException
         */ 
        public abstract java.lang.String ejbSelectNameByID(Integer id) throws FinderException;
        
        /**
         * @ejb.home-method view-type = "local"    
         */
        public java.lang.String ejbHomeGetNameByID(Integer id) throws FinderException {
            return ejbSelectNameByID(id);
        }

    .. with the class-level doclet tags:

    
    /**
     * XDoclet-based CMP 2.x entity bean.  This class must be declared
     * public abstract because the concrete class will
     * be implemented by the CMP providers tooling.
     * 
     * To generate EJB related classes using XDoclet:
     *
     *        - Add Standard EJB module to XDoclet project properties
     *        - Customize XDoclet configuration
     *        - Run XDoclet
     * 
     * Below are the xdoclet-related tags needed for this EJB.
     *
     * @ejb.bean name="Service"
     *           display-name="Service"
     *           description="Service EJB"
     *           jndi-name="ejb/ServiceHome"
     *           local-jndi-name="ejb/ServiceLocalHome"
     *           type="CMP"
     *           cmp-version="2.x"
     *           view-type="both"
     *              primkey-field="service_id"
     *           
     * @ejb.finder description="Returns all service levels"
     *                signature="java.util.Collection findAll()"
     *                query="SELECT OBJECT(e) FROM Service e"
     * 
     * @ejb.finder description="Returns exact matching Service names"
     *                         signature="java.util.Collection findByExactName(java.lang.String criteria)"
     *                         query="SELECT OBJECT(a) FROM Service AS a WHERE (a.name = ?1)"
     * 
     * @ejb.finder description="Returns partial matching Service names"
     *                         signature="java.util.Collection findByName(java.lang.String criteria)"
     *                         query="SELECT OBJECT(a) FROM Service AS a WHERE (a.name = ?1)"
     * 
     * @jboss.query description="Returns partial matching Service names"
     *              signature="java.util.Collection findByName(java.lang.String criteria)"
     *              query="SELECT OBJECT(a) FROM Service AS a WHERE (a.name LIKE CONCAT(?1,'%'))" * 
     * 
     * @ejb.persistence table-name = "service"
     * @jboss.persistence table-name = "service"
     *                       create-table = "true"
     * @ejb:util 
     *         generate="physical"
     * @ejb.value-object match = "*"
    */
    
    #240587

    cdionis
    Member

    I do not know if you are using Weblogic or not, but I submitted a bug against XDoclet that ejbSelect methods could not use the wl query language. The bug is at http://opensource2.atlassian.com/projects/xdoclet/browse/XDT-1512. Hope this helps.

    Chad

    #240962

    ameghji
    Member

    cdionis,

    Thanks for the tip, but unfortunately we’re not using any Application Server-specific QL. You can see the exact @ejb.query doclet code I’m using above.

    support staff,

    Any more ideas on this issue? We’re still having this issue and needing to burden our “official xdoclet generator” guy whenever we need to do an update. 🙂

    #241027

    Greg
    Member

    Is it just the ejbSelectNameByID that isn’t being generated? By not generated do you mean there isn’t an entry for that query in the ejb-jar.xml? What about the home method and the ejb.finder methods, are they generated in your example?

    The reason I’m asking so many questions is that I just created a test CMP entity bean and added a ejb.select method just like the one you described in your post and I was able to see the <query> entry in the ejb-jar.xml file just fine.

    If you are still unable to see the selects generated, could you create just a simple EJB project with one source EJB file and one ejbSelect method that doesn’t get generated and post to the source to that file to the forums? That way I can try to replicate your exact problem. Thanks.

    #241219

    KC Somaratne
    Member

    Hi,

    I am using the version EnterpriseWorkbenchInstaller_4.0.2GA_E3.1 on WindowsXPsp2 with jdk1.5.0_04 and my home methods seem to be generated ok. Haven’t yet tested out on the app server yet. Will make a post once I’ve tested it out.

    In the meantime, hope ameghji posts the broken module he has. I’ll be glad to test out on the version of the MyEclipseIDE I am using (4.0.2GA_E3.1).

    rgds,
    -kcs

    #241258

    KC Somaratne
    Member

    Hi,

    I’ve tested this with EnterpriseWorkbenchInstaller_4.0.3GA_E3.1 on WinXPsp2 with jdk1.5.0_04. I do not seem to have any issue with generating the ejbSelect ejb-jar.xml or the home methods.

    Hope this helps.

    rgds,
    -kcs

    #243066

    ameghji
    Member

    Hey guys .. I’ve fixed this issue. Turns out the nature of the problem was kind of funny.

    The older version of myEclipse used by our “official xdocletter” here actually had a BUG! we were generating Local ejbSelect methods, and running them via Remote. The older MyEclipse wasn’t respecting that tag and was generating both, whereas the new version was more strict and worked properly. I didn’t realize this at first, but changed them from Local to Remote and it worked for the majority, since they were being called Remotely anyway.

    Hopefully this helps anyone else, thanks for your feedback as well.

    #243085

    Greg
    Member

    Good deal. We’re glad you got it working and thanks for following up.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: [Closed]XDoclet not generating ejbSelect methods in 4.0.3

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