EJB environment question (static helper classes)

We're using JBoss as AS containing several stateless session beans.
Now, we have certain helper classes that are abstract and contain static methods. Is this a problem for the EJBs? All of them use these helper classes all over their methods. Are they sharing the static class and will slow down somehow? Or is each EJB using its version of the class and can run concurrently?
Should we rethink this and put an INSTANCE of each helper class in each ejb instead of using static methods in the helper class?
Now in EJB method:
Helper.calculateStuff();
Should it be?
Helper h = new Helper(); // defined when ejb is created
helper.calculateStuff();
Edited by: JAeon on Sep 8, 2008 12:21 AM
Edited by: JAeon on Sep 8, 2008 12:22 AM

>
The helper methods do database querries etc and return results that the EJB sends onwards to clients. If these methods
are NOT synchronized (and the ejbs share the static class) won't it cause concurrency errors? I think most of our methods are not
synchronized (and it doesn't seem to cause any concurrency errors so far... though the system have not beeen stressed test that much,
and concurrency bugs tends to pop up later and randomly :P).
>
No, if you dont have any static data variables in the Java classes, static method as such will not cause concurrency errors, and the methods should not be synchronized.
If you have any synchronized methods and they take a while to execute, that could become a bottleneck in itself, because different threads waiting for each other,
so make sure you dont have any synchronized methods where it is not explicitly needed.
Think of a static method (without static data in the class being manipulated) as a plain function in another programming-language.
>
We have some scaleability problems with the EJBs... It seems as if they do not run concurrently. If we do a stress test with several threads calling the EJBs their response time increases by a too large factor to feel comfortable...
>
Apparently, you do have a some scaling/concurrency problem, which could have many causes -- transaction locking and clashes in the database, poorly configured database, network congestion, problems in the EJB architecture, etc -- can be many reasons...
The general idea to debug, is first to find out exactly what calls in your code that take longest time to execute (profiling, logging, System.out.println's are useful) when you put parallel load on your system -- rather than just seeing "the whole application seems slow" -- from there you can move on, "divide&conquer" the problem, etc...

Similar Messages

  • Obtaining principal in EJB helper classes

    I have a pretty typical EJB setup where the actual EJBs delegate a lot of work
    off to helper classes which are simple java classes. Some of these helpers need
    access to the principal currently executing on this container thread. Currently,
    I am passing the principal as a parameter in every method signature on the helpers
    which need it. But as you can probably guess that approach is quickly becoming
    unweildy.
    Ideally, what I would like to do is to have access to the principal associated
    with the currently executing thread. I can mimic this by setting thread-local
    variables in the EJB prior to calling helpers. But I was wondering (ok, hoping)
    that there was already a way to access this information (either through weblogic
    classes or MBeans). At this point, I dont even care if it is not portable.
    P.S., I use WL6.1
    Thank you in advance,
    Steve

    >
    The helper methods do database querries etc and return results that the EJB sends onwards to clients. If these methods
    are NOT synchronized (and the ejbs share the static class) won't it cause concurrency errors? I think most of our methods are not
    synchronized (and it doesn't seem to cause any concurrency errors so far... though the system have not beeen stressed test that much,
    and concurrency bugs tends to pop up later and randomly :P).
    >
    No, if you dont have any static data variables in the Java classes, static method as such will not cause concurrency errors, and the methods should not be synchronized.
    If you have any synchronized methods and they take a while to execute, that could become a bottleneck in itself, because different threads waiting for each other,
    so make sure you dont have any synchronized methods where it is not explicitly needed.
    Think of a static method (without static data in the class being manipulated) as a plain function in another programming-language.
    >
    We have some scaleability problems with the EJBs... It seems as if they do not run concurrently. If we do a stress test with several threads calling the EJBs their response time increases by a too large factor to feel comfortable...
    >
    Apparently, you do have a some scaling/concurrency problem, which could have many causes -- transaction locking and clashes in the database, poorly configured database, network congestion, problems in the EJB architecture, etc -- can be many reasons...
    The general idea to debug, is first to find out exactly what calls in your code that take longest time to execute (profiling, logging, System.out.println's are useful) when you put parallel load on your system -- rather than just seeing "the whole application seems slow" -- from there you can move on, "divide&conquer" the problem, etc...

  • Reference EJB from servlet's action/helper classes

    Hello
    How to make a reference to stateless session bean from one of the helper classes of a servlet WITHOUT using any of these:
    * dependency injection (like @EJB) - I think this is not supported in this kind of class, EJB references can be injected only to servlets themselves or some other things (but not objects of classes "accompanying" a servlet)
    * home or local home interfaces (I would like to avoid writing them)
    * using mappedName (either in @Stateless or in ejb-jar) - since meaning of this is application-server dependent and thus not portable.
    By a "class accompanying a servlet" / "helper class" I mean utility or action classes, like MyActionClass, which would be instantiated and then used by a aforementioned servlet.
    Thanks.

    The EJB dependency must be looked up via the java:comp/env namespace since as you point out
    Java EE 5 environment annotations are not supported on POJOs. However, the dependency itself
    can either be defined using @EJB on some other managed class in the .war or within the
    web.xml. We have an entry in our EJB FAQ that has the details :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#POJOLocalEJB
    Also, whenever the client component resides in the same application as the target EJB (which is
    required for Local access but not for Remote access) there is no need to use mappedName to
    resolve the EJB dependency. It is either automatically resolved if the business interface type of
    the EJB dependency is only exposed by a single EJB in the application, OR the beanName()
    / ejb-link attributes can be used to unambiguously identify the target EJB using ejb-name.
    You can find more about this in the FAQ as well.

  • Question about inner class - help please

    hi all
    i have a question about the inner class. i need to create some kind of object inside a process class. the reason for the creation of object is because i need to get some values from database and store them in an array:
    name, value, indexNum, flag
    i need to create an array of objects to hold those values and do some process in the process class. the object is only for the process class that contains it. i am not really certain how to create this inner class. i tried it with the following:
    public class process{
    class MyObject{}
    List l = new ArrayList();
    l.add(new MyObject(....));
    or should i create the object as static? what is the benifit of creating this way or static way? thanks for you help.

    for this case, i do need to create a new instance of
    this MyObject each time the process is running with a
    new message - xml. but i will be dealing with the case
    where i will need a static object to hold some
    property values for all the instances. so i suppose i
    will be using static inner class for that case.The two situations are not the same. You know the difference between instance variables and static variables, of course (although you make the usual sloppy error and call them static objects). But the meaning of "static" in the definition of an inner class is this: if you don't declare an inner class static, then an instance of that inner class must belong to an instance of its containing class. If you do declare the inner class static, then an instance of the inner class can exist on its own without any corresponding instance of the containing class. Obviously this has nothing to do with the meaning of "static" with respect to variables.

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

  • Add helper class public parts as used DC in EJB DC

    Hi Experts,
    I have created a JAVA DC project containing the helper classes.
    For this helper classes i have created a Jar file.
    I have also created two public parts
    1) with an option Can be packaged into other build results (e.g. SDAs)
    2) with an option Provides an API for developing/compiling other DCs
    Now i want to use these public parts in my EJB DC.
    I have added the API public part in my EJB DC as build time design time and run time.
    Now when i am getting java.lang.NoClassDefFoundError: for the class defined in JAVA DC helper class.
    Can you help me in resolving this?
    Regards,
    Ashish Shah

    Hi
    I have done following things:
    1) I have a java DC containing helper classes and an EJB DC referring to it.
    2) Now to access this EJB DC, I have created a java command bean DC.
    3) And I am using this command bean Java dc in my WebDynpro application.
    4)  Now for deploying the helper class, I have created a library project.
    5)  To this library project I have added the SDA and API public part of helper class as used dc.
    6)  I have added this java library file as used DC in WebDynpro DC and in EJB DC.
    7)  I have added the library reference to the WebDynpro DC for J2ee server component library DC  As pg.comaptsc~dc_aptjl
    8)  When i checked in Visual admin i could see the Assembly (SDA) helper class jar file.
    In my helper class files, I am getting this warning.
    Checking package reservation
    Warning: Package pg.com.apt.help.cls is not reserved for DC : apt/sc/dc_apthc.
    Now in my webdynpro DC when I refer to the helper class through the EJB, I get this error.
    java.lang.NoClassDefFoundError: pg/com/apt/help/cls/TargetMarket at pg.com.atos.WebModuleProject.FetchSDCDataBean.SearchGTINTMDataEJB(FetchSDCDataBean.java:133) at pg.com.atos.WebModuleProject.FetchSDCDataObjectImpl0.SearchGTINTMDataEJB(FetchSDCDataObjectImpl0.java:119) ... 35 more ; nested exception is: java.lang.NoClassDefFoundError: pg/com/apt/help/cls/TargetMarket
    Can you please guide on what I am missing.
    Thanks in advance.
    Regards,
    Ashish Shah
    Edited by: ashish shah on Dec 18, 2007 3:23 PM

  • EJB and helper classes ...

    I have created an EJB component which uses
    some helper classes in JDeveloper 3.0 .
    The component deploys sucessfully to OAS 4.0.8.1 . When I try to run the component through an applet ( including the _client.jar
    in the archive tag) , the applet does not find the helper classes . How I do i include the helper classes in the _client.jar file ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    Try to put all the EJB's in a single package and import the package. I
    can think of this solution right now, will keep posting for updates.
    Regards
    Raj
    Daniel Westerdale wrote:
    Hi,
    I have a number of EJBs that each use a common set interfaces,
    exceptions and Value beans. If I deploy using the iasdeploy command
    line, then I must package up all these common classes within each of
    the EJB modules - leading to a lot of duplicate code.
    Is there a smarter a way of packaged the common classes so that I can
    include them in the .EAR file but only in one module.
    Note: I would prefer to only argument the IAS classpath with 3rd party
    classes that rarely change and not these common classes e.g. Jlog
    cheers
    Daniel
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • EJB fails to compile - static inner class problem

    I am using OC4J 9.0.4 and Sun JDK1.4.2 and EJBs fail to compile if they reference objects that contain static inner classes. However, they successfully compile under JDK1.4.1.
    For example, I have a class like below:
    public class ValueObject
    public static class Key
    private Key key;
    private String value;
    Any references to ValueObject.Key inside the EJB cause the EJB compiler to generate "ValueObject$Key" which is incorrect. JDK1.4.1 is more lenient than 1.4.2, and allows this error through.
    Is there a way around this problem other than reverting to JDK1.4.1?
    Regards,
    Andy

    The reason I don't want to move to JDK 1.4.1 is because of the memory leak in the StringBuffer.toString() method.
    Is there anywhere I can submit this as a bug?
    Regards,
    Andy

  • A question about non-static inner class...

    hello everybody. i have a question about the non-static inner class. following is a block of codes:
    i can declare and have a handle of a non-static inner class, like this : Inner0.HaveValue hv = inn.getHandle( 100 );
    but why cannot i create an object of that non-static inner class by calling its constructor? like this : Inner0.HaveValue hv = Inner0.HaveValue( 100 );
    is it true that "you can never CREATE an object of a non-static inner class( an object of Inner0.HaveValue ) without an object of the outer class( an object of Inner0 )"??
    does the object "hv" in this program belong to the object of its outer class( that is : "inn" )? if "inn" is destroyed by the gc, can "hv" continue to exist?
    thanks a lot. I am a foreigner and my english is not very pure. I hope that i have expressed my idea clearly.
    // -------------- the codes -------------------
    import java.util.*;
    public class Inner0 {
    // definition of an inner class HaveValue...
    private class HaveValue {
    private int itsVal;
    public int getValue() {
    return itsVal;
    public HaveValue( int i ) {
    itsVal = i;
    // create an object of the inner class by calling this function ...
    public HaveValue getHandle( int i ) {
    return new HaveValue( i );
    public static void main( String[] args ) {
    Inner0 inn = new Inner0();
    Inner0.HaveValue hv = inn.getHandle( 100 );
    System.out.println( "i can create an inner class object." );
    System.out.println( "i can also get its value : " + hv.getValue() );
    return;
    // -------------- end of the codes --------------

    when you want to create an object of a non-static inner class, you have to have a reference of the enclosing class.
    You can create an instance of the inner class as:
    outer.inner oi = new outer().new inner();

  • Weblogic 10.3.2 EJB3 Local Interface in POJO/Helper classes

    Hi,
    I have a jar file containing all EJB's in application & some Helper classes. I want to access Local interfaces of EJBs in those helper classes. Is there any way I can do it? I've gone through Maxence Button & Jay SenSharma 's blogs about accessing Local interface. but it doesn't help. May be these two guys can help me more here.. My requirement is very simple. Just to access local interface in POJO/Helper classes that are in same JAR file as EJB's. I can't get reference with @EJB class level annotation as Helper classes are called independently from MBean services.. not from any EJB or Servlert.
    Please if anyone can tell me how do I get reference of local interfaces, that would be really good.
    my environment is
    Weblogic 10.3.2
    EJB3
    Regards,
    Prasad

    Hi,
    Just check ...If you want something like mentioned in the below Link with a complete Example:
    [http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/|http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/]
    Regards
    Jay SenSharma

  • Static inner class causes deployment  on OC4J 10.1.2 to fail

    Hi,
    this issue has already been raised on OC4J 9.0.4 with J2SDK 1.4.2 (see EJB fails to compile - static inner class problem
    Recap: When referencing static inner classes in an EJB, the deployment fails. During the generation of the wrapper classes, a signature <package>.<outer class>.<inner class> gets converted to <package>.<outer class>$<inner class>, which is syntactically wrong. While the Java 1.4.1 compiler kindly ignores this syntax error, its 1.4.2 counterpart complains - and fails.
    @Oracle: When will this bug be fixed for OC4J 10.1.2?
    Best regards,
    Holger

    Holger,
    Don't static inner classes contradict the EJB specification?
    In any case, in answer to Andy's question: If you wish to file this as a bug, you can do so via the MetaLink Web site.
    [In fact, [i]MetaLink is your only option for submitting bugs for Oracle products -- as far as I know.]
    Good Luck,
    Avi.

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • [EJB:015001]Unable to link class while server start up.

    I am getting the below exception during weblogic server start up.
    In the server under autodeploy folder there exist a class - AccountCacheLoaderMDB. I clue less, what is the cause for this exception. Can anyone help me out in solving this issue please,its urgent
    <Jun 2, 2011 10:23:01 AM EDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'gts' due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(autodeploy)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    Error processing annotations: ..
    weblogic.application.ModuleException: Exception preparing module: EJBModule(autodeploy)
    [EJB:011023]An error occurred while reading the deployment descriptor. The error was:
    Error processing annotations: .
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         Truncated. see log file for complete stacktrace
    weblogic.utils.ErrorCollectionException:
    There are 1 nested errors:
    weblogic.j2ee.dd.xml.AnnotationProcessException: [EJB:015001]Unable to link class sepact.sepact-app.com.citi.gts.alto.accountservice.service.AccountCacheLoaderMDB in Jar C:\Oracle\user_projects\domains\base_domain\autodeploy : java.lang.NoClassDefFoundError: sepact/sepact-app/com/citi/gts/alto/accountservice/service/AccountCacheLoaderMDB (wrong name: com/citi/gts/alto/accountservice/service/AccountCacheLoaderMDB)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addProcessingError(BaseJ2eeAnnotationProcessor.java:1272)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addFatalProcessingError(BaseJ2eeAnnotationProcessor.java:1277)
         at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processAnnotations(EjbAnnotationProcessor.java:168)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processStandardAnnotations(EjbDescriptorReaderImpl.java:332)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
         at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
         at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1210)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:382)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:609)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:185)
         at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:40)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
         at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
         at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:187)
         at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
         at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
         at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
         at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
         at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
         at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addProcessingError(BaseJ2eeAnnotationProcessor.java:1271)
         at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.addFatalProcessingError(BaseJ2eeAnnotationProcessor.java:1277)
         at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processAnnotations(EjbAnnotationProcessor.java:168)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processStandardAnnotations(EjbDescriptorReaderImpl.java:332)
         at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
         Truncated. see log file for complete stacktrace
    >
    ===============================================================
    Here is the message driven bean.
    package com.xxx.gts.alto.accountservice.service;
    import com.xxx.gts.alto.accountservice.adapter.AccountAdapter;
    import com.xxx.gts.alto.accountservice.util.AccBeanUtil;
    import com.xxx.gts.alto.accountservice.util.AccountConstants;
    import com.xxx.gts.alto.accountservice.util.AccountLoader;
    import org.apache.log4j.Logger;
    import org.springframework.beans.factory.BeanFactory;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.EJB;
    import javax.ejb.MessageDriven;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    import javax.ejb.TransactionManagement;
    import javax.ejb.TransactionManagementType;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import javax.jms.TextMessage;
    * MDB for the Account Cache Loader.
    @MessageDriven(mappedName = "AccountCacheLoaderQueue", activationConfig = {@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),@ActivationConfigProperty(propertyName = "destinationName", propertyValue = "AccountCacheLoaderQueue")})
    @TransactionManagement(value = TransactionManagementType.CONTAINER)
    @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
    public class AccountCacheLoaderMDB implements MessageListener {
    private static Logger logger = Logger.getLogger(AccountCacheLoaderMDB.class.getName());
    private static final String LOCAL_ADAPATER = AccBeanUtil.getProperty(AccountConstants.ADAPTER_ID);
    private static final String TOKEN_SEPARATOR = ","; // \\s
    @EJB
    private BeanFactory beanFactory;
    public void onMessage(Message message) {
    logger.debug("Entering onMessage of AccountCacheLoaderMDB");
    try {
    if (message instanceof TextMessage) {
    TextMessage tmsg = (TextMessage) message;
    String[] msgArr = tmsg.getText().split(TOKEN_SEPARATOR);
    logger.debug("Trying to get AccountAdapter");
    AccountAdapter acctAdapter = (AccountAdapter) beanFactory.getBean(LOCAL_ADAPATER);
    if (acctAdapter == null) {
    throw new RuntimeException("Account Adapter cannot be determined.");
    for (String msg : msgArr) {
    if (msg.equalsIgnoreCase(AccountConstants.ACC_RELOAD)) {
    logger.debug("Calling AccountLoader.load");
    AccountLoader.load(acctAdapter);
    } else if (msg.equalsIgnoreCase(AccountConstants.BIC_RELOAD)) {
    logger.debug("Calling AccountLoader.loadBicData");
    AccountLoader.loadBicData(acctAdapter);
    } catch (Exception e) {
    logger.error("Error while loading Account.", e);
    throw new RuntimeException(e);
    logger.debug("Exiting onMessage of AccountCacheLoaderMDB");
    can any one throw some light please...its urgent

    Your class seems to be in the wrong folder structure.
    instead of sepact/sepact-app/com/citi/gts/alto/accountservice/service/ it needs to be in com/citi/gts/alto/accountservice/service/ which matches the folder structure.

  • Helper class behaviour

    If I deploy a stateless session bean with an associated class that has a static factory method, with lazy initialization of a static field, will I get back the same object from the factory all the time, even if the container creates and destroys the session bean instance at will?
    As far as I understand, the JVM of the container keeps static data for all classes that have been loaded. And different classloaders can have their own classes of the same type.
    Is this correct? In JBoss?

    Thanks for your reply
    I was reading answers given by
    Converting NSString to Currency - The Complete Story - Stack Overflow.htm
    By
    Noah Hendrix
    http://stackoverflow.com/users/237193/noah-hendrix
    I have found a solution, and as per the purpose of this question I am going to provide a complete answer for those who have this problem in the future. First I created a new *Helper Class* called NumberFormatting and created two methods.

  • How to create EJB client without WL specific classes ?

    Hi,
    I have stateful session EJB running in WebLogic 5.1.
    Is it necessary to client that will access that EJB to have WebLogic classes in classpath ?
    Is it possible to write client that doesn't have any classes specific to Weblogic ?
    Uix

    Sure, if it's acceptable for your application to classload from WebLogic.
    For example: helper class to start WebLogic client (server is running on
    localhost:7001 and client classes are in c:/weblogic/myserver/clientclasses/):
    c:\WebLogicClient>set CLASSPATH=.
    c:\WebLogicClient>java WebLogicClient examples.ejb.basic.statelessSession.Client
    import java.net.*;
    import java.lang.reflect.*;
    public class WebLogicClient {
    /* client classpath. Should NOT be in the java classpath! */
    public static final String CLIENT_CLASSES =
         "file://C:/weblogic/myserver/clientclasses/";
    /* WebLogic server to classload from */
    public static final String WL_CLASSES =
         "http://localhost:7001/classes/";
    public static void main(String[] args) {
    try {
    ClassLoader cl = new URLClassLoader(new URL[] {
    new URL(CLIENT_CLASSES),
    new URL(WL_CLASSES)
    Thread.currentThread().setContextClassLoader(cl);
    Class clientClass = cl.loadClass(args[0]);
    Method methodMain = clientClass.getMethod("main",
              new Class[] {Class.forName("[Ljava.lang.String;")});
    String[] clientArgs = new String[args.length - 1];
    System.arraycopy(args, 1, clientArgs, 0, clientArgs.length);
    methodMain.invoke(null, new Object[] {clientArgs});
    } catch(Throwable oops) {
    oops.printStackTrace();
    uix <[email protected]> wrote:
    Hi,
    I have stateful session EJB running in WebLogic 5.1.
    Is it necessary to client that will access that EJB to have WebLogic classes in classpath ?
    Is it possible to write client that doesn't have any classes specific to Weblogic ?
    Uix--
    Dimitri

Maybe you are looking for

  • When I open a PDF file and I try to Save As to my shared drive I can't select it from the dropdown

    When I open a PDF file and I try to Save As to my shared drive I can't select it from the dropdown menu. (See screenshot). When I select on the left side "Computer", then my shared drive is available. (See screenshot).

  • Need help with Rollover Image cross browser problem

    Hello, I am having a cross browser problem with my websites rollover nav links.  The trouble is, while they work perfectly fine in IE8 and IE9, I've also attempted to use them through Opera, and they simply don't work.  They don't link nor do they do

  • Q?... i deleted the most recent firmware update, and now this...

    the streaming feature of my quicktime program is non-functional, all i get is the Q? icon. it seamed to correlate to my trashing the newest firmware update. any tips on how i can fix the Q?... ? MacBook 13.3 Black   Mac OS X (10.4.9)  

  • CSS problem with IE

    Hi I have created a style sheet and linked it to a template to form the basis of a website. I have included a background image in the masthead. It works fine in Firefox, but when I review the template or any pages made from the template in Internet E

  • Bank g/l accounts

    Dear All, What is the Purpose of having three G/l accounts for Bank Reconcliation, ie Receipt, Payment & Recon a/c. What exactly is the logic behind that.  kindly please guide me. reagrds ram