Primitive int[] and Integer[] array type not supported - weblogic.developer.interest.webservices.general(Archived)

Hi there,
I have a stateless ejb exposed as webservice using jax-rpc 1.1 and one of my methods accepts a parameter of int[] array. When I run the wls clientgen ant task and I look at the generated client stub for that webservice the parameter is no longer int[] but this one "com.starcomsoft.ArrayOfJavaLangint_Literal". Below is a snippet of client stub code produced by wls clientgen.
public class CustomerWS_Stub
extends weblogic.wsee.jaxrpc.StubImpl
implements com.starcomsoft.pp.customer.jws.CustomerWS, /**/
public CustomerWS_Stub(weblogic.wsee.wsdl.WsdlPort port,
weblogic.wsee.jaxrpc.ServiceImpl service)
throws javax.xml.rpc.ServiceException
super(port, com.starcomsoft.pp.customer.jws.CustomerWS.class, service);
* Operation Name : {}findAddresses1 */
public java.lang.Object[] findAddresses1(com.starcomsoft.ArrayOfint_Literal idSet) throws java.rmi.RemoteException {
java.util.ArrayList _args = new java.util.ArrayList();
try {
java.lang.Object result = invoke("findAddresses1", _args.toArray());
return (java.lang.Object[])_result;
} catch (javax.xml.rpc.JAXRPCException wlsexception) {
throw new java.rmi.RemoteException(_wls_exception.getMessage(), wlsexception.getLinkedCause());
} catch (javax.xml.rpc.soap.SOAPFaultException wlsexception) {
throw new java.rmi.RemoteException(_soapFault2String(_wls_exception), wlsexception);
} catch (java.lang.Throwable wlsexception) {
throw new java.rmi.RemoteException(_wls_exception.getMessage(), wlsexception);
And here is my webservice class:
#SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL,
#Stateless(mappedName = "CustomerBeanWS")
#WebService(name = "CustomerWS",
               serviceName = "CustomerWSService",
               targetNamespace = "")
public class CustomerWSImpl implements CustomerEJBRemote, CustomerEJBLocal {
     public List<Address> findAddresses1(int[] idSet) {
          AddressDAO dao = new AddressDAO();
          List<Address> addrList = dao.loadAddresses(idSet);
          return addrList;
I also tried using Integer[] type but the same type is produced - that is "com.starcomsoft.ArrayOfJavaLangint_Literal".
I'm stuck and your help is very much appreciated.


#Resource DataSource ds and #EJB injection not working

Hi there,
I'm using wls 10.3 and I'm trying to inject a DataSource and EJB in one of my webservice (jax-rpc) and using the annotation because I'm just using the jwsc ant task to generate all my weblogic descriptor. When I tried to test the DataSource and EJB it is null. I have defined in the admin console a jdbc DataSource jndi named="jdbc/ppDataSource" and also created both SystemEJBRemote and SystemEJBLocal ejb's. Sample code below.
public class CustomerWSImpl
#EJB private SystemEJBLocal systemLocal;
#Resource DataSource(name="jdbc/DataSource") ds;
public void testInjection() {
// test ejb
if (systemLocal != null) {
} else {
System.out.println("SystemEJBLocal ref injection is null.");
if (ds != null) {
} else {
System.out.println("DataSource ref injection is null.");
#Local( SystemEJBLocal.class )
#Remote( SystemEJBRemote.class )
public class SystemEJBImpl {
public void hello() {
System.out.println( "Hello EJB3!" );
Your help is very much appreciated.

Invoking weblogic ejb over iiop

I am trying to invoke my EJB ( stateless session ) through iiop protocol. My client
code is based on the sample bean provided by weblogic. I have the client code
When I run the client I get the following exception ...
Exception in thread "main" java.lang.ClassCastException at
Source) at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at Client.narrow( at Client.lookupHome(
at Client.<init>( at Client.main(
I am invoking the EJB in the same way as it has been suggested by weblogic. I
reffered to this url
Can someone tell me what am I doing wrong? My EJB is OK as I can invoke it nicely
from a t3 client. I am using weblogic 6.1 sp 2
This is the code of the client
import java.rmi.RemoteException;
import java.util.Properties;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import shub.ejb.test.*;
public class Client {
private static final String JNDI_NAME = "shub.ejb.test.Far2CentHome";
private String url;
private Far2CentHome home;
private static boolean remote = false;
public Client(String url)
throws NamingException
this.url = url;
home = lookupHome();
public static void main(String[] args) throws Exception {
log("\nBeginning statelessSession.Client...\n");
String url = "iiop://localhost:7001";
// Parse the argument list
     if(args.length != 1){
          System.out.println("Wrong usage");
     log("\nBeginning statelessSession.FartoCentClient...\n");
     float d = (new Float(args[0])).floatValue();
Client client = null;
try {
client = new Client(url);
} catch (NamingException ne) {
try {
} catch (Exception e) {
log("There was an exception while creating and using the Trader.");
log("This indicates that there was a problem communicating with the server:
log("\nEnd statelessSession.Client...\n");
* Runs this example.
public void example(float d)
throws CreateException, RemoteException, RemoveException
// create a FartoCent
log("Creating a FartoCent");
Far2Cent fartocent = (Far2Cent)narrow(home.create(), Far2Cent.class);
log("Far= "+d+" Cent="+fartocent.getCent(d));
* RMI/IIOP clients should use this narrow function
private Object narrow(Object ref, Class c) {
return PortableRemoteObject.narrow(ref, c);
* Lookup the EJBs home in the JNDI tree
private Far2CentHome lookupHome()
throws NamingException
// Lookup the beans home using JNDI
Context ctx = getInitialContext();
try {
Object home = ctx.lookup(JNDI_NAME);
return (Far2CentHome) narrow(home, Far2CentHome.class);
} catch (NamingException ne) {
log("The client was unable to lookup the EJBHome. Please make sure ");
log("that you have deployed the ejb with the JNDI name "+JNDI_NAME+" on
the WebLogic server at "+url);
throw ne;
private Context getInitialContext() throws NamingException {
try {
// Get an InitialContext
Properties h = new Properties();
h.put(Context.PROVIDER_URL, url);
return new InitialContext(h);
} catch (NamingException ne) {
log("We were unable to get a connection to the WebLogic server at "+url);
log("Please make sure that the server is running.");
throw ne;
private static void log(String s) {
Putting the thread on top again so that it is visible to others

int[] or Integer[] array is not working.

Hi there, I'm using wls 10.3 and some of my web services classes/methods (jax-rpc 1.1) used either an int[] or Integer[] array as both a parameter and return types. When I generate the wls client artifacts using jwsc ant task, the client stub method signature is different. Instead of seeing it as int[] or Integer[] - I'm seeing these class types. Below are the snippet of wls generated client stub classes.
1. public java.lang.Object[] findCustomersByIds(com.starcomsoft.ArrayOfint_Literal ids) throws java.rmi.RemoteExceptionc {..}
2. public java.lang.Object[] findCustomersByIds2(com.starcomsoft.ArrayOfJavaLangint_Literal ids) throws java.rmi.RemoteException {..}
Also below is the wls generated class that replace both the int[] and Integer[] array. and
public class ArrayOfint_Literal implements {
private int[] _int;
public int[] getInt() {
return this._int;
public void setInt(int[] _int) {
this._int = _int;
public class ArrayOfJavaLangint_Literal implements {
private java.lang.Integer[] javaLangint;
public java.lang.Integer[] getJavaLangint() {
return this.javaLangint;
public void setJavaLangint(java.lang.Integer[] javaLangint) {
this.javaLangint = javaLangint;
This 2 classes seems to wrapped both the int[] and Integer[] array. Is this correct or not? I would expect that they would support this java types, because the old wls 7.2 supported it and we have no problem on our old web service application.
Your help is very much appreciated.

IllegalAccessError for the same package

I'm using Workshop 8.1, and I'm trying to implement some WebServices.
I have a small problem.
I put the Web Service (JWS file) in the same package as other classes. These other classes aren't public, but they should be instanciable by classes in the same package, especially by the web service.
I noted that the compiled JWS file is in another directory than the compiled Java files; I don't know why, but i suspect that's the ground of the problem.
Source excerpts :
public class CDCatalogWS implements com.bea.jws.WebService, ICDCatalog
static final long serialVersionUID = 1L;
CDCatalog catalog;
public CDCatalogWS () {
catalog = new CDCatalog();
* #common:operation
public String getCd(String title) throws MyException {
return catalog.getCd(title);
class MyException extends Exception {
     private int nombre;
     MyException (int nombre) {
          this.nombre = nombre;
     public MyException () {
this.nombre = 10;
     public int getNombre () {
          return this.nombre;
     public void setNombre (int nombre) {
          this.nombre = nombre;
Is there a solution to be able to reference MyException (or other classes in the same package) without setting it "public" (which indeed solves the problem) ?

Another try, with CR: Error deserializing arguments, xml tag without a recognized type

Sorry, I will try this again. The carriage returns didn't show.
I am trying to run a webservice created using Weblogic Workshop 8.1sp2 that communicates
with an ejb control. When I test in debug mode, I get the above error, specifically:
<jwErr:jwErrorDetail xmlns:jwErr="">
com.bea.wlw.runtime.core.request.RequestValidationException: Error deserializing
Encountered an xml tag without a recognized type: the type must be declared with
an xsi:type attribute.
Caused by: com.bea.xml.marshal.XmlEncodingException: Encountered an xml tag with
out a recognized type: the type must be declared with an xsi:type attribute.
I am passing a Request object to the jws method (to the ejb) that has a Collection
as an instance member. This Collection references objects of another type, Param
(code for both objects below). Before passing the object, I convert the Collection
to an array of objects. When I call the operation via a java client, I get the
above message.
In Workshop, I've included the Request and Param classes as the parameter xml
and the soap style is rpc. I've tested the ejb by itself and it is working fine.
import java.util.*;
public class Request implements
protected Collection params=null;
public Collection getParams()
{ return params; }
public void setParams(Collection data)
{ params=data; }
public class Param implements
private String name=null;
private Object value=null;
public String getName()
{ return name; }
public void setName(String data)
{ name = data; }
public Object getValue()
{ return value; }
public void setValue(Object data)
{ value=data; }
Here's the code from the jws:
public class MyWS implements com.bea.jws.WebService
* #common:control
private control.PSEjbControl psEJB;
static final long serialVersionUID = 1L;
* #common:operation
* #jws:parameter-xml
* include-java-types="mypackage.Request mypackage.Param"
* #jws:protocol soap-style="rpc"
public void addData(mypackage.Request arg0) throws java.rmi.RemoteException
System.out.println("arg0 : " + arg0);
*Note: in the server console, arg0 comes through as null when called from my client.
Here's the bit from my client:
import weblogic.jws.proxies.*;
import org.openuri.www.encodedTypes.Request;
import org.openuri.www.encodedTypes.Param;
public void go(String wsdl) throws Exception {
MyWSSoap mw = null;
mw = new MyWS_Impl().getMyWSSoap();
Request req = new Request();
Collection reqColl = new ArrayList();
Param param1 = new Param();
param1.setValue("Joe Tester");
Param param2 = new Param();
param2.setValue("345 Test Drive");
Object[] obs = reqColl.toArray();
Not sure if this enough to go by. Please let me know if you need more information.
Any help is really appreciated. Thanks.