Very simple EJB 3.0 MDB but I get NullPointerException

I tried to create a very simple EJB 3.0 Message Driven Bean in JDeveloper 10.1.3.2 as follows:
Message Driven Bean Class:
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;
@MessageDriven(mappedName="MDBQueue")
public class MDB implements MessageListener {
public void onMessage(Message message) {
System.out.println("Got message!");
Application Client:
import javax.annotation.Resource;
import javax.jms.*;
public class MDBAppClient {
@Resource(mappedName="MDBQueueConnectionFactory")
private static QueueConnectionFactory queueCF;
@Resource(mappedName="MDBQueue")
private static Queue mdbQueue;
public static void main(String args[]) {
try {
QueueConnection queueCon = queueCF.createQueueConnection();
QueueSession queueSession = queueCon.createQueueSession
(false, Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender = queueSession.createSender(null);
TextMessage msg = queueSession.createTextMessage("hello");
queueSender.send(mdbQueue, msg);
System.out.println("Sent message to MDB");
queueCon.close();
} catch(Exception e) {
e.printStackTrace();
But I get the following error:
java.lang.NullPointerException
     at model.MDBAppClient.main(MDBAppClient.java:17)
I read similar problem in the this thread:
Re: message driven bean on ejb 3.0 does not work
some one said that the version in ejb-jar.xml must be changed from 2.1 to 3.0
but in this case there is no ejb-jar.xml.
( I have other cases with ejb-jar.xml file but I can't change the version in ejb-jar.xml)
the version in web.xml is 2.4 but it not accept any value except 2.4 and an error occur when I tried to change it to 3.0
please can you tell me why I get NullPointerException and how can I allow EJB 3.0 MDB and JMS to work in JDeveloper

Note that you can't run MDBs in the embedded OC4J in JDeveloper - try deploying to a stand-alone install of OC4J and see if it works there.

Similar Messages

  • Hello, i'm creating a very simple animation in ps cs5, but when I try to transform a smart object in a frame, all the frames are affected by it. What can I do ? Thanks, Ep

    Hello, i'm creating a very simple animation in ps cs5, but when I try to transform a smart object in a frame, all the frames are affected by it. What can I do ? Thanks, Ep

    Ok, you are in frame animation mode. I thought cs5 had a timeline mode, but now I think I was wrong.
    In frame animation mode what you do is in one frame you have the object rotated in one position, then select an other frame and rotate it. If it rotates the first frame, which I think it will. Create duplicate of the object in a new layer. Then rotate the second layer.
    At this point in my example you would have two layers, one of which has a rotated object.
    Clear the frames
    Convert the two layers to frames.
    You now have two frames, one for each layer.
    Select both frames then click the tween button.
    This will create the in between frames.
    In the tween dialog box the higher the number of frames set here, will create a smoother animation but will result in a longer time frame for the animation to play.
    Because Photoshop has no way of knowing which way the object should rotate, it is feasible for it to rotate the opposite direction or could look wonky. Just undo and add an in between layer showing how it should look in the middle, then continue on.
    So your layers should be the following, a frame that shows all objects in their rest state.
    All objects that remain in a rest state must be copied to the next layer (ctrl-j on Windows or cmd-j on Mac)
    All subsequent layers are then used for rotating a duplicate of the object. (Ctrl j or cmd j)
    You will find the commands to clear the frames, convert layers to frames and tweeting in the hidden menu found when you click the small icon in the upper right hand corner of the animation panel.

  • Very simple Q !! but not for me..

    hello,
    i know its a very simple Q for some people but i m not getting any solution to it...
    the prob is that when i call ActionEvent by pressing two or more buttons the button that has produced the event is checked by using getActionCommand() but how can i check for two or more TextFields or TextAreas calling same ActionListener there is no getActionCommand() for TF n TA... i tried giving names to these components by using setName() n checking the components name in actionPerformed() but thats not working...
    plz help me out... atleast this wud clear my basics....

    Perhaps your use of setName() was not correct - it seems like it should work.
    Another alternative is to provide the ability for your ActionListener to compare the object that is the source of the event to the TextFields.
    Or, use a separate ActionListener.

  • Very simple, but not working Table to Flat File

    I'm new to ODI, but I am having too much difficulty in performing a very basic task. I have data in a table and I want to load the data to a flat file. I've been all over this board, all over the documentation, and all over the Googles, and I can not get this to work. Here is a run down of what I have done thus far:
    1. created a physical schema under FILE_GENERIC that points to my target directory
    2. created a logical schema that points to my new physical schema
    3. imported a test file as a model (very simple, two string columns, 50 chars each)
    4. set my parameters for my file (named columns, delimited, filename resource name, etc.)
    5. created a new interface
    6. dragged my new file model as the target
    7. dragged my source table as well
    8. mapped a couple of columns
    9. had to select two KMs: LKM - SQL to SQL (for the source) & IKM - SQL to File Append (for the target)
    10. execute
    Now, here is where I started hitting problems. This failed in the "load data" step with the following error:
    +7000 : null : java.sql.SQLException: Column not found: C1_ERRCODE+
    I found a note on the forum saying to change the "Staging Area Different From Target" setting on the Definition tab. Did that and selected the source table's schema in the dropdown, ran again. Second error:
    +942 : 42000 : java.sql.SQLException: ORA-00942: table or view does not exist+
    This occurred in the "Integration - insert new rows" step.
    The crazy thing is that in a step prior to this ("Export - load data"), the step succeeded and the data shows up in the output file!
    So why is ODI trying to export the data again? And why am I getting an ORA error when the target is a file?
    Any assistance is appreciated...
    A frustrated noob!
    Edited by: Lonnie Morgan (CALIBRE) on Aug 12, 2009 2:58 PM

    I found the answer. But still not sure why this matters...
    Following this tutorial, I recreated my mapping:
    [http://www.oracle.com/technology/obe/fusion_middleware/ODI/ODIproject_table-to-flatfile/ODIproject_table-to-flatfile.htm]
    I was still getting the same error. I reimported my IKM and found that the "Multi-Connections" box was unchecked before and now it was checked. I may have unchecked it in my trial & error.
    Anyway, after running the mapping again with the box checked, the extract to a file worked.
    So, I'm happy now. But, I am also perturbed with the function of the this checkbox and why it caused so much confusion within ODI.

  • Web pages content looks very "simple" but looks normal with IE/GC?

    Computer is running Windows 7.. with the latest firefox version. Not sure what is causing this but when I log onto Facebook, banking sites, craigslist - everything looks very simple as if there is no page layout or graphics. Some pages look more simple than others but no website seems to load properly. I've checked that the page style option isn't checked on "No style" already.
    I tried to take a screen shot of what FB looks like when I log on.
    *http://i84.photobucket.com/albums/k40/naughtykobra/fbpage.jpg
    Seemed to notice the change after a Java update - so I did a system restore to before that update with no luck.
    Loaded the same websites on Google chrome and everything works fine!?

    Hi,
    You may also have to make sure that '''Allow pages to choose their own colors, instead of my selections above''' is selected in '''Tools''' ('''Alt''' + '''T''') > '''Options''' > '''Content''' > '''Colors'''. [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Content%20panel Options > Content]
    [https://support.mozilla.org/en-US/kb/Options%20window Options]
    If the problem persists, please also try a [https://support.mozilla.org/en-US/kb/Managing-profiles new profile]. You can later [https://support.mozilla.org/en-US/kb/Recovering%20important%20data%20from%20an%20old%20profile?s=profile&r=1&e=sph&as=s copy the personal data] from the previous profile to this. Firefox stores the personal settings and data separate from its [http://kb.mozillazine.org/Installation_directory installation and files].
    [https://support.mozilla.org/en-US/kb/Profiles?s=profile&r=2&e=sph&as=s Profiles Howto]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]

  • This is a very simple question,but I don't know.Please me.Thank you!

    I am a Chinese student in a university.I have a very simple question to ask.
    I have writed a EJB module,and I have deployed to Weblogic8.1 successfully.
    1.Now I want to write a client program.Is it necessary that the client program is packaged in the EJB package.For example ,the EJB package is Beans,is "package Beans " or "import Beans.*" necessary in my client program.
    2.If I only know the EJB interfaces,that means the EJB module is writed by other programer.I want to know how I can write the client program.How can I call EJB module's method writed by other programer.Could you give me a simple example?
    Thank you very much.

    I have writed a EJB module,and I have deployed to
    Weblogic8.1 successfully.:-)
    1.Now I want to write a client program.Is it
    necessary that the client program is packaged in the
    EJB package.For example ,the EJB package is Beans,is
    "package Beans " or "import Beans.*" necessary in my
    client program.You need not package your client with the EJB. It can be a JSP/servlet or a stand-alone application.
    2.If I only know the EJB interfaces,that means the
    EJB module is writed by other programer.I want to
    know how I can write the client program.How can I
    call EJB module's method writed by other
    programer.Could you give me a simple example?
    import java.util.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import examples.*;
    class TestEJBHello {
        public static void main(String[] args) {
            Context context   = null;
            Object object     = null;
            // Hashtable for environment properties.
            Hashtable env = new Hashtable();
            env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            env.put(Context.PROVIDER_URL, "t3://localhost:7001");
            HelloHome home            = null;
            HelloWorld hello          = null;
            try {
                context     = new InitialContext(env);
                object      = context.lookup("HelloWorldTest");
                System.out.println(" JNDI Looked up >>> " +object);
                home        = (HelloHome)PortableRemoteObject.narrow(object, HelloHome.class);
                hello       = home.create();
                System.out.println(hello.hello());
            } catch(Exception e) {
                e.printStackTrace();
            } finally {
                close(context);        // Closes the initial context.
        private static void close(Context context) {
            try {
                context.close();
                System.out.println("*** Context closed. ***");
            } catch (NamingException namingException) {
                namingException.printStackTrace();
            } catch(Exception exception) {
                exception.printStackTrace();
    }Here's a sample client app code I use for a HelloWorld EJB. You need to have a EJB client JAR containing the home and remote interfaces in the classpath during compile time and runtime.
    x

  • HT4489 I am trying to import vcards, they are very simple - a name and contact phone number.  No pic, no ancillary information, but I get an error then directed to this completely unhelpful page.  The vcards are standard exports from another phone.

    I am trying to import vcards, they are very simple - a name and contact phone number.  No pic, no ancillary information, but I get an error then directed to this completely unhelpful page.  The vcards are standard exports from another phone.

    Try creating the vCard with the app My Contacts Backup, email it to yourself, then open it on your phone and tap the attachment to import the contacts.

  • Problems deploying a simple EJB on Weblogic 8.1 using JDeveloper

    Hey guys,
    Title says it all. First I had one problem in that I could not test the connection to the Weblogic server. I moved the weblogic.jar file into the lib/ext folder and that test worked then. After that I wrote the EJB...a very simple one...and I followed the http://dev2dev.bea.com/pub/a/2006/01/wls-jdeveloper.html?page=1 tutorial so far. But when it came time to deploy the ejb to the server, I am getting this funky error:
    ERROR: ejbc found errors while processing the descriptor for C:\oracle\jdeveloper\jdev\mywork\WeblogicApp\EchoEJB\deploy\ejb1.jar:
    ERROR: Error from ejbc: Error processing 'META-INF/ejb-jar.xml': XML document does not appear to contain a properly formed DOCTYPE header
    Honestly I am confused now...any one encounter that error?
    Thanks for all replies.
    Cheers

    So I added the DOCTYPE and now I get another error. And that is as follows:
    ERROR: Error from ejbc: Error parsing file 'META-INF/ejb-jar.xml' at line: 5 column: 219. Attribute "xmlns:xsi" must be declared for element type "ejb-jar".
    It seems that when the EJB is created, then it automatically creates the appropriate ejb-jar.xml and for some reason I guess the one it is creating this time is not good enough for Weblogic because first the DOCTYPE was missing and then after inserting the DOCTYPE I am getting the above error. Any help would be appreciated. This is the first time I am using Weblogic and this is a rather disheartening amount of progress I have made since last night! ;(
    Thanks in advance for any help. If I am doing something silly please point it out so I can learn!
    Cheers,
    Surya

  • Error in deploying a simple EJB 3.0

    Hi ,
    I am getting the following error while deploying my simple ejb of version 3.0 in Weblogic 9.2.
    Exception preparing module: EJBModule(build) [EJB:011023]An error occurred while reading the deployment descriptor. The error was: Error processing annotations: java.lang.NullPointerException.
    During my evaluation of Weblogic 9.2 for EJB 3.0 , I have got the following questions.
    EJB Specification states that EJB's in EJB 3.0 can be developed and deployed without the need of deployment descriptors. I have created a simple EJB with two file Env.java and EnvBean.java and the source code is given below.
    a) I just complied these class files and when I was trying to deploy without ejb-jar.xml and weblogic-ejb-jar.xml, the console was not at all allowing me to deploy.Why is this so?
    b) After I created a META-INF file under root of classes directory by placing ejb-jar.xml with empty <enterprise-beans> element, console was allowing me to deploy with errors in parsing ejb-jar.xml. The error was either session/entity/mdb is a required under <enterprise-beans> element. Why is this required when there are several examples stating <enterprise-beans> element can be empty.
    c) Later I updated ejb-jar.xml with <session> element under <enterprise-beans> with the following values. I got the above error when deployed with this change.
    I had been struggling to deploy this simple bean for almost a day.Pleas point me if there is any documentation that solves my stated problem or if there is a solution.Thanks in advance.
    regards
    Karim
    ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    <enterprise-beans>
    <session>
    <description>This is the stateless ejb</description>
    <display-name>Env Bean</display-name>
    <ejb-name>EnvBean</ejb-name>
    </session>
    </enterprise-beans>
    </ejb-jar>
    Env.java
    package examples ;
    public interface Env {
    public void display();
    EnvBean.java
    package examples;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    @Stateless
    @Remote(Env.class)
    public class EnvBean implements Env {
    public void display() {
    System.out.println("Welcome to EJB 3.0");
    }

    Presumably you're using the EJB3 tech preview, and not a vanilla WebLogic 9.2 install, right?
    Can you post the full stack trace?
    -Patrick

  • My problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set sav

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/986549 /questions/986549]''
    my problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set save downloads to my e drive....but still firefox keeps saving them to my c drive....i have 4 internal hard drives in my rig....and have tried saving downloads to them all.......why this is happening i cant understand....i have tried lots of suggestions....and have re-installed firefox multiple times

    hello, there's a general regression in firefox 27 that won't allow files to download directly into a root drive. please try to create a subfolder (like ''E:\Downloads'') and set this as default location for downloads...
    also see [https://bugzilla.mozilla.org/show_bug.cgi?id=958899 bug #958899].

  • Problem With Deploying a very simple Servlet

    HELP REQUIRED:
    Hi,
    I'm including code of a very simple Servlet application (I shd not call it an application):
    index.html
    ==========
    <html><body bgcolor="#FFFFFF">
         <head>
         <title> Rajeev Asthana </title>
    <form action = "/HelloWorldApp/HelloWorld" method = "POST" >
    Please press Submit
    <input type = "submit" value = "Press Me!">
    </form>
    </body></html>
    HelloWorld.java
    ===============
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet {
         public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
              throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              out.println("<html><body bgcolor=\"#FFFFFF\">");
              out.println("<p>Hello World!</p>");
              out.println("</body></html>");
              out.close();
    web.xml
    ========
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>HelloWorldApp</display-name>
    <servlet>
    <display-name>HelloWorld</display-name>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    </web-app>
    sun-web.xml
    ===========
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.0 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-0.dtd">
    <sun-web-app xmlns="http://java.sun.com/xml/ns/j2ee">
    <context-root>/HelloWorldApp</context-root>
    <session-config>
    <session-manager persistence-type="memory">
    <manager-properties/>
    <store-properties/>
    </session-manager>
    <session-properties/>
    <cookie-properties/>
    </session-config>
    <cache enabled="false" max-entries="4096" timeout-in-seconds="30">
    <default-helper/>
    </cache>
    <class-loader delegate="true"/>
    <jsp-config/>
    </sun-web-app>
    I have deployed it in following directory structure:
    C:\Sun\AppServer\domains\domain1\applications\j2ee-modules\HelloWorldApp\
    |
    |
    |               |               |               |
    |               |               |               |
    META-INF          WEB-INF          HelloWorld.java          index.html
                   |
                   |
              |          |          |          |
              |          |          |          |
         classes          sun-web.xml     web.xml          sun-j2ee-ri-project
         |
         |
         HelloWorld.class
    While generating HelloWorldApp.war (which is the war file for this app), I specifies /HelloWorldApp as context root (sun specific).
    Now, when I deployed it thru Admin Tool and then clicked on "Launch", it displays a page with :
    Please press Submit Press Me!
    But when I click the button "Press Me!", it says:
    "The requested resource (/HelloWorldApp/HelloWorld) is not available."
    What should I do to correct the problem?
    Thanks in advance.
         

    Yes, you need to add a servlet -mapping element and adjust your form to submit to the appropriate URL mapping.
    <servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/servlet/Hello</url-pattern>
    </servlet-mapping>

  • I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    Why do you need a expensive MacBook Pro?
    Your attending high school and unless everyone else is rich also your likely going to be a target by the more poorer students for theft or damage to the machine.
    You could keep it home, but if you need it for class then your exposed again.
    Also at that age your not very careful yet, a MacBook Pro is a expensive and easily damaged machine.
    Unless your made of money and so are others at your school, I would recommned a low profile, just does the job cheap Windows PC.
    If it dies, gets lost, stolen or damaged because of your inexperince handling senstivie electronics then it's no big deal.
    You can buy a Mac later on when your sure you have a need for it, currently there isn't much advantage of owning a Mac compared to a PC, they do just about the same things now, one just looks prettier than the other.
    Since 95% of the world uses Windows PC's your going to have to install Windows on the Mac in order to keep your skills up there or be unemployed, so it's a extra headache and expense.
    good luck

  • EJB 3.0 MDB and transactions

    I'm trying to use an XA topic connection factory in my MDB, I was getting a "not supported in this release" error until I added this annotation to my MDB:
    @MessageDrivenDeployment(
    resourceAdapter = "myProviderInstance"
    But now my MDB is no longer dequeuing messages.
    I found the following in the docs (http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b28221/undejdev010.htm#CCHGGHAE)
    --- BEGIN QUOTE FROM ORACLE DOCS ---
    If you use @MessageDrivenDeployment, you can configure message service options using nested @ActivationConfigProperty annotations or using @MessageDrivenDeployment attributes: @ActivationConfigProperty configuration overrides @MessageDrivenDeployment attributes.
    If you use @MessageDriven, you can configure message service options using nested @ActivationConfigProperty annotations only.
    If you configure using @MessageDrivenDeployment attributes, your application can only access a message service provider without a J2CA resource adapter. If later you decide to access your message service provider using a J2CA resource adapter, your application will fail to deploy. If you configure using nested @ActivationConfigProperty annotations, your application can access a message service provider with or without a J2CA resource adapter. Oracle recommends that if you configure using annotations, you should use the @ActivationConfigProperty approach.
    Example 2-6 shows both a @MessageDrivenDeployment and @MessageDriven annotation using @ActivationConfigProperty annotations for message service configuration. Note that the DestinationName activation configuration property in the @MessageDrivenDeployment annotation overrides that in the @MessageDriven annotation.
    Example 2-6 @MessageDriven and @MessageDrivenDeployment Annotation for a J2CA Message Service Provider
    import javax.ejb.MessageDriven;
    import oracle.j2ee.ejb.MessageDrivenDeployment;
    import javax.ejb.ActivationConfigProperty;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(
    activationConfig = {
    @ActivationConfigProperty(
    propertyName="DestinationName", propertyValue="OracleASjms/MyQueue"
    @MessageDrivenDeployment(
    activationConfig = {
    @ActivationConfigProperty(
    propertyName="DestinationName", propertyValue="OracleASjms/DeployedQueue"
    @ActivationConfigProperty(
    propertyName="ResourceAdapter", propertyValue="OracleASjms"
    --- END QUOTE FROM ORACLE DOCS ---
    So, instead of specifying the resource adapter as I had above, I simply pasted the last bit of annotations from the docs into my MDB, and much to my surprise I learned that you can't have an activationConfig in a @MessageDrivenDeployment
    What's the solution?

    OK, I got a little further. Everything works now as such
    I'm using the XA topic connection factory, I'm using the resource adapter.
    BUT, when I set the transaction required attribute on the MDB, I no longer receive messages.
    No errors are logged anywhere. Any suggestions?

  • Simple EJB 3.0 stateless session

    Hi,
    I want write a simple EJB 3.0 application on Sun System Java Application Server 9.0 , Can any one help me on the following topic
    1.how should develope a Stateless session.
    2. what are jar files are required
    3. where should place Bean, Business Interface and required files.
    4. Is ejb-jar.xml required. ( As of my knowledge deployement descriptor are not required for EJB 3.0, is it correct)
    5. how should i complie those files.
    6. how should generated RMI components
    If you know any good url on this please help me.
    Thanks, hope excepecting reply soon..

    1.how should develope a Stateless session.write business interfaces and bean classes. I would use an IDE like NetBeans 5.5 to automate some of these tasks.
    2. what are jar files are required You application will need $SJSAS_HOME/lib/javaee.jar
    3. where should place Bean, Business Interface and
    required files.In a jar file, at the root of this jar file. Then you can deploy this ejb jar file to server (using asadmin deploy, admin gui, or autodeploy). The server will scan your jar file and detect it's a ejb jar file and process all metadata.
    4. Is ejb-jar.xml required. ( As of my knowledge
    deployement descriptor are not required for EJB 3.0,
    is it correct)Not required. You can use annotation to provide most or all metadata.
    5. how should i complie those files.For simple cases, use javac should work. For example, javac -classpath $SJSAS_HOME/lib/javaee.jar:. -d /tmp/classes *.java
    But I would suggest using an IDE like NetBeans 5.5, which has various wizards to help you create bean classes and interfaces.
    6. how should generated RMI components
    If you know any good url on this please help me.http://java.sun.com/javaee/5/docs/tutorial/doc/
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • Always fail to deploy to server when (Create a Simple EJB Session Bean )

    Hi,
    I'm trying the "Oracle JDeveloper 11g Tutorials" - "Create a Simple EJB Session Bean", I just follow the instructions in that page. But when I tried to run it, it always failed. Can anyone help me to have a look. I paste the log below. thank you.
    There's an error in the log "java.lang.ClassNotFoundException: oracle.security.jps.wls.listeners.JpsApplicationLifecycleListener". but I don't know what's that meaning.
    E:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.56\DefaultDomain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m
    WLS Start Mode=Development
    CLASSPATH=;e:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;e:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;e:\Oracle\MIDDLE~1\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;e:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;e:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.0.0.jar;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;e:\Oracle\MIDDLE~1\modules\ORGAPA~1.5/lib/ant-all.jar;e:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;E:\Oracle\MIDDLE~1\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar;;
    PATH=e:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\native;e:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;e:\Oracle\MIDDLE~1\patch_cie660\profiles\default\native;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;e:\Oracle\MIDDLE~1\modules\ORGAPA~1.5\bin;e:\Oracle\MIDDLE~1\JDK160~1\jre\bin;e:\Oracle\MIDDLE~1\JDK160~1\bin;C:\oracle\product\10.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;G:\D\JACKYH\Installed\apache-ant-1.7.1\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\CollabNet Subversion;U:.;V:.;E:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http:\\hostname:port\console *
    starting weblogic with Java version:
    java version "1.6.0_05"
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
    Starting WLS with line:
    e:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -DproxySet=false -Djbo.34010=false -Xverify:none -da -Dplatform.home=E:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=E:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=e:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\sysext_manifest_classpath;e:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath;e:\Oracle\MIDDLE~1\patch_cie660\profiles\default\sysext_manifest_classpath -Dweblogic.Name=DefaultServer -Djava.security.policy=E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy weblogic.Server
    <12/11/2008 10:54:31 AM EST> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
    E:\Oracle\Middleware\patch_wls1030\profiles\default\sysext_manifest_classpath\weblogic_ext_patch.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\beehive_ja.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\beehive_ko.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\beehive_zh_CN.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\beehive_zh_TW.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ja.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ko.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_CN.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_TW.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\testclient_ja.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\testclient_ko.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\testclient_zh_CN.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\testclient_zh_TW.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ja.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ko.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_CN.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_TW.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\workshop_ja.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\workshop_ko.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\workshop_zh_CN.jar;E:\Oracle\Middleware\wlserver_10.3\L10N\workshop_zh_TW.jar>
    <12/11/2008 10:54:32 AM EST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 10.0-b19 from Sun Microsystems Inc.>
    <12/11/2008 10:54:32 AM EST> <Info> <Management> <BEA-141107> <Version: WebLogic Server Temporary Patch for CR380042 Thu Sep 11 13:33:40 PDT 2008
    WebLogic Server Temporary Patch for 7372756 Fri Sep 12 17:05:44 EDT 2008
    WebLogic Server 10.3 Mon Aug 18 22:39:18 EDT 2008 1142987 >
    <12/11/2008 10:54:33 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <12/11/2008 10:54:33 AM EST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
    <12/11/2008 10:54:34 AM EST> <Notice> <Log Management> <BEA-170019> <The server log file E:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.56\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log is opened. All server side log events will be written to this file.>
    <12/11/2008 10:54:36 AM EST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
    <12/11/2008 10:54:38 AM EST> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddi was not deployed. Error: [Deployer:149158]No application files exist at 'E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddi.war'.>
    <12/11/2008 10:54:38 AM EST> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddiexplorer was not deployed. Error: [Deployer:149158]No application files exist at 'E:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddiexplorer.war'.>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <12/11/2008 10:54:39 AM EST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
    <12/11/2008 10:54:39 AM EST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:7101 for protocols iiop, t3, ldap, snmp, http.>
    <12/11/2008 10:54:39 AM EST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.12.54:7101 for protocols iiop, t3, ldap, snmp, http.>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "DefaultServer" for domain "DefaultDomain" running in Development Mode>
    <12/11/2008 10:54:39 AM EST> <Warning> <Server> <BEA-002611> <Hostname "jackyh.dst.com.au", maps to multiple IP addresses: 192.168.12.54, 127.0.0.1>
    <12/11/2008 10:54:39 AM EST> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 192.168.12.54, 127.0.0.1>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <12/11/2008 10:54:39 AM EST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    DefaultServer startup time: 13829 ms.
    DefaultServer started.
    [Running application SessionEJB on Server Instance DefaultServer...]
    ---- Deployment started. ---- 12/11/2008 10:54:43
    Target platform is (Weblogic 10.3).
    Running dependency analysis...
    2008-11-12 10:54:43.882: Writing EJB JAR file to E:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\SessionEJB\SessionEJB-Project1-ejb
    2008-11-12 10:54:43.914: Wrote EJB JAR file to E:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\SessionEJB\SessionEJB-Project1-ejb
    2008-11-12 10:54:44.148: Writing EAR file to E:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\SessionEJB
    2008-11-12 10:54:44.164: Wrote EAR file to E:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.56\o.j2ee\drs\SessionEJB
    Deploying Application...
    <12/11/2008 10:54:46 AM EST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1226447686226' for task '0'. Error is: 'weblogic.management.DeploymentException: '
    weblogic.management.DeploymentException:
         at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:171)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:99)
         at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: oracle.security.jps.wls.listeners.JpsApplicationLifecycleListener
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
         Truncated. see log file for complete stacktrace
    >
    <12/11/2008 10:54:46 AM EST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'SessionEJB'.>
    <12/11/2008 10:54:46 AM EST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.management.DeploymentException:
         at weblogic.application.internal.flow.BaseLifecycleFlow$CreateListenerAction.run(BaseLifecycleFlow.java:171)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.application.internal.flow.BaseLifecycleFlow$BaseAction.invoke(BaseLifecycleFlow.java:99)
         at weblogic.application.internal.flow.HeadLifecycleFlow.createListener(HeadLifecycleFlow.java:117)
         Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: oracle.security.jps.wls.listeners.JpsApplicationLifecycleListener
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
         Truncated. see log file for complete stacktrace
    >
    [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application SessionEJB on DefaultServer.: .
    weblogic.management.DeploymentException:
    #### Deployment incomplete. #### 12/11/2008 10:54:46
    oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
         at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
         at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
         at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
         at oracle.jdevimpl.runner.adrs.AdrsStarter$4$1.run(AdrsStarter.java:1316)
    Caused by: oracle.jdeveloper.deploy.DeployException
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
         at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
         ... 11 more
    Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
         at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
         ... 12 more
    #### Cannot run application SessionEJB due to error deploying to DefaultServer.
    [Application SessionEJB stopped and undeployed from Server Instance DefaultServer]

    Steve,
    I'm facing the same issue as user#####.
    Your workaround does not work ; when I deploy manuelly the ear file, with a new weblogic-application.xml, I get the same error.
    Does that happen a lot ? :p
    Edit :
    my web.xml :
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
      <description>Empty web.xml file for Web Application</description>
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
      </context-param>
      <context-param>
        <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs, and saved state will be discarded when JSP's change. It will also automatically check if your skinning css files have changed without you having to restart the server. This makes development easier, but adds overhead. For this reason this parameter should be set to false when your application is deployed.</description>
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
        <param-value>false</param-value>
      </context-param>
      <context-param>
        <description>Whether the 'Generated by...' comment at the bottom of ADF Faces HTML pages should contain version number information.</description>
        <param-name>oracle.adf.view.rich.versionString.HIDDEN</param-name>
        <param-value>false</param-value>
      </context-param>
      <filter>
        <filter-name>JpsFilter</filter-name>
        <filter-class>oracle.security.jps.ee.http.JpsFilter</filter-class>
      </filter>
      <filter>
        <filter-name>trinidad</filter-name>
        <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
      </filter>
      <filter>
        <filter-name>adfBindings</filter-name>
        <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
      </filter>
      <filter-mapping>
        <filter-name>JpsFilter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      <filter-mapping>
        <filter-name>trinidad</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <filter-mapping>
        <filter-name>adfBindings</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet>
        <servlet-name>resources</servlet-name>
        <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>resources</servlet-name>
        <url-pattern>/adf/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>resources</servlet-name>
        <url-pattern>/afr/*</url-pattern>
      </servlet-mapping>
      <session-config>
        <session-timeout>35</session-timeout>
      </session-config>
      <mime-mapping>
        <extension>html</extension>
        <mime-type>text/html</mime-type>
      </mime-mapping>
      <mime-mapping>
        <extension>txt</extension>
        <mime-type>text/plain</mime-type>
      </mime-mapping>
    </web-app>Luc-
    Edited by: Lucas Ismag on 4 déc. 2008 05:33

Maybe you are looking for