views:

65

answers:

2

I have an EJB returning a list of my own ValidationMessage objects:

@Remote
public interface Intf {
    List<ValidationMessage> validateFile();
}

I'm generating EJB client JAR with weblogic's appc utility. The problem is that it does not include ValidationMessage class into the client JAR. Perhaps it does not see the dependency to this class because it only looks at the compiled code, when generic information is already erased.
If I add another dummy method, which returns this class directly, to the interface, everything is fine.

@Remote
public interface Intf {
    List<ValidationMessage> validateFile();
    ValidationMessage dummy();
}

My question is: is there a way to fix this without adding a dummy method? Is there a way to control what gets included by appc in the client JAR?

A: 

This is not and actual answer and I have no knowledge of WebLogic or the appc utility.

That looks like a generics erasure problem. The actual return type from the validateFile() method is the raw type List; while there is extra info in the classfile to reconstruct the type parameters, some tools do not check them.

I'm predicting that this problem will go away if you also reference the missing class in a method parameter.

Tassos Bassoukos
that's exactly what I wrote in the question: this is a generics erasure problem and it does go away if you add a dummy method referring that class.
unbeli
A: 

I did get a simialr problem with appc where i wanted to override some of the POJOS it generated for JAX-WS client.

I used this option (-output) to generate the output to a exploded directory instead of a client jar.Do an ant copy of your required .class files to the client directory and create a jar of your own.

You can see this option if you do 'java weblogic.appc' execute setEnv.cmd

-output Specifies an alternate output archive or directory. If not set, output will be placed in the source archive or directory.

check if this works

rajdevar