Ejb packaging

Hi
I am sun One Studio for creating the ejb jar file .I have an ejb which access helper class . When I try to verify the ejb I am getting the following error
org/xml/sax/ErrorHandler.java [0:0] No file named org/xml/sax/ErrorHandler.java exists on disk in src.zip.
Therefore it may not be compiled with an external compiler.
You may need to check it out from version control or save some changes to it.
src/com/transversalnet/grid/ejb/processor/EJBModule_Processor.ejbmodule [0:0] Problem compiling class: "org/xml/sax/ErrorHandler" reason: Compile failed
Called From: org/jdom/input/BuilderErrorHandler
Called From: org/jdom/input/SAXBuilder
Called From: com/transversalnet/userinterface/Component
Called From: com/transversalnet/userinterface/UIPersonalise
Called From: com/transversalnet/sysutils/CurrentSession
Called From: com/transversalnet/serverprograms/ServerDaemons
Called From: com/transversalnet/SysInit
Called From: com/transversalnet/grid/util/GridUtils
Called From: com/transversalnet/grid/util/QueueHandler
Called From: com/transversalnet/grid/util/GridAdmin
Called From: com/transversalnet/grid/util/GridProperties
Called From: com/transversalnet/grid/logs/Logger
Called From: com/transversalnet/grid/base/MessageHandlerFactory
Called From: com/transversalnet/grid/ejb/processor/ProcessorBean
Errors compiling EJBModule_Processor.
I have included the xerces.jar file in my class path
Please help
Thanks and regards
Sunnesh VR

Easy!
Try doing FileSystems . Rigth Click Custimize and then delete src.zip and now try.
If you can resolve me the doubts that i�ve got in more ejb will be fantastic for both.

Similar Messages

  • Error:ejb package does not exist

    I seem to be having a problem with recognizing my EJB packages. I tried putting some quick & dirty java code directly into a jsp to see if I can use the EJB correctly. I keep getting compile errors that the package is not there:
    testEJB_jsp.java:8: package com.hs.ejbs does not exist import com.hs.ejbs.*;
    testEJB_jsp.java:66: package com.hs.ejbs does not exist
    com.hs.ejbs.XreviewsLocalHome rv;
    ^
    testEJB_jsp.java:73: package com.hs.ejbs does not exist
    rv = (com.hs.ejbs.XreviewsLocalHome) c.lookup("java:comp/env/ejb/XreviewsBean");
    I have tried putting the jar files in several locations and adding those locations to my class path. Apparently I still do not have the right path there.
    Here is my code:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import= "javax.ejb.*" %>
    <%@page import= "javax.naming.*" %>
    <%@page import= "com.hs.ejbs.*" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>testEJB</title>
        </head>
        <body>
    <%
        SessionContext context;
        com.hs.ejbs.XreviewsLocalHome rv;
        try {
            javax.naming.Context c = new javax.naming.InitialContext();
         rv = (com.hs.ejbs.XreviewsLocalHome) c.lookup("java:comp/env/ejb/XreviewsBean");
        } catch(Exception e){
        out.println("ejb retrieval error e="+e);
        out.println("made it past the ejb retrieval code");
    %>   
        </body>
    </html>Assistance will be greatly appreciated.

    Hi,
    You can get this by putting your jar file in
    YourApp/WEB-INF/lib folderstill if you are not getting then extract the jar file in
    YourApp/WEB-INF/classes folderok
    bye

  • Javax.ejb package

    Hi
    I am new to java, i just want to understand this, does the javax.ejb package come with J2EE jar file or must i download an SDK of some sort to have it my environment? I am currently using NetBeans 5.5 and getting package does not exist error.
    Someone please clarify
    thank you

    Actually the javax.ejb package is not present ordinary J2SE.
    It's present in the J2EE v1.4. You can download this from http://java.sun.com/j2ee/1.4/download.html.
    The javax.ejb is present in the j2ee.jar which is present in C:\Sun\AppServer\lib\j2ee.jar (installed in C: drive).
    Before compiling, classpath needs to declared either in environmental variables or in the command prompt.
    classpath: C:\Sun\AppServer\lib\j2ee.jar;C:\Sun\AppServer\bin;
    Then your javax.ejb package will be included.

  • Import EJB packages missing.

    Hi,
    running few examples I noticed that
    when generating code from EJB CMP 2.0 the
    tool doesn't include (in the import section) the EJB packages. And so the code won't compile.
    Am I missing something ?

    Giuseppe,
    I tried a few examples using the 9.0.3 Mapping Workbench, and while the import line wasn't added, all declarations of EJB classes were fully qualified, so an import shouldn't be necessary for compilation.
    Can you give any more details?

  • Problem in import ejb package in jsp

    Hi friends
    I am doing one small project with Eclipse Europa,jsp , EJB. with XDoclet, weblogic server
    I first created all my jsp files as one project.Then i created one enterprise application project with XDocklet , after that i imported all the jsp files using import option in eclipse.
    at development time i am not getting any problem.after deployment when i try to run the jsp files i am getting error of
    Compilation of 'C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java' failed:
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    probably occurred due to an error in /jspPages/testing.jsp line 8:
    <%@page import = "order.headsess.*" %>
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 21:
    HeadHome home = null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 22:
    Head remote =null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 96:
    home =HeadUtil.getHome(env);
    Full compiler error(s):
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    import order.headsess.*; //[ /jspPages/testing.jsp; Line: 8]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    symbol : class HeadHome
    location: class jsp_servlet._jsppages.__testing
    HeadHome home = null; //[ /jspPages/testing.jsp; Line: 21]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    symbol : class Head
    location: class jsp_servlet._jsppages.__testing
    Head remote =null; //[ /jspPages/testing.jsp; Line: 22]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    symbol : variable HeadUtil
    location: class jsp_servlet._jsppages.__testing
    home =HeadUtil.getHome(env); //[ /jspPages/testing.jsp; Line: 96]
    ^
    4 errors
    Fri Oct 26 01:40:14 GMT+08:00 2007

    Hi friends
    I am doing one small project with Eclipse Europa,jsp , EJB. with XDoclet, weblogic server
    I first created all my jsp files as one project.Then i created one enterprise application project with XDocklet , after that i imported all the jsp files using import option in eclipse.
    at development time i am not getting any problem.after deployment when i try to run the jsp files i am getting error of
    Compilation of 'C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java' failed:
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    probably occurred due to an error in /jspPages/testing.jsp line 8:
    <%@page import = "order.headsess.*" %>
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 21:
    HeadHome home = null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 22:
    Head remote =null;
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    probably occurred due to an error in /jspPages/testing.jsp line 96:
    home =HeadUtil.getHome(env);
    Full compiler error(s):
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:20: package order.headsess does not exist
    import order.headsess.*; //[ /jspPages/testing.jsp; Line: 8]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:51: cannot resolve symbol
    symbol : class HeadHome
    location: class jsp_servlet._jsppages.__testing
    HeadHome home = null; //[ /jspPages/testing.jsp; Line: 21]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:52: cannot resolve symbol
    symbol : class Head
    location: class jsp_servlet._jsppages.__testing
    Head remote =null; //[ /jspPages/testing.jsp; Line: 22]
    ^
    C:\bea\weblogic81\samples\domains\examples\.\examplesServer\.wlnotdelete\extract\examplesServer_loginProcess_WebContent_login\jsp_servlet\_jsppages\__testing.java:226: cannot resolve symbol
    symbol : variable HeadUtil
    location: class jsp_servlet._jsppages.__testing
    home =HeadUtil.getHome(env); //[ /jspPages/testing.jsp; Line: 96]
    ^
    4 errors
    Fri Oct 26 01:40:14 GMT+08:00 2007

  • WAR cant recognize EJB packages

    Using netBeans 5.5, I have built an Enterprise application (without an ejb module) and then attempted to add an existing ejb module to the app. I did the following to add the ejb module, but my servlets keep showing errors that the packages from the ejb module are not recognized.
    I right clicked on the main enterprise project and selected add Java EE module, then selected the ejb module I want.
    I added the ejb jar to the libraries of the Enterprise project and the WAR project
    But it still is not recognizing the packages. Is there another step I have missed?

    Never mind!

  • Weblogic 8.1 and EJB packaging with appc

    We are deploying each EJB as a seperate JAR file with individual ejb-jar and weblogic-ejb-jar.xml files. This is under Weblogic 7.1. In our build script we are using <ejbjar> with nested <weblogic> element for packaging.
    We are planning to migrate to Weblogic8.1 and it was recommended to use appc instead of ejbc. What is the best way to prepare ejb jar file using <ejbjar> task and not using <weblogic> element. How do we prepare the the individual jar files without having to have individual <ejbjar> task for each EJB?

    54275,
    any suggestions to resolve this will be greatly
    appreciatedI would like to make a suggestion: Investigate the object returned from your stored procedure via Java's reflection mechanism.
    By the way, if you're calling a stored procedure, shouldn't you be invoking the "execute()" method (of "java.sql.CallableStatement") and not the "executeUpdate()" method?
    Good Luck,
    Avi.

  • Ejb packaging configuration

    Hi, there
    I am new to ejb 3 and struts. I have a question about how to set packaging configuration.
    For example:
    If I set output source directory: /ejbtest/www/WEB-INF/classes
    jar file: /ejbtest/www/WEB-INF/classes
    war file:/ejbtest/www
    and then put them into ear file, I will get class cast error. I figured it out because war file contains class files as well as jar file.
    So if I set output source directory: /ejbtest/build/classes
    jar file: /ejbtest/build/classes
    war file: /ejbtest/www
    then it will work as war file does not contain jar file now.
    The normal structure of a web application has classes folder within WEB-INF folder, and it has all the classes files. How can package my jar and war file properly, so I won't get cast error? Any help will be appreicated.
    Cheers
    Ming

    try to do this in the class where you get class cast exp.
    private static final long serialVersionUID = 1L;and build the war/jar

  • EJB Packaging Question

    WLS 7.0 , Win2K
    I am working on an application which consists of 15 EJB's ( Stateless &
    Entity). How do i package the ejb's : package all the ejb's
    as one jar/single ejb-jar. xml or have 15 different jars with 15 different
    ejb-jar.xml files. Are there any advantages of one over the
    other.

    "Bob Lee" <[email protected]> wrote in
    news:[email protected]:
    "John" <[email protected]> wrote in message
    news:3d220288$[email protected]..
    WLS 7.0 , Win2K
    I am working on an application which consists of 15 EJB's ( Stateless
    & Entity). How do i package the ejb's : package all the ejb's
    as one jar/single ejb-jar. xml or have 15 different jars with 15
    different ejb-jar.xml files. Are there any advantages of one over the
    other.
    Flexibility (multiple jars) over ease (one jar). It really depends on
    their potential for separate reuse and interdependencies. If you will
    always deploy all of them together, you might as well just have one
    jar. Agreed. Something that might make your life easier is to use EJBGen
    (http://beust.com/cedric/ejbgen). If all your EJB's use EJBGen, it is
    trivial to re-partition them at any time:
    ejbgen ABean.java BBean.java CBean.java
    ejbgen DBean.java EBean.java
    You can also use MergeJars (java weblogic.ejb20.utils.MergeJars) to do
    the opposite: take several small jar files and merge them into a bigger
    one.
    Cedric

  • Question about javax.ejb package

    Hi,
    I am new to J2EE (Recently read a bood about it), and want to start writing some very simple session beans. However, I can't find any jar file that contains the interfaces that I have to implement (e.g. javax.ejb.EJBObject). I read somewhere that it's supposed to be in [JAVA_HOME]/lib/ext/j2ee.jar, but I can't find it.
    Also, what is a good starting container enviroment for a beginner? JBoss or Weblogic?
    Thanks in advand,
    AK

    In JBoss (at least the 3.0.4 I have installed right now), you'll find the EJB interfaces in $JBOSS_HOME/server/default/lib/jboss-j2ee.jar . Other parts of the API are in different jar files in the same directory.

  • PHP using soap to call EJB

    Hello everybody,
    I've a problem to call a EJB form a PHP script.
    There is a Apache with PHP 5.2.0 and a SAP NetWeaver Application Server 7.10 / AS Java 7.10 running on the system.
    I wanted to use soap to call a method in an EJB. It's only a test EJB:
    [code]
    package beans;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    @WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort") @Stateless public class HelloWorldEARBean {
      @WebMethod public String sayHello(String testStr){
                return "Hello Mr. "+testStr;
      @WebMethod public String getReturn(String inputStr){
                return "the return value is"+inputStr;
    [/code]
    I tried it with the PEAR SOAP in the following script:
    [code]
    <?php
    require_once 'SOAP/Client.php';
    $wsdl_url     = 'http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean?wsdl';
    $WSDL = new SOAP_WSDL($wsdl_url);
    $client = $WSDL->getProxy();
    $client->__trace(1);
    $options=array('namespace' => 'http://beans/',
      'style' => 'rpc',
      'soapaction' => 'sayHello');
    $NAME = "Bob"; 
    $parameters=array(
         'parameters', $NAME
    $result = $client->getReturn($parameters);
    echo "<pre>";
    print_r($params);
    echo "</pre>";
    echo "<h2>return</h2>";
    echo "<pre>";
    print_r($result);
    echo "</pre>";
    echo '<h2>Request</h2>';
    echo '<pre>' . htmlspecialchars($client->__getlastrequest(), ENT_QUOTES) . '</pre>';
    echo '<h2>Response</h2>';
    echo '<pre>' . htmlspecialchars($client->__getlastresponse(), ENT_QUOTES). '</pre>';
    ?>
    [/code]
    The AS distributes the following WSDL:
    [code]
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://beans/" xmlns:tns="http://beans/">
    - <wsdl:types>
    - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://beans/">
      <xs:element name="getReturn" type="tns:getReturn" />
      <xs:element name="getReturnResponse" type="tns:getReturnResponse" />
      <xs:element name="sayHello" type="tns:sayHello" />
      <xs:element name="sayHelloResponse" type="tns:sayHelloResponse" />
    - <xs:complexType name="sayHello">
    - <xs:sequence>
      <xs:element name="arg0" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="sayHelloResponse">
    - <xs:sequence>
      <xs:element name="return" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="getReturn">
    - <xs:sequence>
      <xs:element name="arg0" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="getReturnResponse">
    - <xs:sequence>
      <xs:element name="return" type="xs:string" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      </wsdl:types>
    - <wsdl:message name="sayHelloIn">
      <wsdl:part name="parameters" element="tns:sayHello" />
      </wsdl:message>
    - <wsdl:message name="sayHelloOut">
      <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse" />
      </wsdl:message>
    - <wsdl:message name="getReturnIn">
      <wsdl:part name="parameters" element="tns:getReturn" />
      </wsdl:message>
    - <wsdl:message name="getReturnOut">
      <wsdl:part name="getReturnResponse" element="tns:getReturnResponse" />
      </wsdl:message>
    - <wsdl:portType name="HelloWorldEARBean">
    - <wsdl:operation name="sayHello" parameterOrder="parameters">
      <wsdl:input message="tns:sayHelloIn" />
      <wsdl:output message="tns:sayHelloOut" />
      </wsdl:operation>
    - <wsdl:operation name="getReturn" parameterOrder="parameters">
      <wsdl:input message="tns:getReturnIn" />
      <wsdl:output message="tns:getReturnOut" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="HelloWorldEARBeanBinding" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" type="tns:HelloWorldEARBean">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="sayHello">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body parts="parameters" use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="getReturn">
      <soap:operation soapAction="" />
    - <wsdl:input>
      <soap:body parts="parameters" use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="HelloWorldEARBeanService">
    - <wsdl:port name="HelloWorldEARBeanPort" binding="tns:HelloWorldEARBeanBinding">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    [/code]
    By the following output it's obvious that the AS or the EJB (webservice) doesn't receive the parameter send by the PHP script. Look at the output:
    return value:
    the return value is null
    [code]
    Request:
    POST /HelloWorldEARBeanService/HelloWorldEARBean HTTP/1.0
    User-Agent: PEAR-SOAP 0.8.0RC4-devel
    Host: localhost
    Content-Type: text/xml; charset=UTF-8
    Content-Length: 438
    SOAPAction: ""
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    >
    <SOAP-ENV:Body>
    <getReturn xmlns="http://beans/">
    <item>parameters</item>
    <item>Bob</item></getReturn>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Response:
    HTTP/1.1 200 OK
    server: SAP NetWeaver Application Server 7.10 / AS Java 7.10
    content-type: text/xml; charset=utf-8
    date: Wed, 14 Feb 2007 15:51:53 GMT
    connection: close
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsu:Created>2007-02-14T15:51:53Z</wsu:Created>
    <wsu:Expires>2007-02-14T15:52:23Z</wsu:Expires></wsu:Timestamp></wsse:Security></SOAP-ENV:Header>
    <SOAP-ENV:Body><ns2:getReturnResponse xmlns:ns2='http://beans/'>
    <return>the return value is null</return></ns2:getReturnResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
    [/code]
    I used different soap interfaces for PHP like nusoap and the integrated soap interface of PHP 5.
    Further I experimented with different parameters inside the function call
    that results in small differencies at the xml-request.
    Thanks.

    Hi
    I've solved the problem now. I just have to add
    @SOAPBinding(style=SOAPBinding.Style.RPC)
    in the EJB, that's all.
    Here is the complete code, ... maybe some other guys have this problem too, so I will post the working code:
    At first the EJB:
    package beans;
    import javax.ejb.Stateless;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.soap.SOAPBinding;
    import beans.HelloWorldEARBean;
    @WebService(name="HelloWorldEARBean",serviceName="HelloWorldEARBeanService",targetNamespace="http://beans/",portName="HelloWorldEARBeanPort")
    @SOAPBinding(style=SOAPBinding.Style.RPC)
    @Stateless public class HelloWorldEARBean {
         @WebMethod public String sayHello(@WebParam(name="testStr") String testStr){
                return "Hello Mr. "+testStr;
    2. the local XML:
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://beans/" xmlns:tns="http://beans/">
      <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://beans/">
          <xs:element name="sayHello" type="tns:sayHello"/>
          <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
          <xs:complexType name="sayHello">
              <xs:element name="testStr" type="xs:string" minOccurs="0"/>
          </xs:complexType>
          <xs:complexType name="sayHelloResponse">
              <xs:element name="return" type="xs:string" minOccurs="0"/>
          </xs:complexType>
        </xs:schema>
      </wsdl:types>
      <wsdl:message name="sayHelloIn">
        <wsdl:part name="parameters" element="tns:sayHello"/>
      </wsdl:message>
      <wsdl:message name="sayHelloOut">
        <wsdl:part name="sayHelloResponse" element="tns:sayHelloResponse"/>
      </wsdl:message>
      <wsdl:portType name="HelloWorldEARBean">
        <wsdl:operation name="sayHello" parameterOrder="parameters">
          <wsdl:input message="tns:sayHelloIn"/>
          <wsdl:output message="tns:sayHelloOut"/>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="HelloWorldEARBeanBinding" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" type="tns:HelloWorldEARBean">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="sayHello">
          <soap:operation soapAction=""/>
          <wsdl:input>
            <soap:body parts="parameters" use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="HelloWorldEARBeanService">
        <wsdl:port name="HelloWorldEARBeanPort" binding="tns:HelloWorldEARBeanBinding">
          <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:50000/HelloWorldEARBeanService/HelloWorldEARBean"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    3. the PHP script:
    see next post
    Thank you very much for your help.

  • Ejb 3  stateless session bean eclipse glassfish runtime error

    trying to get a simple stateless session ejb 3 connected to a jsp using eclipse and glassfish. I have the two projects compiling, deploying, and in archives. but i am getting an error in my jsp which states it can't find my 'ejb' package which holds my created class files. I have looked at many examples on line and I can't find anything to point me in the right direction. please help!

    So you have 1 war file deployed and 1 ejb module deployed. Does the war file contain the interface class of the ejb? When deploying I tend to create a separate jar containing the interfaces to the ejbs that my web app will use and add it to WEB-INF/lib.
    Also post the stack trace of the Exception you are getting in case there is somthing else in it. (Just the juciy bits - I know how big Glassfish stacks can be!)
    m

  • NullPointerException when accessing EntityManagerFactory from within EJB

    Hello everyone,
    I am having trouble getting an EJB to work properly with persistence. Here is the code for my EJB:
    package HelpDesk.ejb;
    import javax.ejb.Stateless;
    import HelpDesk.entity.Tecnico;
    import javax.persistence.*;
    import javax.persistence.EntityManagerFactory;
    @Stateless
    public class HelpDeskManager implements HelpDeskManagerInterface {
       @PersistenceUnit(unitName="HelpDeskPU")
       EntityManagerFactory emf;
      public void newTecnico(String nombre, String username, String privilegio, String password)
          javax.persistence.EntityManager em = emf.createEntityManager();
          Tecnico tec = new HelpDesk.entity.Tecnico(nombre, username, privilegio, password);
          em.persist(tec);     
    }The error happens on the line: javax.persistence.EntityManager em = emf.createEntityManager();
    This method is then called from a servlet which has the following code on its doGet() method:
          response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                HelpDesk.ejb.HelpDeskManager hdm = new HelpDesk.ejb.HelpDeskManager();
                hdm.newTecnico(request.getParameter("nombre"), request.getParameter("username"), request.getParameter("privilegio"), request.getParameter("password"));
                out.println("Técnico creado exitosamente.");
                response.sendRedirect("index.jsp");
            catch(Exception ex){out.println(ex.getMessage());}
            finally {
                out.close();
            }Using this try statement simply causes the word "null" to be output to the browser. Without the try statement, I get the NullPointerException on the app server logs. I am using Netbeans 6.5/ Glassfish v2. I can guarantee that the Persistence Unit is correctly configured and that a connection pool has been defined in Glasfish for this database, as well as a JNDI name for it, though I do not know if it's necessary to register the EJB as a JNDI name as well.
    Any advice will be truly appreciated, as I am rather new to EJB technology. Thank you.

    Hello again, thanks for your quick reply,
    I tried it out the way you suggested, but I now get the following error displayed on my browser:
    type Exception report
    message
    descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: PWC1391: Servlet.init() for servlet newTecnico threw exception
    root cause
    java.lang.RuntimeException: WEB5002: Exception in handleBeforeEvent.
    root cause
    com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref help_desk.servlet.newTecnico/hdm@jndi: HelpDesk.ejb.HelpDeskManager@[email protected]@Session@null into class help_desk.servlet.newTecnico
    root cause
    javax.naming.NameNotFoundException: HelpDesk.ejb.HelpDeskManager#HelpDesk.ejb.HelpDeskManager not foundI believe it is because I need to define the EJB as a JNDI resource. However, I am unsure how to go about this. When I try to do create a new JNDI resource via the Glassfish Admin Console, it asks for several fields, including Resource Type and Resource Factory. I think Resource Type can be the fully qualified class name, but my EJB doesn't have any factory classes associated with it.
    Thanks again for the information. your help is greatly appreciated!

  • How to create an EJB Application in Eclipse 3.2

    hi all,
    any one suggest me, what are the external jars need to be include in eclipse to cretae the ejb applications.
    Thanx in advance.
    Bala

    The javaee.jar from the Java EE SDK should be sufficient. Just add this jar to the installed JRE (Window - Preferences - Java - Installed JREs - Edit). You need at least the javax.ejb package.
    There is a dedicated subforum for EJB stuff by the way http://forum.java.sun.com/forum.jspa?forumID=13

  • Throw Error in Module Adapter EJB

    Hi experts,
    In order to make some validations when getting file in File Adapter, was developed a EJB Module Adapter. When the validation failed, it must to be generate a throw error with a text that appears in Runtime workbench.
    throw new ModuleException("Error al crear objeto Archivo para procesar el legacy: "+legacy);
    But, it doens't happen. In Runtime workbench I just can see a Exception null . 
    Follow Below the Java Code of Module EJB:
    package clasesSox;
    import java.io.IOException;
    import java.io.InputStream;
    import java.math.BigDecimal;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.Map;
    import java.util.StringTokenizer;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import com.sap.aii.af.mp.module.ModuleException;
    @author martin.j.rodriguez
    public class Archivo extends XMLParser {
         private Log log = LogFactory.getLog(Archivo.class);
         private Config config;
        private String nombre, tipoSistema, pais;
        private Date fecha;
        //private boolean procesado;
         //private org.xml.sax.XMLReader xr;
         private double totimp, importeParcial;
        private String buscaTOTIMP, regImporte, buscaTOTLIN;
        private String [] tags;
        private InputStream inputStream;
        private int totlin, regCuenta;
        public Archivo(InputStream is, String legacy) throws ModuleException {
             super();
             Map properties = getConfig().getConfig(legacy);
              if (properties == null) {
                   if (log.isErrorEnabled()){
                        log.error("Error al crear objeto Archivo para procesar el legacy: "legacy" - No se encontro la configuración.");
                   throw new ModuleException("Error al crear objeto Archivo para procesar el legacy: "+legacy);
              this.buscaTOTIMP = (String)properties.get(Config.CAMPO_IMPORTE_TOTAL);
              this.regImporte =  (String)properties.get(Config.CAMPO_IMPORTE);
              this.buscaTOTLIN = (String)properties.get(Config.CAMPO_LINEAS_TOTAL);
              String tagstosearch = (String)properties.get(Config.CAMPO_LINEAS_CONTAR);
              StringTokenizer st = new StringTokenizer(tagstosearch, ",");
              tags = new String[st.countTokens()];
              int i=0;
              while(st.hasMoreTokens()){
                   String token = st.nextToken();
                   tags[i++] = token.trim();
              setInputStream(is);
        public List validaArchivo() throws ParserConfigurationException, SAXException, IOException {
              regCuenta = 0;
             importeParcial = 0;
              DefaultHandler handler = this;
              SAXParserFactory factory = SAXParserFactory.newInstance();
              SAXParser saxParser = factory.newSAXParser();
              saxParser.parse(inputStream, handler);
              String s = "";
              roundValues();
              String stotimp = new BigDecimal(totimp).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
              String simporteParcial = new BigDecimal(importeParcial).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
              if (log.isDebugEnabled()){
                   log.debug("Resultados: TOTIMP: "stotimp" - CONTEO: "+simporteParcial);
                   log.debug("Resultados: TOTLIN: "totlin" - CONTEO: "+regCuenta);
              List results = new ArrayList();
              if (totimp != importeParcial) {
                   s = "Error al contar el total del importe, deberia ser: "stotimp" y el calculado es: "+simporteParcial;
                   if (log.isDebugEnabled()){
                        log.debug(s);
                   results.add(s);
              if (totlin != regCuenta) {
                   s = "Error al contar el total del lineas, deberia ser: "totlin" y el calculado es: "+regCuenta;
                   if (log.isDebugEnabled()){
                        log.debug(s);
                   results.add(s);
              return results;
         private void roundValues() {
              totimp = roundValue(totimp);
              importeParcial = roundValue(importeParcial);
    redondea un numero a 2 decimales
         private double roundValue(double d) {
              BigDecimal bd = new BigDecimal(d);
              bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
              return bd.doubleValue();
         public void startElement(String namespaceURI, String lName, String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException {
              String etiqueta = getTagName(qName, lName);
              //niveles.add(etiqueta);
              // Cuenta registros
              for (int i = 0;i< tags.length; i++){
                   if (etiqueta.equals(tags+)){
                        regCuenta++;
                        break;
         public void endElement(String namespaceURI, String lName, String qName)     throws org.xml.sax.SAXException     {
              String etiqueta = getTagName(qName, lName);
              //niveles.remove(niveles.size() - 1);
              // set valor totlin
              if (buscaTOTLIN.equals(etiqueta)){
                   totlin = parseInt(valor);
              // set valor totimp
              if (buscaTOTIMP.equals(etiqueta)){
                   totimp = parseDouble(valor);
              // suma importe parcial
              if (regImporte.equals(etiqueta)){
                   importeParcial += parseDouble(valor);
        public InputStream getInputStream() {
            return inputStream;
        public void setInputStream(InputStream texto) {
            this.inputStream = texto;
        public String getNombre() {
            return nombre;
        public void setNombre(String nombre) {
            this.nombre = nombre;
        public String getTipoSistema() {
            return tipoSistema;
        public void setTipoSistema(String tipoSistema) {
            this.tipoSistema = tipoSistema;
        public String getPais() {
            return pais;
        public void setPais(String pais) {
            this.pais = pais;
        public java.util.Date getFecha() {
            return fecha;
        public void setFecha(java.util.Date fecha) {
            this.fecha = fecha;
         public static void main(String args[]) {
                   String fileName = "FI_MAS_SAP_RENBAN_####_AAAAMMDD_HHMMSS.TXT";
                   java.util.StringTokenizer st = new java.util.StringTokenizer(fileName, "_");
                   for (int i = 0; i < 5; i++)
                        st.nextToken();
                   String anioMes = st.nextToken();
                   if (anioMes != null)
                        if (anioMes.length() > 5) {
                             System.out.println(anioMes);
                             System.out.println(anioMes.substring(0, 4) + " " + anioMes.substring(4, 6));
         private double parseDouble(String number){
              if (number == null || number.trim().length()==0 || number.trim().equals("/"))
                   return 0;
              // remuevo los 0 a la izquierda que afectan al parseint
              number = number.trim().replaceAll("^0+","");
              number = number.replaceAll(",",".");
              double result = 0;
              try {
                   result = Double.parseDouble(number);
              catch (NumberFormatException nfe){
                   System.err.println("Error parseando numero "+number);
              return result;
         private int parseInt(String number){
              if (number == null || number.trim().length()==0 || number.trim().equals("/"))
                   return 0;
              // remuevo los 0 a la izquierda que afectan al parseint
              number = number.trim().replaceAll("^0+","");
              number = number.replaceAll(",",".");
              int result = 0;
              try {
                   result = Integer.parseInt(number);
              catch (NumberFormatException nfe){
                   System.err.println("Error parseando numero "+number);
              return result;
    Carga la configuracion
    @return
         protected Config getConfig(){
              if (config == null){
                   ConfigParser cp = new ConfigParser();
                   config = cp.readConfig();
              return config;
    Could anyone help me about this problem ?
    Thanks in advance.+

    Hi,
    do u think, u will get the error text in the RWB ? I don't think so, it will provide the output in the RWB.
    The output of the Adapter module is nothing but XI -XML message. So this will not come
    check it out for the how to work on Adapter Modules-
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    Hope this helps,
    Regards,
    Moorthy

Maybe you are looking for

  • Manual Transport and Maintain in Client Entries in Table

    Hello, I am trying to figure out how I can maintain table entries in client and have the option to manually transport entries from our development system.  Can this be done?  If so, what settings are required. Regards, Dean.

  • Nmh 410 problem after problem

    after the latest firmware update, my nmh 410 was un-usable so i reset back to original firmware.  all was good for a couple of days and then the media hub became un-usable again.  could not access the configuration page, it would tell me that the pas

  • CC for Teams, not listing all Creative Cloud Applications

    So here is my problem Our company has just upgraded to Creative Cloud for Teams, but when I went to install the software on everyone's machines, I noticed that we were missing certain CC apps. I also have a Standard CC license for my personal use to

  • EDI-How does the Inbound File process work?

    Hi How does the Inbound process work in EDI When a file is put in the Inbound EDI directory of the App server how does the system start the process? Which programs are called/triggered? How does the Inbound process work? Please be brief and precise.

  • PSD to Jpeg

    I had a saved PSD file and I opened it to edit it. I flattened it and hit save by mistake. How can I go back to PSD if all the "step back" is not going all the way back to PSD? Thanks