|
| ejbgen and Java 5 Generics |
 |
Fri, 18 Apr 2008 10:51:54 -070 |
Hi,
I am using WebLogic Portal 10 MP1 and bundled workshop.
I have a WebLogic EJB project with a stateless session been extends from
weblogic.ejb.GenericSessionBean.
@Session(type=Session.SessionType.STATELESS,
ejbName = "ProviderServiceEJB",
defaultTransaction=Constants.TransactionAttribute.REQUIRED)
@JndiName(remote = "com.esi.provider.service.ProviderService")
@FileGeneration(remoteClass = Constants.Bool.TRUE,
remoteHome = Constants.Bool.TRUE,
localClass = Constants.Bool.FALSE,
localHome = Constants.Bool.FALSE,
remoteClassName = "ProviderServiceRemote",
remotePackage = "com.esi.provider.service",
remoteHomeName = "ProviderServiceRemoteHome",
remoteHomePackage = "com.esi.provider.service")
@SuppressWarnings("unchecked")
public class ProviderServiceEJB extends GenericSessionBean {
@RemoteMethod
public List<ProviderSpecialtyVO> getAllProviderSpeciaties() {
...
}
}
The ProviderServiceRemote.java file in .apt_src folder generated by Workshop 10
looks like:
public interface ProviderServiceRemote extends EJBObject {
/**
* @weblogic.ejbgen.RemoteMethod
*/
public java.util.List<ProviderSpecialtyVO> getAllProviderSpeciaties()
throws RemoteException;
}
However if I use the com.bea.wls.ejbgen.ant.EJBGenAntTask in the ant script, the
generated file looks like:
public interface ProviderServiceRemote extends EJBObject {
/**
* @weblogic.ejbgen.RemoteMethod UNSPECIFIED
*/
public java.util.List getAllProviderSpeciaties() throws RemoteException;
}
It gave me List but not List<ProviderSpecialtyVO>. This caused compilation
errors in the web tier where the JDK 1.5 For loop syntax was used.
My ant script is:
<taskdef name="ejbgen"
classname="com.bea.wls.ejbgen.ant.EJBGenAntTask"
onerror="fail">
<classpath>
<pathelement
location="$/server/lib/weblogic.jar"/>
</classpath>
</taskdef>
<target name="generateAPTFile" depends="init">
<ejbgen
source="1.5"
wls9="true"
sourcepath="src"
outputDir=".apt_src"
forceGeneration = "true"
ejbSuffix = "."
localSuffix = "Local"
localHomeSuffix = "LocalHome"
remoteSuffix = "Remote"
remoteHomeSuffix = "RemoteHome"
>
<classpath>
<pathelement location="$/build/classes"/>
<pathelement
location="$/server/lib/weblogic.jar"/>
</classpath>
<fileset dir="src">
<include name="**/*.java"/>
</fileset>
</ejbgen>
</target>
Please advise what’s wrong?
Regards,
|
| Post Reply
|
|
|
|
|
|
|
|
|
|