EJB and JBOSS

Hi, My company is currently trying to migrate from Weblogic to JBoss.
We have all the jar, war, and xml file.
However, I'm not familiar with all these.
Could someone explain to me what;s the appropriate things to do.
All i know is that putting the war or jar file in a certain directory on Weblogic would result in those files being deployed.
Would JBoss work the same way?
Can I just put these files and will it get deployed?
I have looked through the web and mostly what they're talking about is creating ejbs from scratch (and .ear file also new thing to me) ... which is too technical for me.
Can someone suggest a solution please.
I'm a newbie to this technology.
All help/reply would be a great help.
thanks in advance.

Greetings,
Would JBoss work the same way?
Can I just put these files and will it get deployed?Yes, JBoss offers a similar deployment strategy. Presuming you are using JBoss 3.x and starting with default configuration you would place your components into ${JBOSS_HOME}/server/default/deploy and JBoss will auto-deploy them - er, assuming there are no errors in your components... ;) If there are errors then these will either be displayed on the console or in the 'console log' file depending on your startup strategy.
I have looked through the web and mostly what they're
talking about is creating ejbs from scratch (and .ear
file also new thing to me) ... which is too technical
for me.
Can someone suggest a solution please.
I'm a newbie to this technology.Where most of your difficulties are likely to play is in configuring your application's infrastructure - i.e. resources, security model, transactions, etc. Application Servers tend to differ quite a bit on such things (rather, on how to do them...), and JBoss is no exception. Furthermore, JBoss does not have a native GUI for these things which may complicate the matter even more. The best place to start for configuration issues is with the JBoss 3.0.x QuickStart Guide. This book-length guide provides a lot more detail on these matters than might be expected from typical "quick start" document and is available in PDF format for free from the JBoss site Documentation page. While you're there, it is worth-while to investigate the commercial documentation offerings on the same page...
All help/reply would be a great help.
thanks in advance.Regards,
Tony "Vee Schade" Cook

Similar Messages

  • Read this: cocoon , ejb and jboss

    hi all ,
    read this , working on cocoon .
    Integrating cocoon with jBoss
    Download cocoon-war-2.1.7.war and then we have to
    deploy that to the jboss server , to deploy that , we
    started jboss server in standard mode and then copied
    the cocoon war file to
    /usr/local/jboss-4.0.0/server/standard/deploy/ folder
    and in the server console we got the message saying
    that the perticular war file is being deployed .Then
    run the cocoon home page using
    http://localhost:8080/cocoon-war-2.1.7/ .
    Deploying ejb in cocoon
    To deployment ejb in cocoon you should have an ejb
    container , so we have to integrate ejb with any
    application server , here we are using jBoss server.
    Here i'm using a js (java script ) file to invoke an
    ejb client , i'm using the command
    var query = new Packages.hibernate.logging.Query();
    where hibernate.logging is the package and Query is
    the bean's client , and Packages is the inbuilt
    keyword for accessing packages. Then from the client
    you can call the bean class as we normally calling the
    bean. If you are using data base in the bean you have
    to configure the cocoon.xconf file as
    <datasources>
    <jdbc logger="core.datasources.personnel"
    name="personnel">
    <pool-controller max="10" min="5"/>
    <dburl>jdbc:hsqldb:hsql://localhost:9002</dburl>
    <user>sa</user>
    <password/>
    </jdbc>
    <jdbc name ="hibernatedbds">
    <pool-controller min = "5" max = "10" />
    <dburl>jdbc:postgresql://192.168.0.129:5432/hibernatedb</dburl>
    <user>xxxxx</user>
    <password/>
    </jdbc>
    and in the bean calss we can access the database as
    public String xxxxxxx(String user, String
    password,Session session) throws RemoteException
         try
         if(session == null)
              System.out.println("Session is null");
         Transaction tx = session.beginTransaction();
         org.hibernate.Query q = session.createQuery("from
    hibernate.logging.User as user where user.users =
    :users and      user.password = :passwords");
         q.setString("users",user);
         q.setString("passwords",password);
         List list = q.list();
         tx.commit();
         if(list.isEmpty())
              return "false";
         catch(Exception e)
              e.printStackTrace();
              System.out.println("Called EJB");
              return "true";
    and in the client program we'll give
    String value = remote.Validate(user,password,session);
    to access the remote method
    when the program is ready and compiled create the jar
    file and then deploy it to the deploy folder of jboss
    and a copy od the same jar file to the
    cocoon/WEB-INF/lib/. Then you can run the program .
    regards
    Peeths

    And ? What happens next?
    Gosh! That suspense is killing me...

  • EJB 3 and JBoss 5!!

    Hi,
    Currently I am working on EJB 3 and JBoss 5. I am new to this kind of environment. Now the present application is running on different platform. Basically when the customer/shop owner swipes a card in POS system we get message. Now I need to listen existing port and need to get that message then process it through using EJB3. We are not using servlets. JSP's , JMS.
    Is there anyway to start a thread to listen on port when the EJB is deployed? or Is there anyway to listen on port using JBoss or EJB?
    What is the best way to do it?
    Thanks in advance.
    Bachi.

    Yeah we can do that. In fact I tried it and it worked but as a stand alone application. I need to make sure that listens on the port when the application server starts or when the ejb is deployed. That is the problem here. In my first question I mentioned that we are not using JSP's right if there is any solution through servlets or JSP's I would like to use them.
    Here is the program which runs as standalone. Unfortunately I got this program from online :)
    import java.io.BufferedOutputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class BeanSocket implements Runnable {
         private Socket connection;
         private String TimeStamp;
         private int ID;
         Runnable runnable;
         BeanSocket(Socket s, int i) {
              this.connection = s;
              this.ID = i;
         public  static void main(String args[]){
              int port = 19999;
              int count = 0;
              try {
                   ServerSocket socket1 = new ServerSocket(port);
                   System.out.println("MultipleSocketServer Initialized");
                   while (true) {
                        Socket connection = socket1.accept();
                        Runnable runnable = new BeanSocket(connection, ++count);
                        Thread thread = new Thread(runnable);
                        thread.start();
              } catch (Exception e) {
         public void run() {
              try {
                   // need to wait 10 seconds to pretend that we're processing
                   // something
                   try {
                        Thread.sleep(1000);
                   } catch (Exception e) {
                        e.printStackTrace();
                   TimeStamp = new java.util.Date().toString();
                   String returnCode = "MultipleSocketServer repsonded at " + TimeStamp + (char) 13;
                   BufferedOutputStream os = new BufferedOutputStream(connection.getOutputStream());
                   OutputStreamWriter osw = new OutputStreamWriter(os, "US-ASCII");
                   osw.write(returnCode);
                   osw.flush();
              } catch (Exception e) {
                   System.out.println(e);
              } finally {
                   try {
                        connection.close();
                   } catch (IOException e) {
    }Edited by: bachi. on Jun 28, 2009 12:00 PM
    Edited by: bachi. on Jun 28, 2009 12:02 PM

  • EJB annotations are not documented , versus Hibernate and JBoss seam do

    I have an application that contains EJB3 annotations, Hibernate Annotations and JBoss Seam annotations in the java code.
    When I generate the javadoc, the Hibernate and JBoss Seam annotations show by the side of the members and methods who has them, like, for example
    @Name(value="authenticator")
    @Scope(value=SESSION)
    @AutoCreate
    public class AuthenticatorImpl
    <dt>extends java.lang.Object </dt><dt>implements </dt>
    or, another example,
    h3. facesContext{noformat}@In(value="org.jboss.seam.faces.facesContext",
    create=true)
    private javax.faces.context.FacesContext facesContext{noformat}
    However, none of the EJB3 annotations included in the code are being dieplayed in the javadocs.
    Does someone knows if there is any reason why this should happen?
    This is my javadoc command:
    javadoc -version -d doc2 -sourcepath src\model;src\action -classpath "lib/core.jar;lib/jboss-embedded-api.jar;lib/jsr250-api.jar;classes/test;lib/hibernate.jar;lib/log4j.jar;lib/testng.jar;lib/ojdbc14.jar;lib/hibernate-commons-annotations.jar;lib/hibernate-search.jar;lib/hibernate-entitymanager.jar;lib/drools-compiler.jar;lib/richfaces-impl.jar;lib/jboss-cache.jar;lib/jboss-seam.jar;lib/janino.jar;lib/hibernate-annotations.jar;lib/richfaces-api.jar;lib/ejb-api.jar;lib/mvel14.jar;lib/jbosssx.jar;bootstrap;lib/jbpm-jpdl.jar;lib/commons-beanutils.jar;lib/lucene-core.jar;lib/jgroups.jar;lib/jsf-api.jar;lib/jboss-el.jar;lib/el-api.jar;lib/antlr-runtime.jar;lib/jstl.jar;classes/model;lib/antlr.jar;lib/persistence-api.jar;lib/jsf-facelets.jar;classes/action;lib/richfaces-ui.jar;lib/mail.jar;lib/drools-core.jar;lib/jboss-seam-debug.jar;lib/hibernate-validator.jar;lib/servlet-api.jar;lib/jta.jar" -private mil.navy.med.rota.model mil.navy.med.rota.security mil.navy.med.rota.action.util mil.navy.med.rota.action.util.mpd mil.navy.med.rota.action.mpd mil.navy.med.rota.action.referrals mil.navy.med.rota.model.referrals mil.navy.med.rota.action.trainman mil.navy.med.rota.model.trainman -use -version -author -splitindex
    The version of javadoc used is
    Standard Doclet 1.6.0.0_3
    Aticipated thanks!

    Nevermind, the issue was that my persistence.xml did not contain the following property:
    <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
    Therefore, the tables were not being created upon deployment.
    Still, I would expect to see entity beans listed in the WebLogic console.

  • Tomcat and JBoss

    Hello! I'm not that new to web programming in Java but there are some things that I think I need to fully understand. Can anyone here give me a comparison between Tomcat and JBoss? What are the similarities and key differences between the two? Tomcat is a servlet container while JBoss is an application container(?? not sure about that, still haven't read enough about it).
    Thanks in advance,
    Romaine

    Hi Romaine,
    Tomcat is not only a servelet container...its actually the webserver which is a servlet container and jsp engine as well.
    Where as JBOSS is one of the application servers where it provides the run time environment for the business components( the ejbs) in addition to the support environment for servlets and jsps.
    examples of application servers: JBOSS, WEBLOGIC, WEBSPHERE

  • Transaction Isolation level in WebSphere and JBOSS???

    Hi,
    How to set up the transaction isolation level in Websphere and JBOSS???
    In weblogic, we can set it in weblogic-ejb-jar.xml. Is there any other file where we can set the isolation level in websphere and jboss???
    What is the difference between all the 4 isolation levels such as
    1) Transaction_committed
    2) Transaction_uncommitted
    3)Transaction_Repeatable_read
    4)Transaction_serializable
    Thanks,
    JavaCrazyLover

    In WebSphere 5.1 you can set the isolation level using resource reference. The following link describes the steps involved in this operation. I am not aware how to do the same thing in JBoss.
    Regards,
    Neo

  • EJB and JavaMail

    Hi,
    I have developed an EJB for sending emails using the javamail api.
    My problem is that when i run the same code using the a standalone java application (i have pasted the code from the EJB) and try sending mails outside the my companies domain the mails are going.
    However when i try sending the mails using the JSP end EJB the mails are not going.
    I noticed that in the standalone java application the protected method getPasswordAuthentication gets called by the system. However the same is not getting called in the EJB.
    I am new to this technology. Can anyone please help me out here.
    I am sending the code also that i am using:-
    // Get all the system properties
    Properties props = System.getProperties();
    props.put("mail.smtp.host", "HOSTNAME");
    props.put("mail.smtp.auth", "true");
    SetAuthentication auth = new SetAuthentication();
    Session session = Session.getInstance(props, auth);
    session.setDebug(true);
    // Create a message
    Message msg = new MimeMessage(session);
    try {
    // Set the From Address
    Address addrFrom =new InternetAddress("[email protected]");
    msg.setFrom(addrFrom);
    // Set the TO address
    Address addrTo = new InternetAddress(strTo);
    msg.setRecipient(MimeMessage.RecipientType.TO, addrTo);
    // Set the subject of the mail
    msg.setSubject(strSubject);
    msg.setContent(strContent, "text/plain");
    msg.saveChanges();
    Transport.send(msg);
    // Code in class SetAuthentication
    private PasswordAuthentication auth;
    public SetAuthentication() {
    super();
    auth = new PasswordAuthentication("user", "password");
    protected PasswordAuthentication getPasswordAuthentication() {
    return auth;

    Hi,
    I have worked on JBoss and Weblogic app servers and one can initialize java mail settings in the app server,.I am sorry, i don't know how its done in the app server you are using.
    I would suggest you to try the following :
    static {
    /* Setting Properties for STMP host */
    props = System.getProperties();
    props.put("mail.smtp.host", "PUT SMTP SERVER HERE");
    props.put("mail.smtp.auth", "true");
    session = Session.getDefaultInstance(props, null);
    try {
    MimeMessage message = new MimeMessage(session);
    message.setRecipient(Message.RecipientType.TO,
    new InternetAddress(this.to));
    message.setFrom(new InternetAddress(this.from));
    message.setSubject(this.subject);
    message.setText(this.message);
    Transport transport = session.getTransport("smtp");
    transport.connect("PUT SMTP SERVER HERE", "PUT USERNAME HERE", "PUT PASSWORD HERE");
    message.saveChanges();
    transport.sendMessage(message, message.getAllRecipients());
    transport.close();
    } catch (MessagingException e) {
    throw new Exception(e.getMessage());

  • Workshop and JBoss

    Hello I have a stupid nasty problem i am fighting second day. And it really gets me maaaddddd!!!! Please help.
    I need to deploy from Bea Workshop studio 3.3 and EJB to JBOSS 4.0.5. What i am doing is:
    New Project -> EJB Project->Next
    "Project Name" Test
    "target runtime" - Jboss v4.0.x
    configuration - custom
    EAR membership - Add project to EAR- selected
    now press "Next"
    Project Facets:
    EJB module- 2.0
    EJB Doclet- 1.2.3
    JAVA - 6.0 the installed runtime points to JDK
    now press Next
    then Finish
    in the ejbModule create package "test"
    in this package create XDoclet Enterprise JavaBean
    Session Bean
    on the next screen:
    all is default except the package which is "test"
    Next
    EjbName = MyTest
    then Next
    then finish
    Now I go to Run
    on the left select J2EE server->New
    in the Server press New and select JBOSS
    Using defaults
    Deselect Run module directly from workspace
    Now select the project to be deployed.
    press Run
    Now the Error is "Internal error occured during launching!!!"
    If i press publish on the server it says that it cannot publish with no explanation.!!!!!
    If I use only WTP without Bea Workshop studio I don't have any problems with the JBoss deploy.
    If i create dinamic Web project on Worksho I deploy it successfully don't have any problems. The problem is only if i want to deploy specificly a EJB!!!!
    Please help i am stuck 2nd day and i am desparate.

    Hello I have a stupid nasty problem i am fighting second day. And it really gets me maaaddddd!!!! Please help.
    I need to deploy from Bea Workshop studio 3.3 and EJB to JBOSS 4.0.5. What i am doing is:
    New Project -> EJB Project->Next
    "Project Name" Test
    "target runtime" - Jboss v4.0.x
    configuration - custom
    EAR membership - Add project to EAR- selected
    now press "Next"
    Project Facets:
    EJB module- 2.0
    EJB Doclet- 1.2.3
    JAVA - 6.0 the installed runtime points to JDK
    now press Next
    then Finish
    in the ejbModule create package "test"
    in this package create XDoclet Enterprise JavaBean
    Session Bean
    on the next screen:
    all is default except the package which is "test"
    Next
    EjbName = MyTest
    then Next
    then finish
    Now I go to Run
    on the left select J2EE server->New
    in the Server press New and select JBOSS
    Using defaults
    Deselect Run module directly from workspace
    Now select the project to be deployed.
    press Run
    Now the Error is "Internal error occured during launching!!!"
    If i press publish on the server it says that it cannot publish with no explanation.!!!!!
    If I use only WTP without Bea Workshop studio I don't have any problems with the JBoss deploy.
    If i create dinamic Web project on Worksho I deploy it successfully don't have any problems. The problem is only if i want to deploy specificly a EJB!!!!
    Please help i am stuck 2nd day and i am desparate.

  • JSP, EJB in Jboss 4 with mySQL database. Error in connecting to database

    Hi, i using JBoss 4-0-1 with jsp and mySQL database. I get this example from a book using stateless session beans. However i modify it so it can connect to mySQL database.
    This is my code for jsp.
    <%@ page import="asg.MusicEJB.*,
    java.util.*,
    javax.naming.Context,
    javax.naming.InitialContext,
    javax.rmi.PortableRemoteObject" errorPage="error.jsp" %>
    <%--
         The following 3 variables appear in a JSP declaration.
         They appear outside the generated _jspService() method,
         which gives them class scope.
         Since we want to initialize our Music EJB object once
         and read the Music Collection database to get the
         recording titles once, we place this code inside
         method jspInit().
         The EJB business method getMusicList()
         returns a collection of RecordingVO objects which we
         store in ArrayList albums.
    --%>
    <%!
         MusicHome musicHome;
         Music mymusic;
         ArrayList albums;
         Properties properties=new Properties();
         public void jspInit() {
                   properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                   properties.put(Context.PROVIDER_URL, "localhost:3306");
                   System.out.println("............................in properties");
              try {
                   //Context initial = new InitialContext();
                   InitialContext jndiContext = new InitialContext(properties);
                   //Object ref  = jndiContext.lookup("MusicEJB");
                   Object objref = jndiContext.lookup("java:comp/env/ejb/EJBMusic");
                   musicHome = (MusicHome)PortableRemoteObject.narrow(objref, MusicHome.class);
                   mymusic = musicHome.create();
                   albums = mymusic.getMusicList();
                   System.out.println(".............................in line 64");
              } catch (Exception ex) {
                   System.out.println("Unexpected Exception............: " +
                             ex.getMessage());
                   ex.printStackTrace();
    %>
    <%--
         The following scriptlet accesses the implicit
         request object to obtain the current URL
         and saves it to the session object for later retrieval. 
         It also saves variable mymusic, so we can
         make remote calls to our Music EJB, and the collection of
         RecordingVO objects.  These variables will all be available
         to other pages within the session.
    --%>
    <%
         String requestURI = request.getRequestURI();
         session.putValue("url", requestURI);
         session.putValue("mymusic", mymusic);
         session.putValue("albums", albums);
    %>
    <html>
    <head>
    <title>Music Collection Database Using EJB & JSP Version 9.7</title>
    </head>
    <body bgcolor=white>
    <h1><b><center>Music Collection Database Using EJB & JSP</center></b></h1>
    <hr>
    <p>
    There are <%= albums.size() %> recordings.
    <form method="post" action="musicPost.jsp">
    <p>
    Select Music Recording:
    <select name="TITLE">
    <%
         // Generate html <option> elements with the recording
         // titles stored in each RecordingVO element.
         // Obtain the current title from the session object
         // (this will be null the first time).
         String title;
         String currentTitle = (String)session.getValue("curTitle");
         if (currentTitle == null) currentTitle = "";
         RecordingVO r;
         Iterator i = albums.iterator();
         while (i.hasNext()) {
              r = (RecordingVO)i.next();
              title = r.getTitle();
              if (title.equals(currentTitle)) {
                   out.println("<option selected>" + title + "</option>");
              else {
                   out.println("<option>" + title + "</option>");
    %>
    </select><p><p>
    <%--
         Provide a "View Tracks" button to submit
         the requested title to page musicPost.jsp
    --%>
    <input TYPE="submit" NAME="View" VALUE="View Tracks">
    </form>
    </body>
    </html>Message was edited by:
    chongming

    This is the deployment descriptor for the .ear file.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
      <display-name>MusicDAOApp</display-name>
      <description>Application description</description>
      <module>
        <web>
          <web-uri>war-ic.war</web-uri>
          <context-root>music</context-root>
        </web>
      </module>
      <module>
        <ejb>ejb-jar-ic.jar</ejb>
      </module>
    <!--
      <module>
        <java>app-client-ic.jar</java>
      </module>
    -->
    </application>
    And this is the deployment for the ejb class files:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
      <display-name>MusicEJB</display-name>
      <enterprise-beans>
        <session>
          <display-name>MusicEJB</display-name>
          <ejb-name>MusicEJB</ejb-name>
          <home>asg.MusicEJB.MusicHome</home>
          <remote>asg.MusicEJB.Music</remote>
          <ejb-class>asg.MusicEJB.MusicBean</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Bean</transaction-type>
          <env-entry>
            <env-entry-name>MusicDAOClass</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>asg.MusicEJB.MusicDAOCloudscape</env-entry-value>
          </env-entry>
         <env-entry>
         <env-entry-name>dbUrl</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>jdbc:mysql://localhost/music</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>dbUserName</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>chongming</env-entry-value>
          </env-entry>
          <env-entry>
            <env-entry-name>dbPassword</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>kcm82</env-entry-value>
         </env-entry>
          <security-identity>
            <description></description>
            <use-caller-identity></use-caller-identity>
          </security-identity>
        </session>
      </enterprise-beans>
    </ejb-jar>I can combine the jar and war files into a ear file. deploying is alright without any errors.
    However when i run the jsp, it prompt this error:
    You Have Encountered an Error
    Stack Trace
    java.lang.NullPointerException
         at org.apache.jsp.musicGet_jsp._jspService(org.apache.jsp.musicGet_jsp:111)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    How to i solve the error? I look at he catch results in the command prompt of JBoss , i found that when running, the code will be caught by the exception and display this:int.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
    kerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    13:55:21,375 INFO [STDOUT] Unexpected Exception............: EJBException:; nes
    ted exception is:
    javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
    The url cannot be null
    13:55:21,375 INFO [STDOUT] java.rmi.ServerException: EJBException:; nested exce
    ption is:
    javax.ejb.EJBException: getMusicList: SQLException during DB Connection:
    The url cannot be null 13:55:21,375 INFO[STDOUT] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:352)
    13:55:21,375 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
    What can i do to solve the problem? please helpMessage was edited by:
    chongming
    Message was edited by:
    chongming
    Message was edited by:
    chongming

  • EJB and Server

    Dear All:
    I am VERY MUCH new to EJB and just started 3 months back.
    I am right now using JBoss in Linux platform, using XDoclet and Ant.
    However my requirement is to use a new J2EE application server apart from JBoss in order to implement all my web based applications that have been made already with JBoss.
    can any1 pls tell me which one to use based on Windows. I have got only 1 week to finish this and I need some server that is very easy to uderstand and deploy applications in it eg. Tomcat server(though not an Application server but only the web server, but pretty easy to use in Windows platform).
    Pls do help me with this query.
    Thanks and regards

    Tell your boss you're not experienced enough to do the work he told you to on your own.
    If that means you're going to be fired for faking your resume then so be it.
    There are many application servers that will run on Windows, JBoss being one of them.
    If you'd bothered downloading the JEESDK you'd have one too.
    Many IDEs come with one as well (and some with more than one).
    And that's just a few of the options.

  • Simple ejb in jboss

    Hi
    I am developing cmp in jboss 3.x
    I coded ejb classes. Had ejb-jar xml in place and jboss.xml too.
    Created a jar and deployed and it deployed sucessfully. Now i write a client to access it. I dosent find that entity and throws me ObjectNotFoundException. Now like in weblogic we give datasource in one of the xml file i did not c any place where i mention which datanase to use. Then where is my bean going and how to point to particular db.
    I have oracle-ds.xml pointing to one datasource but no where in ejb or xmls i have said use this datasource. How does this work ?
    Thanks

    ObjectNotFoundException is usualy thrown when no entry was found corresponding to the pk argument.
    where in your code did u get this exception? (watching)

  • JDOUserExceptions and JBoss commits

    Using Kodo and JBoss quite a few of my mistakes are detected at commit
    time, causing Kodo to throw a JDOUserException. This is caught and
    hidden by jboss, resulting in a stack trace of the sort shown below.
    I can view the JDOUserException by catching it in my debugger (Eclipse),
    but I'd also like to log it somehow.
    Is there a way of logging every JDOUserException?
    javax.transaction.RollbackException Unable to commit, tx=XidImpl
    [FormatId=257, GlobalId=QUADROPHENIA//309, BranchQual=]
    status=STATUS_ROLLEDBACK Stack Trace:
    * org.jboss.tm.TxCapsule.commit(TxCapsule.java:393)
    * org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73)
    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:201)
    * org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
    Thanks,
    Tom

    Using Kodo and JBoss quite a few of my mistakes are detected at commit
    time, causing Kodo to throw a JDOUserException. This is caught and
    hidden by jboss, resulting in a stack trace of the sort shown below.
    I can view the JDOUserException by catching it in my debugger (Eclipse),
    but I'd also like to log it somehow.
    Is there a way of logging every JDOUserException?
    javax.transaction.RollbackException Unable to commit, tx=XidImpl
    [FormatId=257, GlobalId=QUADROPHENIA//309, BranchQual=]
    status=STATUS_ROLLEDBACK Stack Trace:
    * org.jboss.tm.TxCapsule.commit(TxCapsule.java:393)
    * org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73)
    org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:201)
    * org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
    Thanks,
    Tom

  • Weblogic, EJBs and Corba

    Has anyone been successful accessing EJBs from pure Corba clients with
    Weblogic server? WOuld like some feedback on your experience and what
    you did.
    Thanks

    Sharon Ben Asher <> writes:
    I never got around to implementing PI's. It was a question of PI or
    POA and POA won. In 9.x and onwards you can use WorkContext to
    transfer data out-of-band between client and server. This is supported
    in both t3 and iiop and sounds like it would do what you
    wnt. WorkContext is used internally for doing the kind of tracing you
    are talking about.
    andy
    Hello Everyone.
    I am having a problem with BEA WebLogic. Let me describe the problem:
    Problem Description:
    What I need is to pass some arbitrary piece of data between the RMI client and server, so I want to inject the data on the client and retrieve it on the server (the ultimate goal being able to trace transaction flow across multiple app servers)
    CORBA Portable Interceptors fit the bill perfectly and are designed for that specific purpose. The interceptors are CORBA standard and were added to J2EE 1.4 standard. Sun own ORB, IBM WebSphere and JBOSS all support Portable Interceptors.
    WebLogic does not :(
    I looked at WebLogic documentation and could find no replacement for interception of RMI flow. The last resort is code instrumentation, but I really want to avoid that since I have to support J2SE 1.4 code that is prior to javaagent.
    Has anyone ever implemented something similar for WebLogic (v8.1 and up) or can point me to any feature of the product that can help me?
    Edited by sharonbn at 02/07/2008 6:33 AM

  • Problem with EJB and JMS - Failed to obtain/create connection

    hello ejb and jms programmers,
    My problem is my topic MDB keep on retrieving the same message when there is a database connection failure. Maybe somebody could help me how to prevent to retrieve the same data?
    Given:
    - I purposedly turn off the pointbase database because im testing my error handling.
    - Im using SJSAS 8 as my application server.
    - My message Driven Bean of topic type.
    - Im using CMP for my entity bean
    Here is the scenario of whats happening - step by step:
    1. A separate application publishes a message to JMS queue server
    2. My MDB retrieves this message and do some processing then inserts a record (transaction history) in my database
    3. But my db is turned off or down
    4. My MDB sends a successful processing reply to the JMS queue server
    5. Then i noticed that my server.log keeps on growing so when i opened it, the record was not inserted and printed the stacktrace below "RAR5117 : Failed to obtain/create connection. Reason : javax.transaction.SystemException" (complete stacktrace below)
    6. I understand the cause of the stacktrace is because the DB is turned off. But what i dont understand is that my MDB keeps on reading the same message. Since my MDB is of topic type, isnt a topic MDB supposedly reads a message only once???
    So my questions are:
    1. how do i handle insert database error?
    2. how can i stop my MDB from processing the same message?
    3. any better suggestions?
    Thank you in advance :)
    leigh
    *** more complete stack trace ***
    [#|2005-01-09T15:35:57.097+0800|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.system.core.transaction|_ThreadID=17;|JTS5041: The resource manager is doing work outside a global transaction
    javax.transaction.xa.XAException
         at com.pointbase.xa.xaException.getXAException(Unknown Source)
         at com.pointbase.xa.xaConnectionResource.start(Unknown Source)
         at com.sun.gjc.spi.XAResourceImpl.start(XAResourceImpl.java:162)
    [#|2005-01-09T15:35:57.167+0800|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=17;|RAR5027:Unexpected exception in resource pooling
    javax.transaction.SystemException
         at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:185)
         at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:360)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.java:303)
         at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.java:115)
    [#|2005-01-09T15:35:57.177+0800|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=17;|RAR5117 : Failed to obtain/create connection. Reason : javax.transaction.SystemException|#]
    [#|2005-01-09T15:35:57.227+0800|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=17;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: javax.transaction.SystemException]|#]
    [#|2005-01-09T15:35:57.237+0800|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.ejb|_ThreadID=17;|EJB5071: Some remote or transactional roll back exception occurred
    com.sun.jdo.api.persistence.support.JDODataStoreException: JDO77006: SQL exception: state = null, error code = 0.
    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException
    FailedObjectArray: [[email protected]5ac]
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnectionInternal(TransactionImpl.java:1444)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnection(TransactionImpl.java:1339)

    Hi annie,
    Wherever you are handling database transactions,
    you'd not be able to create a Connection if database
    is closed (I think you mentioned turning off the
    database) then at this condition, you should
    certainly throw a System level exception and stop all
    processing with some meaningful flow to indicate a
    failure (like display message on UI). Even
    network problems are handled by exceptions... so I
    don't see a reason why you didn't wrap it in the
    first place.
    Anyway, try handling specific exceptions rather than
    the general Exception... this will give you a better
    idea of what to do in case of an exception.Yes i know this. I am practicing this in my non-j2ee server applications. But the j2ee app im making, i just pass the db url in the descriptor and the app server automatically creates the connection for my app. So where would i put exception handling?
    2. how can i stop my MDB from processing the same
    message?Guaranteed delivery is not supposed to stop
    processing. It will continue to process the message
    after certain intervals till the message is
    delivered. You shouldn't deliver it at all, if you
    are able to detect that the database is off
    The problem here is that my MDB automatically retrieves the message from the JMS queue server. Im not the one retrieving the messages manually.
    My assumed behavior of topic MDB is once the a certain MDB retrieves a message it will not retrieve the same message anymore.
    thank you in advance.
    leigh

  • Problem with rollback in EJB and CMT

    Hello,
    I faced a problem in my application that I really do not understand (but I really would like to). How can I trigger a rollback of a transaction that is container-managed (CMT)? I know that any system exceptions are supposed to be handled by the container automatically and will cause a transaction rollback when they are thrown from an enterprise bean method. My Problem now is that I'm unable to make this work in my application.
    Consider a situation like this:
    The ManageEntityBean holds a simple save() method that creates an instance of EntityA and another of EntityB. Both instances store an arbitrary number (here 10). After this, the entityManger (injected from the container) is asked to make these instances persistent. EntityB is mapped with a "unique" constraint, so any attempt to store the same number twice will cause an SQL Exception.
    First time when the save() method is invoked, the instances aEntity and bEntity are made permanent in the database. Second time when the save() method is invoked, the database throws an exception because bEntity is violating the unique constraint. What I would expect now is a complete rollback of the whole transaction. Instead, only bEntity has not been made permanent, but aEntity has.
    What's wrong with this code?
    @Stateless
    public class ManageEntityBean implements ManageEntity {
         @PersistenceContext
         private EntityManager entityManager;
         @TransactionAttribute(TransactionAttributeType.REQUIRED)
         public void save() {
              try {
                   EntityA aEntity = new EntityA(10);
                   EntityB bEntity = new EntityB(10);
                    entityManager.persist(aEntity);
                    entityManager.persist(bEntity);
              } catch (Exception e) {
                   throw new EJBException(e);
    @Entity
    public class EntityA implements java.io.Serializable {
         @Id
         @GeneratedValue
         private long     id;
            @Column(name="NUMBER")
            private int   number;
         public EntityA() {}
         public EntityA(int number) {
              this.number = number;
    @Entity
    public class EntityB implements java.io.Serializable {
         @Id
         @GeneratedValue
         private long     id;
         @Column(name = "NUMBER", unique = true)
         private int          number;
         public EntityB() {}
         public EntityB(int number) {
              this.number = number;
    }I found two related topics in this forum but still I didn't find the solution yet.
    [Enterprise JavaBeans - CMT and JDBC|http://forums.sun.com/thread.jspa?forumID=13&threadID=525651]
    and
    [ Forums - A CMT Session Bean Does Not Maintain the Transaction Correctly| http://forums.sun.com/thread.jspa?forumID=13&threadID=161512]
    Maybe anyone can give me a hint. Help is very much appreciated
    Christoph

    Thank you for your input!
    The save() method is simply invoked from the test applications main() method:
    public class Test {
         public static void main(String[] args) {
              JndiUtil<ManageEntity> jndiUtil = new JndiUtil<ManageEntity>();
              ManageEntity handler = jndiUtil.lookupBeanContext("ManageEntityBean", ManageEntity.class);
              handler.save();
    }Btw. I use Hibernate as persistence provider and JBoss 4.2.2.GA as application server.
    For clarity I attach some lines of the debug logging that is produced when the test application is getting started for the second time:
    ### open Session
    17:44:00,555 DEBUG *[SessionImpl] opened session at timestamp: 5007498610909184*
    17:44:00,555 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
    17:44:00,555 DEBUG [JDBCContext] successfully registered Synchronization
    17:44:00,555 DEBUG [AbstractEntityManagerImpl] Looking for a JTA transaction to join
    17:44:00,555 DEBUG [AbstractEntityManagerImpl] Transaction already joined
    ### invoke em.persist(aEntity)
    17:44:00,555 DEBUG [AbstractSaveEventListener] executing identity-insert immediately
    17:44:00,555 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    17:44:00,555 DEBUG *[ConnectionManager] opening JDBC connection*
    17:44:00,555 DEBUG [SQL]
    /* insert de.zippus.domain.EntityA
    17:44:00,556 INFO [STDOUT] Hibernate:
    /* insert de.zippus.domain.EntityA
    17:44:00,558 DEBUG [IdentifierGeneratorFactory] Natively generated identity: 2
    17:44:00,559 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    17:44:00,559 DEBUG [ConnectionManager] aggressively releasing JDBC connection
    17:44:00,559 DEBUG [ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: >0)]
    ### invoke em.persist(bEntity)
    17:44:00,559 DEBUG [AbstractSaveEventListener] executing identity-insert immediately
    17:44:00,559 DEBUG [AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    17:44:00,559 DEBUG [ConnectionManager] opening JDBC connection
    17:44:00,559 DEBUG [SQL]
    /* insert de.zippus.domain.EntityB
    17:44:00,560 INFO [STDOUT] Hibernate:
    /* insert de.zippus.domain.EntityB
    17:44:00,561 DEBUG [AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    17:44:00,561 DEBUG [ConnectionManager] aggressively releasing JDBC connection
    17:44:00,561 DEBUG [ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: >0)]
    17:44:00,561 DEBUG [JDBCExceptionReporter] could not insert: [de.zippus.domain.EntityB] [* insert de.zippus.domain.EntityB */ insert into >ENTITY_B (NUMBER) values (?)]
    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '10' for key 2
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
    17:44:00,563 WARN [JDBCExceptionReporter] SQL Error: 1062, SQLState: 23000
    17:44:00,563 ERROR [JDBCExceptionReporter] Duplicate entry '10' for key 2
    17:44:00,563 DEBUG [AbstractEntityManagerImpl] mark transaction for rollback
    17:44:00,563 ERROR [ManageEntityBean] Caught exception: javax.persistence.EntityExistsException: >org.hibernate.exception.ConstraintViolationException: could not insert: [de.zippus.domain.EntityB]
    17:44:00,563 ERROR [ManageEntityBean] Exception Cause: org.hibernate.exception.ConstraintViolationException: could not insert: >[de.zippus.domain.EntityB]
    17:44:00,564 DEBUG *[ManagedEntityManagerFactory] ************** closing entity managersession *************** Up to now I'm not that experienced in reading and understanding this kind of logging, but what I can see is, that there is a transaction that spans the whole unit of work and that this transaction is marked for rollback. I think that's quite a good thing, isn't it?
    But what really puzzles me here is, that both calls of em.persist() result in an opening of a jdbc connection and an immidiate execution of a database insert. Tell me if I'm wrong, but is this really the right place to happen?
    For what reason soever hibernate thinks it has to make these instances permanent, no matter if there is already a session that is taking care of this. If so, I might deal with a wrong hibernate configuration, I checked, but I can't find anything..
    What do you think?
    Thanks in advance!
    Christoph

Maybe you are looking for

  • Whats the deal with ati cards?

    ive been reading through these pages and it cant really make head nor tail of the info regarding ati cards. i plan to get a sapphire radeon 9700 pro ultimate to stick into a new K7N2 Delta L mobo. no can somebody give me a straight answer on this, wi

  • Report layout problem when executing in Background

    Hi, I am executing one custom report in background with layout 'Z_65_400' . After execution, the report is generating spool number . But when I trying to see the output from the spool, here layout is coming differntly and with name 'X_65_255'. These

  • Second Hard Drive for Satellite P70 A01d Help

    I want to install a second hard drive in my laptop. I have a 2tb Samsung Spinpoint M9T, however the hard drive has 4 extra pins which don't connect to the laptop. Do these pins need to connected or is there something else i can do to onnect the hard

  • Will "File Save As" ever work properly in Safari?

    Even though I've been a long-time Safari user (with occasional dalliances with Firefox) this has always been a personal bugbear... In general, I like the way that Safari will play an mp3 file in the browser window. And then I have a choice... if ther

  • Weblogic-application.xml

    Is there a way I can get the contents of "application-param" element from weblogic-application.xml in a J2EE bean ? Are the contents of weblogic-application.xml bound to the JNDI tree? I am using WLS/WLI 8.1 SP2. Vishwa