Calling EJB with Annotation not successfull within Netbeans

I am trying to call EJB but my simple program can't find a ejb
within netbeans. I also download a stub file from the admin page and add to the ejb client path. but still without the luck
@EJB
private static ConverterBean converterBean;
public static void main(String[] args) {
// TODO code application logic here
BigDecimal param = new BigDecimal ("100.00");
BigDecimal amount = converterBean.dollarToYen(param);
System.out.println( amount );
}

Thanks for your pointer. Could you please help me out with a small code snippet example?
I want to make use of this existing bean (AMSProfileServiceBean ):
@WebService(targetNamespace = "http://www.ttt.de/ota")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
// standard EJB3 annotations
@Local(AMSAgencyWSPortType.class)
@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
// jboss propriatary annotations
@WebContext(transportGuarantee = "NONE", secureWSDLAccess = false)
public class AMSProfileServiceBean extends AbstractProfileBuilder implements AMSAgencyWSPortType
  private static Log log = LogFactory.getLog(AMSMappingServiceBean.class);
  @EJB(mappedName = "PotsdamProfileService/local")
  private PotsdamProfileService profileService;
  private Security              security;
  @EJB
  private OTAProfileBuilder     otaProfileBuilder;
  @EJB
  private OTAProfileUpdater     otaProfileUpdater;
@Override
  public OTATTProfileReadRS otaTTReadRQ(Holder<Security> wsseHeader, OTATTReadRQ request)
...in my soap-connector :
@WebServiceProvider(wsdlLocation = "WEB-INF/wsdl/PotsdamAMSAgencyWS.wsdl", targetNamespace = "http://www.ttt.de/ota", serviceName = "PotsdamAMSAgencyWS", portName = "PotsdamAMSAgencyWSPortType")
@ServiceMode(value = Service.Mode.MESSAGE)
public class PotsdamAgencyWSProvider extends WSProvider implements Provider<SOAPMessage>
  @Resource
  WebServiceContext     wsCtx;
...A small example would be really appreciated.
Thanks.

Similar Messages

  • Error while calling EJB with a heavyweight Object Parameter

    Hi Everybody,
    I am getting the following Error when i call a EJB with a heavyweight Object Parameter in Sun ONE Application Server 7.0.0_04.
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr: org.omg.CORBA.BAD_PARAM: java.util.PropertyResourceBundle vmcid: OMG minor code: 6 completed: Maybe
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.util.Utility.throwNotSerializableForCorba(Utility.java:1018)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:691)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1062)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:259)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.corba.TCUtility.marshalIn(TCUtility.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.corba.AnyImpl.write_value(AnyImpl.java:599)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_any(CDROutputStream_1_0.java:538)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_any(CDROutputStream.java:233)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.writeAny(ShutdownUtilDelegate.java:196)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.writeAny(Util.java:78)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.write_Array(ValueHandlerImpl.java:446)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:134)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:916)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:651)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:263)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.OutputStreamHook.defaultWriteObject(OutputStreamHook.java:129)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at java.util.Vector.writeObject(Vector.java:1017)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObject(Native Method)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.invokeObjectWriter(IIOPOutputStream.java:560)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:523)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1062)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:651)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:263)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1082)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:259)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.copyObjects(Util.java:440)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.copyObjects(Util.java:296)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.hrsystem.ejb._HRSystem_Stub.get(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitAddressChange(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitToSAP(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.mydata.servlet.MyDataConfirmationServlet.processServlet(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.core.servlet.EnetBaseHttpServlet.service(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr: java.rmi.UnexpectedException: java.io.IOException: Serializable readObject method failed internally
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.wrapException(Util.java:370)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.wrapException(Util.java:277)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.hrsystem.ejb._HRSystem_Stub.get(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitAddressChange(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitToSAP(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.mydata.servlet.MyDataConfirmationServlet.processServlet(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.core.servlet.EnetBaseHttpServlet.service(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    Can someone please help to solve this.
    Regards,
    Sunil

    Unfortunately there's not really enough information for anyone to help you much. I can tell you've hit an EOF Exception, but that's about it.
    What exactly do you mean by a heavyweight object parameter? Do you mean a large (in memory size) object?
    Without any knowledge of your application, I'd probably start by changing your ejb method to do nothing. That should tell you at least whether it's the serialization of the parameter that's the issue or not. Narrow it down from there.
    If you need more help, printing the entire stack trace of the EOFException and posting it here would be helpful.
    -- Rob

  • HOW can I call EJB with JSP?

    Hi, I'm working with JSP and want to include some EJB. I dont know how can I access EJB through JSP. I dont know if I use the right code in JSP for calling EJB. Did someone know how to use that? Can someone tell me if is the right code in JSP in my example?
    Thanks, Kristjan
    THIS IS THE JSP: (useejb.jsp)
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/ejbtaglib.tld" prefix="EJB" %>
    <%@ page import="mypackage1.MySessionEJB" %>
    <%@ page import="mypackage1.MySessionEJBHome" %>
    <%@ page import="mypackage1.impl.MySessionEJBBean" %>
    <HTML>
    <head><TITLE>USEBEAN</TITLE></head>
    <body>
    <EJB:useHome id="mySessionEJBHome" type="mypackage1.MySessionEJBHome" location="java:comp/env/ejb/mySessionEJB" local="false" />
    <EJB:useBean id="mySessionEJBBean" type="mypackage1.impl.MySessionEJBBean" local="false">
    <EJB:createBean instance="<%=mySessionEJBHome.create() %>" />
    </EJB:useBean>
    <%= mySessionEJBBean.calc() %>
    </body>
    </html>
    THIS IS THE EJB CODE:(MySessionEJBBean.java)
    package mypackage1.impl;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import java.lang.String.*;
    public class MySessionEJBBean implements SessionBean
    public void ejbCreate(){}
    public void ejbActivate(){}
    public void ejbPassivate(){}
    public void ejbRemove(){}
    public void setSessionContext(SessionContext ctx){}
    public String calc(String value)
    return value + value;
    public String zanka(String x)
    return x;
    (MySessionEJB.java)
    package mypackage1;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface MySessionEJB extends EJBObject
    public String calc(String value) throws RemoteException;
    String zanka(String x) throws RemoteException;
    (MySessionEJBHome.java)
    package mypackage1;
    import javax.ejb.EJBHome;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    public interface MySessionEJBHome extends EJBHome
    public MySessionEJB create() throws RemoteException, CreateException;
    }

    You might want to look at using a Java Bean wrapper, this can be done automically using WebSphere. It creates what is called an access bean which the JSP imports.
    HTH,
    J.Clancey

  • Calling EJB with HTML via SERVLET

    Hi,
    I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
    I wonder if the problem is in servlet? The EJB is fine!
    christian
    HTML CODE:(bonus.html)
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
    <TITLE>untitled1</TITLE>
    </HEAD>
    <BODY BGCOLOR = "WHITE">
    <BLOCKQUOTE>
    <H3>Bonus Calculation</H3>
    <FORM METHOD="GET" ACTION="BonusAlias">
    <P>Enter social security Number:<P>
    <INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
    </P>
    Enter Multiplier:
    <P>
    <INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
    </P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET">
    </FORM>
    </BLOCKQUOTE>
    </BODY>
    </HTML>
    SERVLET CODE:(BonusServlet.java)
    package mypackage5;
    import mypackage5.Calc;
    import mypackage5.CalcHome;
    import mypackage5.impl.CalcBean;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.beans.*;
    public class BonusServlet extends HttpServlet {
    CalcHome homecalc;
    public void init(ServletConfig config) throws ServletException{
    //Look up home interface
    try{
    //InitialContext ctx = new InitialContext();
    //Object objref = ctx.lookup("Calc");
    //homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
    Context context = new InitialContext();
    CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
    Calc calc;
    catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String socsec = null;
    int multiplier = 0;
    double calc = 0.0;
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<HTML><HEAD><TITLE>");
    out.println(title);
    out.println("</TITLE></HEAD><BODY>");
    try{
    Calc theCalculation;
    //Get Multiplier and Social Security Information
    String strMult = request.getParameter("MULTIPLIER");
    Integer integerMult = new Integer(strMult);
    multiplier = integerMult.intValue();
    socsec = request.getParameter("SOCSEC");
    //Calculate bonus
    double bonus = 100.00;
    theCalculation = homecalc.create();
    calc = theCalculation.calcBonus(multiplier, bonus);
    catch (Exception CreateException){
    CreateException.printStackTrace();
    //Display Data
    out.println("<H1>Bonus Calculation</H1>");
    out.println("<P>Soc Sec: " + socsec + "<P>");
    out.println("<P>Multiplier: " +
    multiplier + "<P>");
    out.println("<P>Bonus Amount: " + calc + "<P>");
    out.println("</BODY></HTML>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");

    The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
    thanks
    Christian

  • Having some troubles with annotations, hyperlinks, images within PDFs

    Hello all.
    I am having a few issues with my PDFs and I hope that someone can assist me.
    First, I want to state that we are using LCES2 SP1, with Workbench, Designer, Workspace, PDF generator and Reader Extensions. We do not currently have Output.
    Situation:
    I have created several forms in Designer that present the user with information from an XML submitted via a .net app. The info includes customer data, URLs to other pages and a URL to an image/s which I embed within the PDF for presentation.
    In addition to the customer data, the forms present one or more embedded images from the XML which are different every time(dynamically embedded in form). We also present several URLs from the XML which I have hyperlinked. We also need to capture Annotations/markups on the PDF.
    I have the dynamically populated images displaying correctly to the user. Annotations and the hyperlinks are basically functioning correctly as well.
    My issues:
    The problems that I have encountered are:
    1. The embedded images that are presented do not show the annotations on them. It seems as though the annotations are marking on the PDF behind the embedded images. For example, if I draw a line across the PDF, the line is there but will not show on the actual images. Is there a way to push the images back and bring the annotations etc in front?
    2. The hyperlinks work correctly except that when we open the PDFs in Workspace, the hyperlinks open the page within the Workspace area. Is there a way to force the Hyperlinks from Workspace to open the page in a new browser tab or page? I have attempted to use the target="_blank" with no success.
    3. The annotations are being captured and collected ok within LC. I can see the updated XML which includes the markups etc. I have attempted to then use the updated XML to present the PDF, including the annotations, to the next user in the TaskAssignment. Even using Reader Extensions, the annotations/drawings do not display to the next user in their Task. However, if I open the same document using Acrobat Pro, the annotations are displayed correctly. Anyone have an idea what I am doing wrong? Do we require the use of Output to flatten the document with the annotations?
    Thank you all for your assistance
    David

    Hi,
    three years later I have the same problem as David posted in no. 1.
    I created a PDF form in LCD with image fields and text fields that are filled within another software. In LCD I placed the fields in the background. After the pdf fields have been filled within the other software the user wants to add markups and comments on it.
    But the markups on the PDF appear behind the images and texts. I need the markups in front, how can I manage this??
    Best regards,
    MiHue

  • Securing an EJB with Annotations

    I would like to build an EJB that uses annotations to secure various functions but the only documentation I have come across is specific to JBoss which uses a custom annotation to specify the security domain. I would prefer to build this in an application server agnostic manner, is there a way in JBoss to specify the domain without using this custom annotation?
    Ultimately the plan is to provide a user interface such that if a user logs in he is presented with a certain set of capabilities and if an admin logs in another set of capabilities. After a user logs in using JAAS is there a way to get the roles that the user belongs to from the Web Tier (i.e. a Flex Client, JSP, Thick Client)? Thanks in advance.

    JaM2003 wrote:
    Thanks for your input duffymo. I would agree that I would prefer to keep these things outside the EJB, but my understanding is that the descriptor files overwrite what is in the EJB so there is no harm in having them there right?No idea.
    My basic issue is trying to authenticate Flex Clients properly. I was unable to find a great deal of information about Flex Clients and JAAS online so I have resorted to building an EJB that does the authentication based on username/passwords given to it. Not as clean as I would prefer but at this point I see no alternative.Good question. I don't know the answer.
    %

  • Calling EJB with bpelx:exec lookup-methode

    I created a EJB3.0 that I try to lookup in a BPEL Java Embedding activity with following code:
    try {          
      Object homeObj = lookup("ejb/stateless/LoginDataBean#com.unisoa.logindata.LoginDataBeanRemote");
    } catch (Exception ex) {              
       addAuditTrailEntry(ex);   
    }I get Logged exception "NameNotFoundException" as result. Unfortunately I do not have a clue why this happens.
    To prove the lookup-name I checked jndi-tree and it shows Binding-Name: ejb.stateless.LoginDataBean#com.unisoa.logindata.LoginDataBeanRemote. So jndi-name seems to be ok.
    Also I generated a java client with JDeveloper that works well too.
    Code Java Client:
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"; );
    env.put(Context.PROVIDER_URL, "t3://server:port");
    InitialContext context = new InitialContext( env );     
    LoginDataBeanRemote loginDataBeanRemote = (LoginDataBeanRemote)context.lookup("ejb/stateless/LoginDataBean#com.unisoa.logindata.LoginDataBeanRemote";);The bean I try to call is following:
    @Stateless(name = "LoginData", mappedName = "ejb/stateless/LoginDataBean")
    @Local(LoginDataBeanLocal.class)
    @Remote(LoginDataBeanRemote.class)
    public class LoginDataBean implements LoginDataBeanLocal, LoginDataBeanRemote{
      public LoginDataBean() {}
    }I did online research but could not find any usefull information. Also I do not know if remote or local jndi-name is necessary for lookup-methode. I am using SOA Suite 11.1.1.3.0.
    I would really appreciate some help.
    Thx
    Pascal

    Have you resolved this? I'm struggling with the exact same problem; a standalone EJB Java client works and I can see the mapped name in the soa server JNDI tree etc

  • A problem with annotation @EJB

    Hi,
    My application uses servlet+JSP+EJB+JBOSS. I want to use a pure java object that is a singleton and within this singleton call an EJB.
    I have a servlet that call a singleton:
    My servlet
    public class FindAdministratorForumServlet extends HttpServlet {
         private static final long serialVersionUID = 1L;
         // ======================================
         // = Entry point method =
         // ======================================
         @Override
         protected void service(final HttpServletRequest request,
                   final HttpServletResponse response) throws ServletException,
                   IOException {
              final int rows=3;
              int page = Integer.parseInt(request.getParameter("page"));
              List<Topic> discussionList = ListHandlerService.getForumTopics(page); My singleton :
    package service;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.ListIterator;
    import javax.ejb.EJB;
    import sessionbean.TopicService;
    import entitybean.Topic;
    public class ListHandlerService {
         private final static int rows=3;
        /** L'instance statique */
        private static ListHandlerService instance;
        /** objet pour la synchronisation.
         * j'ajoute deux "soulignés" (__) au nom de l'attribut car il n'a
         * qu'un intérêt purement technique.
        private static Object objetSynchrone__;
        private static List<Topic> listTopic;
         @EJB
         private static TopicService discussionService;
        /** Récupère l'instance unique de la class Singleton.
        * Remarque : le constructeur est rendu inaccessible
        public static ListHandlerService getInstance() {
            if (null == instance) { // Premier appel
                synchronized(objetSynchrone__) {
                    if (null == instance) {
                        instance = new ListHandlerService();
            return instance;
        /** Constructeur redéfini comme étant privé pour interdire
        * son appel et forcer à passer par la méthode
        private ListHandlerService() {
        public static List<Topic> getForumTopics(int page) {
             int i = 0;
              Topic topic;
              LinkedList<Topic> result = new LinkedList<Topic>();
             if (page==1) {
                  listTopic = discussionService.getForumTopics();
                  ListIterator<Topic> listIterator = listTopic.listIterator();
                  while (listIterator.hasNext() && (i< rows)) {
                       topic = listIterator.next();
                       result.add(topic);
                       i++;
             } else {
                  ListIterator<Topic> listIterator = listTopic.listIterator();
                  while (listIterator.hasNext() && (i< rows*(page-1))) {
                       listIterator.hasNext();
                       i++;
                  while (listIterator.hasNext() && (i< rows*page)) {
                       topic = listIterator.next();
                       result.add(topic);
                       i++;
             return result;
        public static int getSize() {
             return listTopic.size();
    } In my singleton that is a pure JAVA object, the injection of my EJB with annotation @EJB doesn't seem to work. Indeed when executing, "discussionService" that should be injected and initialized, is null. Isn't it possible to inject an EJB in a pure java object which is a singleton ?
    Thank you for your answers.

    Is it deployed in the same application?
    In they are not in the same application you need to use some other techniques. See the following thread for info:
    http://forums.sun.com/thread.jspa?threadID=5332558

  • Possible to search annotation notes in Preview?

    I have several marked up PDFs — sections are highlighted with annotated notes — and I would like to be able to search within the notes (not the actual text of the PDF) using Preview. Is this possible? I can't seem to get it to work.
    Most of my PDFs were marked up using iAnnotate for the iPad. But I have also marked up some using Preview itself and still can't search the notes.
    Am I missing something?
    If not possible with Preview, is there other desktop software that would allow for this functionality?

    In addition to ronnie:
    The Cmd F function DOES work in the browser when the triangles that ronnie mentioned are folded open (pointing down; showing you all the markers). When the triangles are closed (pointing to the right; not showing markers) then CMD-F does not find your markers indeed...
    Rienk

  • Annotations Not being Synched back

    Were having an isssue with Annotations not being Synched while on our network, they work fine outside of it.
    Weve tracked this down to the request not going through our proxy, but going direct.
    Has anyone encpuntered this issue or can they shed any light on this?

    Authorize your computer again in the Store menu in iTunes
    http://support.apple.com/kb/HT1420

  • Subclassed EJB with RolesAllowed annotation not giving permission

    A servlet is calling a method of an EJB (name EJB B). EJB B is a sub class of EJB A which contains the method and is not overridden by EJB B.
    EJB A uses the annotation @RolesAllowed({"user","system","admin"})
    EJB B uses the annotation @RolesAllowed({"system"})
    When the call is made by the servlet the following error is produced:
    JBAS014134: EJB Invocation failed on component EJB B for method xxxx: javax.ejb.EJBAccessException: JBAS014502: Invocation on method: xxxx throws exception of bean: EJB B is not allowed
    If I replace the EJB A annotation with @PermitAll then the method is called without the permission problem.
    I am wondering why the 'system' role allowed in EJB A is ignored in the annotation and the exception is thrown.
    Is this a bug perhaps?

    Hi Jay Bhaiya,
    I am getting the correct output by following the below:
    1: Change the SecurityRolesImpl.java to provide the below role that can access the EJB method:
    *@RolesAllowed({"TestRole"})*
    2: Then build the service as normal using the same build.xml
    3: Do not depoly the EAR using ant and try to use the Admin Console to deploy the EAR.
    4: While deploying the application through the admin console choose the below option:
    Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor.
    5: Then create the client stubs using the build.xml
    6: Then go to the Admin Console.
    Security Realm >> my realm >> users and Groups >> create a user TestUser ( pass- TestUser).
    7: Then Click on the RolesAllowedEar under the depolyments tab.
    Click on Security >> Roles ..
    Create a New Role >>> TestRole.
    Click on the Role created (TestRole) >>> Add Condition >>>
    Within Add Condition >> select User >> NEXT >>>
    Enter TestUser >>> Click ADD .
    Click Save.
    Now try to access the Web Service using the client code.
    Thanks,
    Sandeep

  • Yielding is not allowed within a C or metamethod call

    The way I'm developing my plug in is that I'm creating individual modules, testing those modules and then integrating the modules into my plugin. The individual modules work. However, I have a problem when I try to integrate.
    I'm using an anonymous function to call a function when a user presses a button. That function calls another lua file (is that a module?) If I place the require statement at the top of the file I receive the Yielding is not allowed within a C or metamethod call error.
    However, if I place the require statement within the function that specifically requires accessing the lua file then I don't receive the error. Clearly, I don't understand what's going on. Can anyone explain what is happening here?
    Thanks!

    Hey Rob,
    Thanks for helping me with this. Since this is so new to me, I'm all over the place and I'm having trouble even understanding what my problems are :-)
    Anyway, here's where I'm at:
    I have a button in sectionsForTopOfDialog. I have changed the action to be action = function() .... end
    When I press the button the function is called. The problem is when I call the LrHttp.post function. That's when the yield error is being thrown.

  • A free ebook for EJB 3.0 with the latest version of Netbean

    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    Again, is container managed bean good for a big project?
    Thanks.
    Emeka

    emekaco wrote:
    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
    Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
    >
    Again, is container managed bean good for a big project?
    The question is too vague to be answered. It's a design decision that needs more details.

  • Exception calling "Activate" with "0" argument(s): "Topology does not contain any components of type Microsoft.Office.Server.Search.Administration.Topology.AdminComponen

    Hi,
    I have a Sharepoint 2013 farm I am trying to provision search for (not the same as my other thread). However, I get the below error:
    Exception calling "Activate" with "0" argument(s): "Topology does not contain any components of type Microsoft.Office.Server.Search.Administration.Topology.AdminComponent"
    In my script, I have the following:
    New-SPEnterpriseSearchAdminComponent -SearchTopology $clone  -SearchServiceInstance $SearchServiceInstanceServer3 -ErrorAction SilentlyContinue
    So I am not sure why the error happens, when I am trying to set this component. However, it's not the first component to be set (index partition on non-local servers first). I can make it first, but why does this error happen?
    UPDATE: I have noticed that the usage and health proxy on my farm is/was stopped, but I am not able to access the server(s) to look at this right now. Could this cause this issue?

    Do you already have Admin component running for the Search Service Application?
    Usage and Health Service will not cause this issue.
    Please also refer to below discussion to see if it helps:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/02f0b072-aa3a-4b7f-9662-2caf373d1e57/setspenterprisesearchtopology-identity-newtopology?forum=sharepointgeneral
    Warm Regards,
    Bhavik K Jain
    Sr. Software Engineer - SharePoint Administration
    Please vote if my reply helps and ensure that you mark a question as Answered once you receive a satisfactory response.

  • HELP!!!! I have spent hours trying to find out how to embed an image with a link or a Microsoft Word document with a hyperlink built within the document -- not as an attachment! Does ANYONE know the secret? Can it be done, or not! My PC clients do it.

    HELP!!!! I have spent hours trying to find out how to embed an image with a link, or embed a Microsoft Word document with a hyperlink built within the document -- not as an attachment into my email -- but where it shows as the email content when opened! Does ANYONE know the secret? Can it be done, or not? My PC clients do it all the time easily. Then I want to be able to send the embedded image/document (not as an attachment, but visable within the email when opened) to many email contacts at once, BUT the individuals receiveing them DO NOT SEE the other email contacts. Cannot seem to be able to find anything on being able to do these 2 tasks.PLEASE, SOMEONE, HELP!!!

    Don't know if this applies to Lion, but read here:
    http://www.makeuseof.com/tag/create-html-announcement-mail-iweb-mac/

Maybe you are looking for

  • How to Override Company and Cost Center for FI Posting from HR Payroll

    Current problem:  A company code has been 'merged' into another one and the old company code can no longer be used.  In the last payroll run, there was a rate change that caused a retro back to the time of the old company code and since the old compa

  • IBooks Screenshots

    iTunes Producer has a section where you can insert up to 5 screenshots of your book. I searched the iBook Store and I haven't seen one single book that has screenshots on the book page. Why is that? Secondly when creating a eBook for iPhone and iPad

  • USB endpoint hardware limit reached, but why?

    I was playing with a few FTDI RS232 serial converter cables. Plugging them in and out. After doing this several times, I noticed that the device is not recognized anymore. I dug into the system logs and found the reason: 30/10/14 13:54:59,000 kernel[

  • Dot shaped widget in iphone home screen

    I'v seen an iphone 6 in one of the showrooms. it has dot floating on the home screen whcih show certain shortcuts when touch, how can I enable this on my phone I'v searched the internet for this and I didn't find any mention about it.

  • Can't play video online

    When on the internet, videos won't play.  Screen where video is remains black.  Sometimes sound and no video.  But no video.  Can any one help?