5 Replies Latest reply on Oct 16, 2002 11:44 PM by vutran

    Jbuilder7 with Jboss3x, how create a JSP page call EJB?

    vutran Newbie

      Hi all,
      I have configured Jbuilder7 with Jboss3x, but when I write a JSP page to call some methods in EJB, I cannot. Can give me an example if you can do or guide for me how solve this problem.
      My OS: win2K Professional
      Jbuider7.
      You can recommend me use the version Jboss that It is the best
      Thanks,

        • 1. Re: Jbuilder7 with Jboss3x, how create a JSP page call EJB?
          prabhakar chaganti Apprentice

          Can you post some code to show how you are trying to call methods on the EJB from your jsp?

          -prabhakar

          • 3. Re: Jbuilder7 with Jboss3x, how create a JSP page call EJB?
            vutran Newbie

            Hi!
            I used jboss-3.0.3_tomcat-4.1.12, Jbuilder7. I have finished configuration jboss in Jbuilder7 so when I start JBoss and Tomcat(in jboss-3.0.3_tomcat-4.1.12)I have error follow:

            HttpConnector[8082] Starting background thread

            StandardServer.await: create[8083]: java.net.BindException: Address in use: JVM_Bind

            java.net.BindException: Address in use: JVM_Bind

            at java.net.PlainSocketImpl.socketBind(Native Method)

            at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:405)

            at java.net.ServerSocket.(ServerSocket.java:170)

            at org.apache.catalina.core.StandardServer.await(StandardServer.java:277)

            at org.apache.catalina.startup.Catalina.start(Catalina.java:794)

            at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)

            at org.apache.catalina.startup.Catalina.process(Catalina.java:179)

            at java.lang.reflect.Method.invoke(Native Method)

            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

            My JSP is :




            Jsp1



            <h1>
            JBuilder Generated JSP
            </h1>
            <%@ page import="java.util.Properties,javax.rmi.*, javax.naming.*,entjavabean.ConverterHome,entjavabean.Converter"%>
            <%
            try {
            Properties p = new Properties();

            p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
            p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
            p.put(Context.PROVIDER_URL, "localhost:1099");

            Context ctx = new InitialContext(p);

            //look up jndi name
            Object ref = ctx.lookup("Converter");

            //cast to Home interface
            ConverterHome converterHome = (ConverterHome) PortableRemoteObject.narrow(ref, ConverterHome.class);

            Converter converter = converterHome.create();

            double d = converter.yenToDollar(1000);
            double y = converter.dollarToYen(100);
            out.println("1000 yen = " + d + " dollar");
            out.println("100 dollar = " + y + " yen");
            } catch (Exception e){
            e.printStackTrace();
            }
            %>




            I want to run a JSP page in JBuilder to call EJB in the same project. How do I make this.
            Thanks,

            • 4. Re: Jbuilder7 with Jboss3x, how create a JSP page call EJB?
              prabhakar chaganti Apprentice

              BindException indicates that some other process is already using that port. You only need to start JBoss. That will start up tomcat too. Don't start them both.

              -prabhakar

              • 5. Re: Jbuilder7 with Jboss3x, how create a JSP page call EJB?
                vutran Newbie

                Hi
                Thank, I understood. Now I create a JSP but it is hided. How I create a JSP and run with JBoss in JBuilder7.
                Thank,