Generation of ejbClient project for an existing ejb project even though generateClient is set false

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Generation of ejbClient project for an existing ejb project even though generateClient is set false

Heiko Kopp

Hello everybody,

I'm using m2eclipse and its WTP integration. Currently I'm developing a MDB via an EJB project. I've configured the maven-ejb-plugin as follows:

  <build>
          <plugins>
                  <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-ejb-plugin</artifactId>
                          <version>2.2.1</version>
            <configuration>             
                <ejbVersion>3.0</ejbVersion> 
                <generateClient>false</generateClient>             
            </configuration>
                  </plugin>
          </plugins>
  </build>

The ear plugin-configuration is as follows:

       <modules>
                        <webModule>
                            <groupId>xxx.pas</groupId>
                            <artifactId>pas-jms-web</artifactId>
                            <contextRoot>PasJms</contextRoot>
                            <!--
                                We need to use this name, as otherwise the IBM deployment
                                information files (deployment.xml) refers to the wrong web
                                archive
                            -->
                            <bundleFileName>pas-jms-web.war</bundleFileName>
                        </webModule>
                        <ejbModule>
                            <groupId>xxx.pas</groupId>
                            <artifactId>pas-jms-ejb</artifactId>                           
                        </ejbModule>                                                     
                    </modules>   

Whenever I choose Maven -> Update Project Configuration, a ejbClient project is generated in Eclipse outside of the projects parent class. The project is somehow configured but not completely, it is not added to the ejb or ear or anything. Each subsequent choice to Update the project configuration leads to a new project, thus having ejbClient, ejbClient1, ejbClient2 and so on. I can delete these projects, but I would assume this is a bug, isn't it?

I'm using the following Eclipse configuration:

RAD 7.5.5.1 (Eclipse 3.4)
m2Eclipse 0.10.2 (SNAPSHOT)
external apache-maven-3.0-beta-1

Another problem I'm having with is quite anyoning but does not bother me so much, is that whatever settings I have for the maven compiler plugin, target and source set to 1.5, a choice of Update Project Configuration always adds a JDK 1.4 to the build path, even though I do not even have one installed ... Guess this is a bug too.

If anyone could direct me to a solution regarding the first problem with the not wanted ejbClient project, it would be great.

Thank you very much,

Heiko

--
Dr.-Ing. Heiko Kopp / Fa. GFI - iT media Consult GmbH
c/o Mercedes-Benz Bank

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: Generation of ejbClient project for an existing ejb project even though generateClient is set false

Fred Bricon
Heiko,

ejbClient is not supported AT ALL by m2eclipse, there's nothing -that I know of- in the code  doing anything like creating a new ejbClient project. Nowhere. Cool stuff you've got, it's magic!

Now :
 - what do you mean by "generated in Eclipse outside of the projects parent class", is it located under the ejb project or the parent of the ejb project?
- What happens if you delete the <generateClient>false</generateClient> line?
- What happens in maven CLI?
- What happens if you use stock eclipse? (RAD is a commercial product, thus not supported in m2e)
- Can you reproduce the bug with a sample project? I you do so, please open a new JIRA issue at https://issues.sonatype.org/browse/MNGECLIPSE

Concerning your 2nd problem (Java compiler), an error might have occured during the configuration update, which interrupted the complete JDT configuration. What do you see in eclipse log? (<workspace>/.metadata/.log)

regards,

Fred Bricon

On Tue, Jun 1, 2010 at 1:08 PM, <[hidden email]> wrote:

Hello everybody,

I'm using m2eclipse and its WTP integration. Currently I'm developing a MDB via an EJB project. I've configured the maven-ejb-plugin as follows:

  <build>
          <plugins>
                  <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-ejb-plugin</artifactId>
                          <version>2.2.1</version>
            <configuration>             
                <ejbVersion>3.0</ejbVersion> 
                <generateClient>false</generateClient>             
            </configuration>
                  </plugin>
          </plugins>
  </build>

The ear plugin-configuration is as follows:

       <modules>
                        <webModule>
                            <groupId>xxx.pas</groupId>
                            <artifactId>pas-jms-web</artifactId>
                            <contextRoot>PasJms</contextRoot>
                            <!--
                                We need to use this name, as otherwise the IBM deployment
                                information files (deployment.xml) refers to the wrong web
                                archive
                            -->
                            <bundleFileName>pas-jms-web.war</bundleFileName>
                        </webModule>
                        <ejbModule>
                            <groupId>xxx.pas</groupId>
                            <artifactId>pas-jms-ejb</artifactId>                           
                        </ejbModule>                                                     
                    </modules>   

Whenever I choose Maven -> Update Project Configuration, a ejbClient project is generated in Eclipse outside of the projects parent class. The project is somehow configured but not completely, it is not added to the ejb or ear or anything. Each subsequent choice to Update the project configuration leads to a new project, thus having ejbClient, ejbClient1, ejbClient2 and so on. I can delete these projects, but I would assume this is a bug, isn't it?

I'm using the following Eclipse configuration:

RAD 7.5.5.1 (Eclipse 3.4)
m2Eclipse 0.10.2 (SNAPSHOT)
external apache-maven-3.0-beta-1

Another problem I'm having with is quite anyoning but does not bother me so much, is that whatever settings I have for the maven compiler plugin, target and source set to 1.5, a choice of Update Project Configuration always adds a JDK 1.4 to the build path, even though I do not even have one installed ... Guess this is a bug too.

If anyone could direct me to a solution regarding the first problem with the not wanted ejbClient project, it would be great.

Thank you very much,

Heiko

--
Dr.-Ing. Heiko Kopp / Fa. GFI - iT media Consult GmbH
c/o Mercedes-Benz Bank

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: Generation of ejbClient project for an existing ejb project even though generateClient is set false

Heiko Kopp

Hello Fred,

I'm totally aware that ejbClient is not supported, the interesting part is however, that this only happens when I request an Maven Project Update. Closing the project, building it, working with the IDE in any other way does not produce this behaviour. However, let me answer your questions:

My maven project structure is as follows:

root
   - ear
   - ejb
   - web

This is even the file system structure (the ear, ejb and web projects are embedded in the root project)

After checking 'Update Project Configuration' on the ejb project, a project ejbClient is created OUTSIDE of root, thus it looks like this:

root
   - ear
   - ejb
   - web
ejbClient

As this behaviour only happens when reconfiguring the project in m2eclipse, the client is obviously not generated in maven CLI. The project itself does not harm development, it is simply created and somehow referenced by the ejb project, but thats it. If I delete it, I have to manually remove the reference in the ejb-project's configuration. It might even be a bug in the RAD implementation of the EJB handling.

I will try a check in a stock eclipse project too, although that is not so easy, cause I have to setup one first and try it out. I will respond whether this happens in stock eclipse tomorrow.

I got some new insight by debugging the current git HEAD of the plugin for the second problem I had. It seems that the configuration for the compiler plugin in the EAR project like:

                <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
                <source>1.5</source>
                <target>1.5</target>
        </configuration>
</plugin>

is not sufficient for the AbstractJavaProjectConfiguratior in the org.maven.ide.jdt project. The code there is as follows:

for(MavenProject mavenProject : mavenProjects) {
      for(Plugin plugin : mavenProject.getBuildPlugins()) {
        if(isJavaCompilerExecution(plugin)) {
          for(PluginExecution execution : plugin.getExecutions()) {
            for(String goal : execution.getGoals()) {
              source = getCompilerLevel(mavenSession, plugin, execution, goal, "source", source, SOURCES);
              target = getCompilerLevel(mavenSession, plugin, execution, goal, "target", target, TARGETS);
            }
          }
        }
      }
    }

It checks whether it finds the compiler execution plugin, but then it looks for executions and goals, even though it surely does not have to (I think). If I modify the plugin configuration to something like

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.1</version>
    <configuration>
        <source>1.5</source>
        <target>1.5</target>
    </configuration>
    <executions>
        <execution>
            <id>default-compile</id>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

it works perfeclty. It is now my question, do you think this is worth a JIRA issue? I would even fix and provide a patch if thats ok.

Best regards,

Heiko

--
Dr.-Ing. Heiko Kopp / Fa. GFI - iT media Consult GmbH
c/o Mercedes-Benz Bank

[hidden email] schrieb am 01.06.2010 15:02:54:

> Heiko,
>
> ejbClient is not supported AT ALL by m2eclipse, there's nothing -
> that I know of- in the code  doing anything like creating a new
> ejbClient project. Nowhere. Cool stuff you've got, it's magic!
>
> Now :
>  - what do you mean by "generated in Eclipse outside of the projects
> parent class", is it located under the ejb project or the parent of
> the ejb project?
> - What happens if you delete the <generateClient>false</generateClient> line?
> - What happens in maven CLI?
> - What happens if you use stock eclipse? (RAD is a commercial
> product, thus not supported in m2e)
> - Can you reproduce the bug with a sample project? I you do so,
> please open a new JIRA issue at https://issues.sonatype.org/browse/MNGECLIPSE
>
> Concerning your 2nd problem (Java compiler), an error might have
> occured during the configuration update, which interrupted the
> complete JDT configuration. What do you see in eclipse log?
> (<workspace>/.metadata/.log)
>
> regards,
>
> Fred Bricon

> On Tue, Jun 1, 2010 at 1:08 PM, <[hidden email]> wrote:
>

> Hello everybody,
>
> I'm using m2eclipse and its WTP integration. Currently I'm
> developing a MDB via an EJB project. I've configured the maven-ejb-
> plugin as follows:
>
>   <build>
>           <plugins>
>                   <plugin>
>                           <groupId>org.apache.maven.plugins</groupId>
>                           <artifactId>maven-ejb-plugin</artifactId>
>                           <version>2.2.1</version>
>             <configuration>             
>                 <ejbVersion>3.0</ejbVersion> 
>                 <generateClient>false</generateClient>             
>             </configuration>
>                   </plugin>
>           </plugins>
>   </build>
>
> The ear plugin-configuration is as follows:
>
>        <modules>
>                         <webModule>
>                             <groupId>xxx.pas</groupId>
>                             <artifactId>pas-jms-web</artifactId>
>                             <contextRoot>PasJms</contextRoot>
>                             <!--
>                                 We need to use this name, as
> otherwise the IBM deployment
>                                 information files (deployment.xml)
> refers to the wrong web
>                                 archive
>                             -->
>                             <bundleFileName>pas-jms-web.war</bundleFileName>
>                         </webModule>
>                         <ejbModule>
>                             <groupId>xxx.pas</groupId>
>                             <artifactId>pas-jms-ejb</artifactId>   
>                        
>                         </ejbModule>                               
>                      
>                     </modules>   
>
> Whenever I choose Maven -> Update Project Configuration, a ejbClient
> project is generated in Eclipse outside of the projects parent
> class. The project is somehow configured but not completely, it is
> not added to the ejb or ear or anything. Each subsequent choice to
> Update the project configuration leads to a new project, thus having
> ejbClient, ejbClient1, ejbClient2 and so on. I can delete these
> projects, but I would assume this is a bug, isn't it?
>
> I'm using the following Eclipse configuration:
>
> RAD 7.5.5.1 (Eclipse 3.4)
> m2Eclipse 0.10.2 (SNAPSHOT)
> external apache-maven-3.0-beta-1
>
> Another problem I'm having with is quite anyoning but does not
> bother me so much, is that whatever settings I have for the maven
> compiler plugin, target and source set to 1.5, a choice of Update
> Project Configuration always adds a JDK 1.4 to the build path, even
> though I do not even have one installed ... Guess this is a bug too.
>
> If anyone could direct me to a solution regarding the first problem
> with the not wanted ejbClient project, it would be great.
>
> Thank you very much,
>
> Heiko
>
> --
> Dr.-Ing. Heiko Kopp / Fa. GFI - iT media Consult GmbH
> c/o Mercedes-Benz Bank
> If you are not the intended addressee, please inform us immediately
> that you have received this e-mail in error, and delete it. We thank
> you for your cooperation.
If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: Generation of ejbClient project for an existing ejb project even though generateClient is set false

Tim Schwenk
FYI, I've noticed the same thing with RAD 7.5.5.  It also happens during project import.  I think it must be RAD being 'helpful', but from what I can tell, simply deleting the ejbClient project does no harm, so that's what I typically do.  The funny thing is that I use working sets to group my projects, so I didn't even notice the ejbClient projects getting created until I happened to see several of them in the file system.

Also, I've noticed that when importing a multi-module EAR/EJB/WAR project, I also get an extra EAR project created magically, and my WAR project gets a WebContent folder added to it even though it isn't used.  This all smells very much like RAD, so I'm not sure there's going to be much that can be done to resolve the issue.  The good news is that simply deleting the extra junk works just fine - for me at least.  YMMV.

On Thu, Jun 3, 2010 at 7:29 AM, <[hidden email]> wrote:

Hello Fred,

I'm totally aware that ejbClient is not supported, the interesting part is however, that this only happens when I request an Maven Project Update. Closing the project, building it, working with the IDE in any other way does not produce this behaviour. However, let me answer your questions:

My maven project structure is as follows:

root
   - ear
   - ejb
   - web

This is even the file system structure (the ear, ejb and web projects are embedded in the root project)

After checking 'Update Project Configuration' on the ejb project, a project ejbClient is created OUTSIDE of root, thus it looks like this:

root
   - ear
   - ejb
   - web
ejbClient

As this behaviour only happens when reconfiguring the project in m2eclipse, the client is obviously not generated in maven CLI. The project itself does not harm development, it is simply created and somehow referenced by the ejb project, but thats it. If I delete it, I have to manually remove the reference in the ejb-project's configuration. It might even be a bug in the RAD implementation of the EJB handling.

I will try a check in a stock eclipse project too, although that is not so easy, cause I have to setup one first and try it out. I will respond whether this happens in stock eclipse tomorrow.

I got some new insight by debugging the current git HEAD of the plugin for the second problem I had. It seems that the configuration for the compiler plugin in the EAR project like:


                <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
                <source>1.5</source>
                <target>1.5</target>
        </configuration>
</plugin>

is not sufficient for the AbstractJavaProjectConfiguratior in the org.maven.ide.jdt project. The code there is as follows:

for(MavenProject mavenProject : mavenProjects) {
      for(Plugin plugin : mavenProject.getBuildPlugins()) {
        if(isJavaCompilerExecution(plugin)) {
          for(PluginExecution execution : plugin.getExecutions()) {
            for(String goal : execution.getGoals()) {
              source = getCompilerLevel(mavenSession, plugin, execution, goal, "source", source, SOURCES);
              target = getCompilerLevel(mavenSession, plugin, execution, goal, "target", target, TARGETS);
            }
          }
        }
      }
    }

It checks whether it finds the compiler execution plugin, but then it looks for executions and goals, even though it surely does not have to (I think). If I modify the plugin configuration to something like

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.1</version>
    <configuration>
        <source>1.5</source>
        <target>1.5</target>
    </configuration>
    <executions>
        <execution>
            <id>default-compile</id>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

it works perfeclty. It is now my question, do you think this is worth a JIRA issue? I would even fix and provide a patch if thats ok.

Best regards,


Heiko

--
Dr.-Ing. Heiko Kopp / Fa. GFI - iT media Consult GmbH
c/o Mercedes-Benz Bank

[hidden email] schrieb am 01.06.2010 15:02:54:


> Heiko,
>

> ejbClient is not supported AT ALL by m2eclipse, there's nothing -
> that I know of- in the code  doing anything like creating a new
> ejbClient project. Nowhere. Cool stuff you've got, it's magic!
>
> Now :
>  - what do you mean by "generated in Eclipse outside of the projects
> parent class", is it located under the ejb project or the parent of
> the ejb project?
> - What happens if you delete the <generateClient>false</generateClient> line?
> - What happens in maven CLI?
> - What happens if you use stock eclipse? (RAD is a commercial
> product, thus not supported in m2e)
> - Can you reproduce the bug with a sample project? I you do so,
> please open a new JIRA issue at https://issues.sonatype.org/browse/MNGECLIPSE
>
> Concerning your 2nd problem (Java compiler), an error might have
> occured during the configuration update, which interrupted the
> complete JDT configuration. What do you see in eclipse log?
> (<workspace>/.metadata/.log)
>
> regards,
>
> Fred Bricon

> On Tue, Jun 1, 2010 at 1:08 PM, <[hidden email]> wrote:
>
> Hello everybody,
>
> I'm using m2eclipse and its WTP integration. Currently I'm
> developing a MDB via an EJB project. I've configured the maven-ejb-
> plugin as follows:

>
>   <build>
>           <plugins>
>                   <plugin>
>                           <groupId>org.apache.maven.plugins</groupId>
>                           <artifactId>maven-ejb-plugin</artifactId>
>                           <version>2.2.1</version>
>             <configuration>             
>                 <ejbVersion>3.0</ejbVersion> 
>                 <generateClient>false</generateClient>             
>             </configuration>
>                   </plugin>
>           </plugins>
>   </build>
>
> The ear plugin-configuration is as follows:
>

>        <modules>
>                         <webModule>
>                             <groupId>xxx.pas</groupId>
>                             <artifactId>pas-jms-web</artifactId>
>                             <contextRoot>PasJms</contextRoot>
>                             <!--
>                                 We need to use this name, as
> otherwise the IBM deployment
>                                 information files (deployment.xml)
> refers to the wrong web
>                                 archive
>                             -->
>                             <bundleFileName>pas-jms-web.war</bundleFileName>
>                         </webModule>
>                         <ejbModule>
>                             <groupId>xxx.pas</groupId>
>                             <artifactId>pas-jms-ejb</artifactId>   
>                        
>                         </ejbModule>                               
>                      
>                     </modules>   
>
> Whenever I choose Maven -> Update Project Configuration, a ejbClient
> project is generated in Eclipse outside of the projects parent
> class. The project is somehow configured but not completely, it is
> not added to the ejb or ear or anything. Each subsequent choice to
> Update the project configuration leads to a new project, thus having
> ejbClient, ejbClient1, ejbClient2 and so on. I can delete these
> projects, but I would assume this is a bug, isn't it?
>
> I'm using the following Eclipse configuration:
>
> RAD 7.5.5.1 (Eclipse 3.4)
> m2Eclipse 0.10.2 (SNAPSHOT)
> external apache-maven-3.0-beta-1
>
> Another problem I'm having with is quite anyoning but does not
> bother me so much, is that whatever settings I have for the maven

> compiler plugin, target and source set to 1.5, a choice of Update
> Project Configuration always adds a JDK 1.4 to the build path, even
> though I do not even have one installed ... Guess this is a bug too.
>
> If anyone could direct me to a solution regarding the first problem
> with the not wanted ejbClient project, it would be great.
>
> Thank you very much,
>
> Heiko
>
> --
> Dr.-Ing. Heiko Kopp / Fa. GFI - iT media Consult GmbH
> c/o Mercedes-Benz Bank
> If you are not the intended addressee, please inform us immediately
> that you have received this e-mail in error, and delete it. We thank
> you for your cooperation.

If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: Generation of ejbClient project for an existing ejb project even though generateClient is set false

Ryuko
This post has NOT been accepted by the mailing list yet.
Tim Schwenk wrote
Also, I've noticed that when importing a multi-module EAR/EJB/WAR project, I
also get an extra EAR project created magically, and my WAR project gets a
WebContent folder added to it even though it isn't used.  This all smells
very much like RAD, so I'm not sure there's going to be much that can be
done to resolve the issue.  The good news is that simply deleting the extra
junk works just fine - for me at least.  YMMV.
I believe the extra EAR project when doing a 'import as maven project' can be 'avoided' by unchecking the 'Add project to an EAR' option in your workspace preferences;

From the menu bar: Windows > Preferences
Then: J2EE > Project, then its under 'Enterprise Application Membership'

This seems to have stop the extra EAR from being created.