Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb "AdhocCountAdminBean" doesn't have a web service view in ejb-jar.xml  RSS feed

 
d krishnamohan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am new to web services. I am developing EJB 3.0 as a WebService using JDeveloper 11 with inbuilt WebLogic Server. Where i haven't used ejb-jar.xml, but it's saying the following error:

ejb "AdhocCountAdminBean" doesn't have a web service view in ejb-jar.xml

Please give me an idea to resolve this issue. The code is below:

//Remote Interface

package oracle.retail.sim.closed.adhoc.ejb;

import javax.ejb.Remote;

import oracle.retail.sim.closed.util.CompressedObject;

@Remote
public interface AdhocCountAdminInterface {
public abstract CompressedObject findAllAdhocCountAdmins(CompressedObject compressed0, CompressedObject compressedSimSession)
throws Exception;

public abstract CompressedObject update(CompressedObject compressed0, CompressedObject compressedSimSession)
throws Exception;

}


//Bean class (Service end point)

package oracle.retail.sim.closed.adhoc.ejb;

import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.*;

import javax.jws.WebMethod;
import javax.jws.WebService;

import oracle.retail.sim.closed.ejb.AbstractSimServiceBean;
import oracle.retail.sim.closed.logging.LogNames;
import oracle.retail.sim.closed.logging.LogService;
import oracle.retail.sim.closed.util.SimSession;
import oracle.retail.sim.closed.util.UniversalContext;
import oracle.retail.sim.closed.util.CompressedObject;
import oracle.retail.sim.closed.adhoc.AdhocCountAdminServices;

@Stateless(name = "AdhocCountAdminBean", mappedName = "App4-Pr4-AdhocCountAdmin")
@Remote
@WebService
public class AdhocCountAdminBean extends AbstractSimServiceBean<AdhocCountAdminServices> implements AdhocCountAdminInterface
{
private static final long serialVersionUID = 5678192564072816382L;
private static final String SERVICE_KEY = "AdhocCountAdminServices.SERVER_IMPL";

@WebMethod
public CompressedObject findAllAdhocCountAdmins(CompressedObject compressed0, CompressedObject compressedSimSession)
throws Exception {
long startTime = System.currentTimeMillis();
LogService.debug(LogNames.SERVICE_TIMINGS, "Starting service method: AdhocCountAdminBean.findAllAdhocCountAdmins()");
try {
java.lang.Long arg0 = (java.lang.Long) compressed0.recoverObject();
SimSession session = (SimSession) compressedSimSession.recoverObject();
UniversalContext.setSession(session); // copy the SimSession from client request
Object retObj = getService(SERVICE_KEY).findAllAdhocCountAdmins(arg0);
return new CompressedObject(retObj);
} catch (Throwable t) {
handleException(t, "findAllAdhocCountAdmins", true);
return null;
} finally {
completeServiceContext();
long endTime = System.currentTimeMillis();
LogService.debug(LogNames.SERVICE_TIMINGS, "Took " + (endTime - startTime) + "ms. for invocation of: AdhocCountAdminBean.findAllAdhocCountAdmins()");
}
}

@WebMethod
public CompressedObject update(CompressedObject compressed0, CompressedObject compressedSimSession)
throws Exception {
long startTime = System.currentTimeMillis();
LogService.debug(LogNames.SERVICE_TIMINGS, "Starting service method: AdhocCountAdminBean.update()");
try {
java.util.List<oracle.retail.sim.closed.adhoc.AdhocCountAdmin> arg0 = (java.util.List<oracle.retail.sim.closed.adhoc.AdhocCountAdmin>) compressed0.recoverObject();
SimSession session = (SimSession) compressedSimSession.recoverObject();
UniversalContext.setSession(session); // copy the SimSession from client request
getService(SERVICE_KEY).update(arg0);
return new CompressedObject(null);
} catch (Throwable t) {
handleException(t, "update", true);
return null;
} finally {
completeServiceContext();
long endTime = System.currentTimeMillis();
LogService.debug(LogNames.SERVICE_TIMINGS, "Took " + (endTime - startTime) + "ms. for invocation of: AdhocCountAdminBean.update()");
}
}
}
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Have you tried annotating the AdhocCountAdminInterface interface with the @WebService annotation?
Best wishes!
 
d krishnamohan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried "AdhocCountAdminInterface" with @WebService annotation, But I could not find the option "Test WebService".
Please tell me how to test the application?
 
d krishnamohan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tested the same application with simple method like
int add(int a, int b){ return (a+b);}, it's running. But when a take the methods with some class object as argument/return value, it's giving "ejb "AdhocCountAdminBean" doesn't have a web service view in ejb-jar.xml" error.

Please give me an idea to resolve it. Thanks in advance.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!