You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by PBS <pa...@gmail.com> on 2007/06/26 22:35:16 UTC

Appc failing with maven weblogic plugin

Hi,

I am new to maven 2 and am trying to migrate my maven 1 projects to maven 2.
I am trying to use xdoclet maven plugin to generate ejb interfaces and
deployment descriptor files.
The ejb container used is weblogic. The xdoclet maven plugin seemed to have
executed correctly (that's what I think), but when I try to use the
weblogic-maven-plugin after that to create the stub classes and the jar, I
get errors. 

I only have a simple stateless session ejb. I get a
weblogic.utils.compiler.ToolFailureException exception with EJB specific
messages which also include entity bean specific messages.

I do not know where am I going wrong ? Is my approach right? 

Here's the code

/* TimeXMEJB.java */
package com.harland.maven2ejb.server.session;

import javax.ejb.SessionBean;
import javax.ejb.EJBException;
import javax.ejb.SessionContext;
import java.rmi.RemoteException;
import java.util.Date;

/**
 *   This is the EJB TimeBean
 *
 *   @ejb:bean type="Stateless"
 *             name="MyTimeXM"
 *             display-name="EJB MyTimeXMBean"
 *				view-type="remote"
 *
 * ... other javadoc tags ...
 */
public class MyTimeXMEJB implements javax.ejb.SessionBean {

  /**
     * Get time
     *
     * @ejb.interface-method view-type="remote"
     */
    public String getMyTimeXM() {
        return "Time is : " + new Date().toString();
    }

	/**
     * @ejb.create-method
     */
    public void ejbCreate() {   }
  
  public void ejbPassivate() {}

    public void ejbActivate() {}
    
    public void setSessionContext(SessionContext context) {}
      
    public void ejbRemove() {
}
}


My pom.xml
--------------

<?xml version="1.0"?>
<project>
	<parent>
		<artifactId>maven2ejb</artifactId>
		<groupId>com.maven2ejb</groupId>
		<version>1.0-M2-SNAPSHOT</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>maven2ejb-server</artifactId>
	<name>maven2ejb-server</name>
	<url>http://maven.apache.org</url>
	<packaging>ejb</packaging>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>*.txt</include>
				</includes>
			</resource>
			<resource>
			
<directory>target/generated-sources/xdoclet/ejb/maven2ejb/META-INF</directory>
				<!--from classes dir-->
				<targetPath>META-INF</targetPath>
				<includes>
					<include>**/*.xml</include>
				</includes>
			</resource>
		</resources>
		
		<plugins>
			<plugin>
				<artifactId>xdoclet-maven-plugin</artifactId>
				<groupId>org.codehaus.mojo</groupId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>xdoclet</goal>
						</goals>
						<configuration>
							
							<tasks>

						<!-- example : -->
								
								<ejbdoclet verbose="true" force="true"
destdir="${project.build.outputDirectory}/generated-sources/xdoclet/ejbdoclet">
									<fileset dir="${project.build.sourceDirectory}"
includes="**/*.java"/>
									<homeinterface
destDir="${project.build.directory}/generated-sources/xdoclet/ejbdoclet"/>
									<localhomeinterface
destDir="${project.build.directory}/generated-sources/xdoclet/ejbdoclet"/>
									<remoteinterface
destDir="${project.build.directory}/generated-sources/xdoclet/ejbdoclet"/>
									<localinterface
destDir="${project.build.directory}/generated-sources/xdoclet/ejbdoclet"/>
									<entitycmp
destDir="${project.build.directory}/generated-sources/xdoclet/ejbdoclet"/>
									<deploymentdescriptor
destDir="${project.build.directory}/generated-sources/xdoclet/ejb/${project.parent.artifactId}/META-INF"/>
									<weblogic version="8.1" createtables="Disabled"
destdir="${project.build.directory}/generated-sources/xdoclet/ejb/${project.parent.artifactId}/META-INF"/>
								</ejbdoclet>
							
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>weblogic-maven-plugin</artifactId>
				<version>2.8.0-SNAPSHOT</version>
				<executions>
				<execution>
					<id>generate-ejb</id>
					<phase>package</phase>
					<goals>
						<goal>appc</goal>
					</goals>
					<inherited>false</inherited>
					<configuration>
	
<objectPath>${project.build.directory}/${project.artifactId}-${project.version}.jar</objectPath>
						<verbose>true</verbose>
												
						<keepGenerated>true</keepGenerated>
						<forceGeneration>false</forceGeneration>
					</configuration>
				</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


I also have the wlclient-8.1.jar dependency for weblogic in the parent
pom.xml


Snippet of the ejb-jar.xml that gets generated 
-----------------------------------------------------------
<enterprise-beans>

      <!-- Session Beans -->
      <session >
         <description><![CDATA[This is the EJB TimeBean]]></description>
         <display-name>EJB MyTimeXMBean</display-name>

         <ejb-name>MyTimeXM</ejb-name>

         <home>com.harland.maven2ejb.server.session.MyTimeXMHome</home>
         <remote>com.harland.maven2ejb.server.session.MyTimeXM</remote>
        
<ejb-class>com.harland.maven2ejb.server.session.MyTimeXMEJB</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

      </session>



I run  mvn install

Build output:
---------------

[INFO]
----------------------------------------------------------------------------
[INFO] Building maven2ejb-server
[INFO]    task-segment: [clean, install]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\projectswl\maven2ejb\maven2ejb-server\target
[INFO] Deleting directory
C:\projectswl\maven2ejb\maven2ejb-server\target\classes
[INFO] Deleting directory
C:\projectswl\maven2ejb\maven2ejb-server\target\test-classes
[WARNING] While downloading servletapi:servletapi:2.3
  This artifact has been relocated to javax.servlet:servlet-api:2.3.


[INFO] [xdoclet:xdoclet {execution: default}]
[INFO] Initializing DocletTasks!!!
[INFO] Executing tasks
Generating Home interface for 'com.maven2ejb.server.session.MyTimeXMEJB'.
Generating Remote interface for 'com.maven2ejb.server.session.MyTimeXMEJB'.
Generating EJB deployment descriptor (ejb-jar.xml).
Generating weblogic-ejb-jar.xml.
[INFO] Executed tasks
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 4 source files to
C:\projectswl\maven2ejb\maven2ejb-server\target\classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to
C:\projectswl\maven2ejb\maven2ejb-server\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory:
C:\projectswl\maven2ejb\maven2ejb-server\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.maven2ejb.server.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.094 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [ejb:ejb]
[INFO] Building ejb maven2ejb-server-1.0-M2-SNAPSHOT with ejbVersion 2.1
[INFO] Building jar:
C:\projectswl\maven2ejb\maven2ejb-server\target\maven2ejb-server-1.0-M2-SNAPSHOT.jar
[INFO] [weblogic:appc {execution: generate-ejb}]
[INFO] Weblogic APPC processing beginning for artifact
C:\projectswl\maven2ejb\maven2ejb-server\target/maven2ejb-server-1.0-M2-SNAPSHOT.jar
[INFO]  Detailed Appc settings information AppcMojo[
 basicClientJar = false
 forceGeneration = false
 keepGenerated = true
 lineNumbers = false
 inputArtifactPath =
C:\projectswl\maven2ejb\maven2ejb-server\target/maven2ejb-server-1.0-M2-SNAPSHOT.jar
 outputArtifactPath = null
 artifacts = [weblogic:wlclient:jar:8.1:compile,
log4j:log4j:jar:1.2.13:compile]
 project Packaging = ejb
 verbose = true]
[INFO] Using Classpath C:\Documents and
Settings\pshetty\.m2\repository\weblogic\wlclient\8.1\wlclient-8.1.jar;C:\Documents
and Settings\pshetty\.m2\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar
[appc] Created working directory: C:\DOCUME~1\pshetty\LOCALS~1\Temp\appcgen
<Jun 25, 2007 2:47:19 PM EDT> <Warning> <EJB> <BEA-010212> <The EJB
'MyTimeXM(Jar: C:\DOCUME~1\pshetty\LOCALS~1\Temp\appcgen)' contains at least
one method without an explicit transaction attribute setting. The default
transaction attribute of Supports will be used for the following methods:
remote[getMyTimeXM()]  > 
[VersionHelper] : Recompiling because no previous hashes found
<Jun 25, 2007 2:47:19 PM EDT> <Warning> <EJB> <BEA-010202>
<Call-by-reference is not enabled for the EJB 'MyTimeXM'. The server will
have better performance if it is enabled. To enable call-by-reference, set
the enable-call-by-reference element to True in the weblogic-ejb-jar.xml
deployment descriptor for this EJB.> 
[ERROR] Exception encountered during APPC processing 
weblogic.utils.compiler.ToolFailureException: [J2EE:160119]Appc is unable to
process the file
'C:\projectswl\maven2ejb\maven2ejb-server\target\maven2ejb-server-1.0-M2-SNAPSHOT.jar'.
The following error occurred:

In EJB MyTimeXM, the bean class must implement directly or indirectly the
javax.ejb.SessionBean interface.

In EJB MyTimeXM, method remove() defined in the local interface either does
not exist in the bean class, or it is not a public method. Each method in
the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method getEJBHome() defined in the local interface either
does not exist in the bean class, or it is not a public method. Each method
in the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method getPrimaryKey() defined in the local interface
either does not exist in the bean class, or it is not a public method. Each
method in the local interface must have a corresponding public method in the
bean class.

In EJB MyTimeXM, method getHandle() defined in the local interface either
does not exist in the bean class, or it is not a public method. Each method
in the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method isIdentical(javax.ejb.EJBObject) defined in the
local interface either does not exist in the bean class, or it is not a
public method. Each method in the local interface must have a corresponding
public method in the bean class.

	at
weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:268)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:232)
	at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:810)
	at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:766)
	at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:200)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:387)
	at weblogic.appc.compileEJB(appc.java:802)
	at weblogic.appc.compileEJB(appc.java:776)
	at weblogic.appc.compileInput(appc.java:463)
	at weblogic.appc.runBody(appc.java:184)
	at weblogic.utils.compiler.Tool.run(Tool.java:146)
	at weblogic.utils.compiler.Tool.run(Tool.java:103)
	at weblogic.appc.main(appc.java:1028)
	

weblogic.ejb20.compliance.ComplianceException: In EJB MyTimeXM, the bean
class must implement directly or indirectly the javax.ejb.SessionBean
interface.
	at
weblogic.ejb20.compliance.SessionBeanClassChecker.checkClassImplementsSessionBean(SessionBeanClassChecker.java:91)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:278)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:232)
	at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:810)
	at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:766)
	at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:200)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:387)
	at weblogic.appc.compileEJB(appc.java:802)
	at weblogic.appc.compileEJB(appc.java:776)
	at weblogic.appc.compileInput(appc.java:463)
	at weblogic.appc.runBody(appc.java:184)
	at weblogic.utils.compiler.Tool.run(Tool.java:146)
	at weblogic.utils.compiler.Tool.run(Tool.java:103)
	at weblogic.appc.main(appc.java:1028)
	

weblogic.ejb20.compliance.ComplianceException: In EJB MyTimeXM, method
remove() defined in the local interface either does not exist in the bean
class, or it is not a public method. Each method in the local interface must
have a corresponding public method in the bean class.
	at
weblogic.ejb20.compliance.BeanClassChecker.checkBusinessMethods(BeanClassChecker.java:467)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:278)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:232)
	at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:810)
	at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:766)
	at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:200)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:387)
	at weblogic.appc.compileEJB(appc.java:802)
	at weblogic.appc.compileEJB(appc.java:776)
	at weblogic.appc.compileInput(appc.java:463)
	at weblogic.appc.runBody(appc.java:184)
	at weblogic.utils.compiler.Tool.run(Tool.java:146)
	at weblogic.utils.compiler.Tool.run(Tool.java:103)
	at weblogic.appc.main(appc.java:1028)
	

weblogic.ejb20.compliance.ComplianceException: In EJB MyTimeXM, method
getEJBHome() defined in the local interface either does not exist in the
bean class, or it is not a public method. Each method in the local interface
must have a corresponding public method in the bean class.
	at
weblogic.ejb20.compliance.BeanClassChecker.checkBusinessMethods(BeanClassChecker.java:467)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:278)
	at
weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:232)
	at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:810)
	at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:766)
	at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:200)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
	at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:387)
	at weblogic.appc.compileEJB(appc.java:802)
	at weblogic.appc.compileEJB(appc.java:776)
	at weblogic.appc.compileInput(appc.java:463)
	at weblogic.appc.runBody(appc.java:184)
	at weblogic.utils.compiler.Tool.run(Tool.java:146)
	at weblogic.utils.compiler.Tool.run(Tool.java:103)
	at weblogic.appc.main(appc.java:1028)
	
weblogic.ejb20.compliance.ComplianceException: In EJB MyTimeXM, method
getPrimaryKey() defined in the local interface either does not exist in the
bean class, or it is not a public method. Each method in the local interface
must have a corresponding public method in the bean class.
	at
weblogic.ejb20.compliance.BeanClassChecker.checkBusinessMethods(BeanClassChecker.java:467)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
.....
	at weblogic.appc.runBody(appc.java:184)
	at weblogic.utils.compiler.Tool.run(Tool.java:146)
	at weblogic.utils.compiler.Tool.run(Tool.java:103)
	at weblogic.appc.main(appc.java:1028)
	

weblogic.ejb20.compliance.ComplianceException: In EJB MyTimeXM, method
getHandle() defined in the local interface either does not exist in the bean
class, or it is not a public method. Each method in the local interface must
have a corresponding public method in the bean class.
	at
weblogic.ejb20.compliance.BeanClassChecker.checkBusinessMethods(BeanClassChecker.java:467)
	

weblogic.ejb20.compliance.ComplianceException: In EJB MyTimeXM, method
isIdentical(javax.ejb.EJBObject) defined in the local interface either does
not exist in the bean class, or it is not a public method. Each method in
the local interface must have a corresponding public method in the bean
class.
	at
weblogic.ejb20.compliance.BeanClassChecker.checkBusinessMethods(BeanClassChecker.java:467)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	

--------------- nested within: ------------------
weblogic.utils.compiler.ToolFailureException: [J2EE:160121]Errors
encountered while compiling module
'C:\projectswl\maven2ejb\maven2ejb-server\target\maven2ejb-server-1.0-M2-SNAPSHOT.jar':

In EJB MyTimeXM, the bean class must implement directly or indirectly the
javax.ejb.SessionBean interface.

In EJB MyTimeXM, method remove() defined in the local interface either does
not exist in the bean class, or it is not a public method. Each method in
the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method getEJBHome() defined in the local interface either
does not exist in the bean class, or it is not a public method. Each method
in the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method getPrimaryKey() defined in the local interface
either does not exist in the bean class, or it is not a public method. Each
method in the local interface must have a corresponding public method in the
bean class.

In EJB MyTimeXM, method getHandle() defined in the local interface either
does not exist in the bean class, or it is not a public method. Each method
in the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method isIdentical(javax.ejb.EJBObject) defined in the
local interface either does not exist in the bean class, or it is not a
public method. Each method in the local interface must have a corresponding
public method in the bean class.
 - with nested exception:
[
In EJB MyTimeXM, the bean class must implement directly or indirectly the
javax.ejb.SessionBean interface.

In EJB MyTimeXM, method remove() defined in the local interface either does
not exist in the bean class, or it is not a public method. Each method in
the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method getEJBHome() defined in the local interface either
does not exist in the bean class, or it is not a public method. Each method
in the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method getPrimaryKey() defined in the local interface
either does not exist in the bean class, or it is not a public method. Each
method in the local interface must have a corresponding public method in the
bean class.

In EJB MyTimeXM, method getHandle() defined in the local interface either
does not exist in the bean class, or it is not a public method. Each method
in the local interface must have a corresponding public method in the bean
class.

In EJB MyTimeXM, method isIdentical(javax.ejb.EJBObject) defined in the
local interface either does not exist in the bean class, or it is not a
public method. Each method in the local interface must have a corresponding
public method in the bean class.
]
	at weblogic.appc.compileEJB(appc.java:781)
	at weblogic.appc.compileInput(appc.java:463)
	at weblogic.appc.runBody(appc.java:184)
	at weblogic.utils.compiler.Tool.run(Tool.java:146)
	at weblogic.utils.compiler.Tool.run(Tool.java:103)
	at weblogic.appc.main(appc.java:1028)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 - with nested exception:
[weblogic.utils.compiler.ToolFailureException: [J2EE:160121]Errors
encountered while compiling module
'C:\projectswl\maven2ejb\maven2ejb-server\target\maven2ejb-server-1.0-M2-SNAPSHOT.jar':



-- 
View this message in context: http://www.nabble.com/Appc-failing-with-maven-weblogic-plugin-tf3984634s177.html#a11313311
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Generate weblogic stubs for ejb with Maven 2

Posted by PBS <pa...@gmail.com>.
Can someone please tell me how can I generate weblogic stubs for ejb with
Maven 2.
Which plugin do I use and how ?

-PS
-- 
View this message in context: http://www.nabble.com/Appc-failing-with-maven-weblogic-plugin-tf3984634s177.html#a11676196
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org