tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quintin Beukes <quin...@skywalk.co.za>
Subject Re: I need Help!!!!
Date Thu, 08 Oct 2009 17:14:59 GMT
I'm not sure how this is related to OpenEJB. You might be able to get
better support from the JDBC driver manufacturer.

Either way, what is the result of running this? ie. what do you
experience? Any errors/stacktraces? When you catch any exceptions, do
exc.printStackTrace(), don't just print the message - it can help with
the debugging.

Quintin Beukes



On Thu, Oct 8, 2009 at 6:18 PM, dede90 <obayinkus@yahoo.co.uk> wrote:
>
> Thanks for responding to my post.
>
> For some reason yesterday, when i ran this same command
> (/home/oracle/apache-6.0.20/bin/catalina.sh run) it was able to start both
> tomcat and openejb. I really do not know why it worked.
>
> I have anotehr challenge now.
>
> I have a JSP page with a basic form. The action on the form is a servlet.
>
> Now i have a simple java class that has methods to  connect to a database.
>
> when i run my jsp page, it does not retreive data from my database.
>
> JSP PAGE code
> <%@ page session="true" %>
>        <jsp:include page = "studHeader.html" flush="true"/>
>
>
>        <div class ="info ">
>
>
>
>        <form name ="studLogin" method ="POST" action="../StudCtrlServlet">
>            <table class =" info">
>                <tr>
>                    <td class =" look">Matriculation Number: </td>
>                    <td class =" look">
>                        <input type ="text" name ="matNumber" size="20"
> value ="Enter Mat Number"/>
>                    </td>
>                </tr>
>                <tr>
>                    <td class =" look">Password: </td>
>                    <td>
>                        <input type ="password" name ="sPWord" size="20"/>
>                    </td>
>                </tr>
>                <tr>
>                    <td><input type ="reset" name ="sReset" value="RESET"/>
> </td>
>                    <td><input type ="submit" name ="sLoginSubmit"
> value="LOGIN"/></td>
>                </tr>
>            </table>
>
>        </form>
>        </div>
> SERVLET CODE
> import java.io.*;
> import java.io.PrintWriter;
> import java.sql.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import IDCommon.TCBHome;
> import IDCommon.TCB;
> import javax.naming.Context;
> import javax.naming.InitialContext;
>
> /**
>  *
>  * @author oracle
>  */
> public class StudCtrlServlet extends HttpServlet
> {
>
>        TestConnBean tcb= new TestConnBean();;
>        private ServletContext servCon;
>        private RequestDispatcher reqDisp;
>        private ResultSet rs;
>        private boolean userCheck=false;
>        String matNum,pass,submit;
>
>    /**
>     * Handles the HTTP <code>GET</code> method.
>     * @param request servlet request
>     * @param response servlet response
>     * @throws ServletException if a servlet-specific error occurs
>     * @throws IOException if an I/O error occurs
>     */
>
>        public void processRequest(HttpServletRequest r, HttpServletResponse res)
> throws ServletException, IOException
>        {
>                try{
>
>                        submit = r.getParameter("sLoginSubmit");
>                        tcb.getConnection();
>
> tcb.authenticateUser(r.getParameter("matNumber"),r.getParameter("sPWord"));
>                        }
>        catch(SQLException se)
>        {}
>        catch(IOException io)
>        {}
>        }
>
>        protected void doPost(HttpServletRequest request, HttpServletResponse
> response)
>        throws ServletException, IOException
>        {
>
>                HttpSession session = request.getSession(true);
>                servCon = this.getServletContext();
>                String redirectPage = null;
>                String studMatNum = request.getParameter("matNumber");
>                String studPassword = request.getParameter("sPWord");
>                PrintWriter out = new PrintWriter(response.getOutputStream());
>                out.print("<html><head><title>my Servlet</title></head>");
>                        out.print("<body>");
>
> processRequest(request, response);
> matNum=tcb.getMatNumber();
> pass=tcb.getPasswd();
>
>
>        out.print("<p>db matnum is: "+matNum+"<br> DB password is: "+pass+"
<br> we
> Thank God o!!<p> " );
>        out.print("<p>you clicked on "+submit+" <p> " );
>        out.print("</body></html>");
>    } //end doPost method
>
>
>
>        public void init(ServletConfig cfg) throws ServletException
>        {
>                super.init(cfg);
>        }
>        public void destroy()
>        {
>                super.destroy();
>        }
>        }
>
> TESTCONNECTION CLASS
> import java.io.*;
> import java.util.*;
> import javax.sql.*;
> import java.sql.*;
> import oracle.sql.*;
> import oracle.jdbc.pool.OracleDataSource;
>
> public class TestConnBean
> {
>        private Connection conn=null;
>        private Statement stmt=null;
>        private ResultSet rset=null;
>        private OracleDataSource ods;
>        private String matN;
>        private String passwd;
>        private String strCredQuery;
>        private String strValidateQuery;
>        private boolean userChk=false;
> public Connection getConnection() throws SQLException, IOException
>        {
>                ods = new OracleDataSource();
>                ods.setURL("jdbc:oracle:thin:@dedeoba:1521/scompELE");
>                ods.setUser("sys as sysdba");
>                ods.setPassword("password");
>                StringBuffer sb = new StringBuffer();
>
>                try
>                {
>
>                        conn = ods.getConnection();
>                        System.out.println("CONNECTED!!!");
>                        sb.append("<p>connected to the db o!!!! </p>\n");
>
>                }//End of try
>                catch (SQLException e)
>                {
>                        sb.append("<P> SQL error: <PRE> " + e
+ " </PRE> </P>\n");
>                }//end of catch
>
>        return conn;
>        }//end of method
> public void authenticateUser(String matNum, String pwd) throws SQLException,
> IOException
>        {
>                stmt = getConnection().createStatement();
>                strCredQuery = "Select * from sys.student where MAT_NUM='" +matNum+
"'" +"
> AND PWORD='"+ pwd+"'";
>                rset = stmt.executeQuery (strCredQuery);
> int count=0;
>                while(rset.next())
>                {
>                        matN = rset.getString("MAT_NUM");
>                        passwd = rset.getString("PWORD");
>                        System.out.println("DB MATNUM IS:"+matN+ " password
is: "+ passwd);
>                        count++;
>                }
> }//end of method
>        public String getMatNumber()
>            {
>            return matN;
>            }
>        public String getPasswd()
>        {
>            return passwd;
>        }
>
> }//end of class
>
>
>
>
>
> Jean-Louis MONTEIRO wrote:
>>
>> Hi,
>>
>> did you give a try to above solutions (more than one instance running)?
>> do you still have problems?
>>
>> Jean-Louis
>>
>>
>> dede90 wrote:
>>>
>>> I am trying to run openejb3.1.1 with my apache tomcat 6.
>>>
>>> i installed openejb to /home/oracle/openejb-3.1.1
>>> I installed apache tomcat to /home/oracle/apache-tomcat-6.0.20
>>> I copied openejb-3.1.1.war to /home/oracle/apache-tomcat-6.0.20/webapps.
>>> I have installed the plugin by going to
>>> http://localhost:8084/openejb/installer
>>>
>>> The installation was successful. However when i run
>>> /home/oracle/apache-tomcat-6.0.20/bin/catalina.sh run, i get the
>>> following error;
>>>
>>>
>>>  /home/oracle/apache-tomcat-6.0.20/bin/catalina.sh run
>>> Using CATALINA_BASE:   /home/oracle/apache-tomcat-6.0.20
>>> Using CATALINA_HOME:   /home/oracle/apache-tomcat-6.0.20
>>> Using CATALINA_TMPDIR: /home/oracle/apache-tomcat-6.0.20/temp
>>> Using JRE_HOME:       /usr/java/jdk1.6.0_16
>>> Apache OpenEJB 3.1.1    build: 20090530-06:18
>>> http://openejb.apache.org/
>>> org.apache.openejb.OpenEJBException:
>>> javax.resource.spi.ResourceAdapterInternalException: Failed to startup an
>>> embedded broker:
>>> openejb:broker:(tcp://localhost:61616)?useJmx=false&persistent=false, due
>>> to: java.io.IOException: Failed to bind to server socket:
>>> tcp://localhost:61616 due to: java.net.BindException: Address already in
>>> use: Failed to startup an embedded broker:
>>> openejb:broker:(tcp://localhost:61616)?useJmx=false&persistent=false, due
>>> to: java.io.IOException: Failed to bind to server socket:
>>> tcp://localhost:61616 due to: java.net.BindException: Address already in
>>> use
>>>         at
>>> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1124)
>>>         at
>>> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:349)
>>>         at
>>> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:272)
>>>         at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
>>>         at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
>>>         at
>>> org.apache.openejb.tomcat.catalina.TomcatLoader.init(TomcatLoader.java:123)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at org.apache.openejb.loader.Embedder.init(Embedder.java:75)
>>>         at
>>> org.apache.openejb.tomcat.loader.TomcatHook.hook(TomcatHook.java:98)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at
>>> org.apache.openejb.tomcat.loader.TomcatEmbedder.embed(TomcatEmbedder.java:77)
>>>         at
>>> org.apache.openejb.tomcat.loader.OpenEJBListener.lifecycleEvent(OpenEJBListener.java:53)
>>>         at
>>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>>>         at
>>> org.apache.catalina.core.StandardServer.initialize(StandardServer.java:770)
>>>         at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
>>>         at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
>>>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
>>> Caused by: javax.resource.spi.ResourceAdapterInternalException: Failed to
>>> startup an embedded broker:
>>> openejb:broker:(tcp://localhost:61616)?useJmx=false&persistent=false, due
>>> to: java.io.IOException: Failed to bind to server socket:
>>> tcp://localhost:61616 due to: java.net.BindException: Address already in
>>> use
>>>         at
>>> org.apache.activemq.ra.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:83)
>>>         at
>>> org.apache.openejb.resource.activemq.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:130)
>>>         at
>>> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1122)
>>>         ... 27 more
>>> Caused by: java.io.IOException: Failed to bind to server socket:
>>> tcp://localhost:61616 due to: java.net.BindException: Address already in
>>> use
>>>         at
>>> org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
>>>         at
>>> org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:88)
>>>         at
>>> org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:56)
>>>         at
>>> org.apache.activemq.transport.TransportFactory.bind(TransportFactory.java:109)
>>>         at
>>> org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:1348)
>>>         at
>>> org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:163)
>>>         at
>>> org.apache.activemq.broker.DefaultBrokerFactory.createBroker(DefaultBrokerFactory.java:55)
>>>         at
>>> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57)
>>>         at
>>> org.apache.openejb.resource.activemq.OpenEjbBrokerFactory.createBroker(OpenEjbBrokerFactory.java:44)
>>>         at
>>> org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:57)
>>>         at
>>> org.apache.activemq.ra.ActiveMQResourceAdapter.start(ActiveMQResourceAdapter.java:80)
>>>         ... 29 more
>>> Caused by: java.net.BindException: Address already in use
>>>         at java.net.PlainSocketImpl.socketBind(Native Method)
>>>         at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
>>>         at java.net.ServerSocket.bind(ServerSocket.java:319)
>>>         at java.net.ServerSocket.<init>(ServerSocket.java:185)
>>>         at java.net.ServerSocket.<init>(ServerSocket.java:141)
>>>         at
>>> javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:163)
>>>         at
>>> org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:80)
>>>         ... 38 more
>>> Oct 6, 2009 11:36:07 PM org.apache.catalina.core.AprLifecycleListener
>>> init
>>> INFO: The APR based Apache Tomcat Native library which allows optimal
>>> performance in production environments was not found on the
>>> java.library.path:
>>> /usr/java/jdk1.6.0_16/jre/lib/i386/client:/usr/java/jdk1.6.0_16/jre/lib/i386:/usr/java/jdk1.6.0_16/jre/../lib/i386:/App01/app/oracle/product/10.2.0/db_1/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/home/oracle/apache-tomcat-6.0.20/lib:/App01/app/oracle/product/10.2.0/db_1/jdbc/lib:/usr/java/packages/lib/i386:/lib:/usr/lib
>>> Oct 6, 2009 11:36:07 PM org.apache.coyote.http11.Http11Protocol init
>>> SEVERE: Error initializing endpoint
>>> java.net.BindException: Address already in use<null>:8084
>>>         at
>>> org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:509)
>>>         at
>>> org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
>>>         at
>>> org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
>>>         at
>>> org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
>>>         at
>>> org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
>>>         at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
>>>         at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
>>>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
>>> Oct 6, 2009 11:36:07 PM org.apache.catalina.startup.Catalina load
>>> SEVERE: Catalina.start
>>> LifecycleException:  Protocol handler initialization failed:
>>> java.net.BindException: Address already in use<null>:8084
>>>         at
>>> org.apache.catalina.connector.Connector.initialize(Connector.java:1060)
>>>         at
>>> org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
>>>         at
>>> org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
>>>         at org.apache.catalina.startup.Catalina.load(Catalina.java:535)
>>>         at org.apache.catalina.startup.Catalina.load(Catalina.java:555)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
>>>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
>>> Oct 6, 2009 11:36:07 PM org.apache.catalina.startup.Catalina load
>>> INFO: Initialization processed in 5345 ms
>>> Oct 6, 2009 11:36:08 PM org.apache.catalina.core.StandardService start
>>> INFO: Starting service Catalina
>>> Oct 6, 2009 11:36:08 PM org.apache.catalina.core.StandardEngine start
>>> INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
>>> context path = /host-manager
>>> context path = /openejb
>>> OpenEJB init-params:
>>> context path = /manager
>>> context path = /docs
>>> context path = /examples
>>> context path =
>>> Oct 6, 2009 11:36:10 PM org.apache.coyote.http11.Http11Protocol start
>>> SEVERE: Error starting endpoint
>>> java.net.BindException: Address already in use<null>:8084
>>>         at
>>> org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:509)
>>>         at
>>> org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:526)
>>>         at
>>> org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:203)
>>>         at
>>> org.apache.catalina.connector.Connector.start(Connector.java:1131)
>>>         at
>>> org.apache.catalina.core.StandardService.start(StandardService.java:531)
>>>         at
>>> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>>>         at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at
>>> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>>>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>>> Oct 6, 2009 11:36:10 PM org.apache.catalina.startup.Catalina start
>>> SEVERE: Catalina.start:
>>> LifecycleException:  service.getName(): "Catalina";  Protocol handler
>>> start failed: java.net.BindException: Address already in use<null>:8084
>>>         at
>>> org.apache.catalina.connector.Connector.start(Connector.java:1138)
>>>         at
>>> org.apache.catalina.core.StandardService.start(StandardService.java:531)
>>>         at
>>> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>>>         at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at
>>> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>>>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>>> Oct 6, 2009 11:36:10 PM org.apache.catalina.startup.Catalina start
>>> INFO: Server startup in 2743 ms
>>> Oct 6, 2009 11:36:10 PM org.apache.catalina.core.StandardServer await
>>> SEVERE: StandardServer.await: create[8005]:
>>> java.net.BindException: Address already in use
>>>         at java.net.PlainSocketImpl.socketBind(Native Method)
>>>         at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
>>>         at java.net.ServerSocket.bind(ServerSocket.java:319)
>>>         at java.net.ServerSocket.<init>(ServerSocket.java:185)
>>>         at
>>> org.apache.catalina.core.StandardServer.await(StandardServer.java:373)
>>>         at org.apache.catalina.startup.Catalina.await(Catalina.java:647)
>>>         at org.apache.catalina.startup.Catalina.start(Catalina.java:607)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:597)
>>>         at
>>> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>>>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>>> Oct 6, 2009 11:36:10 PM org.apache.coyote.http11.Http11Protocol pause
>>> INFO: Pausing Coyote HTTP/1.1 on http-8084
>>> Oct 6, 2009 11:36:11 PM org.apache.catalina.core.StandardService stop
>>> INFO: Stopping service Catalina
>>> Oct 6, 2009 11:36:11 PM org.apache.catalina.connector.MapperListener
>>> destroy
>>> WARNING: Error unregistering MBeanServerDelegate
>>> java.lang.NullPointerException
>>>         at
>>> org.apache.catalina.connector.MapperListener.destroy(MapperListener.java:171)
>>>         at
>>> org.apache.catalina.connector.Connector.stop(Connector.java:1179)
>>>         at
>>> org.apache.catalina.core.StandardService.stop(StandardService.java:593)
>>>         at
>>> org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
>>>         at org.apache.catalina.startup.Catalina.stop(Catalina.java:633)
>>>         at
>>> org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:676)
>>> Oct 6, 2009 11:36:11 PM org.apache.coyote.http11.Http11Protocol destroy
>>> INFO: Stopping Coyote HTTP/1.1 on http-8084
>>> Oct 6, 2009 11:36:11 PM org.apache.catalina.connector.Connector stop
>>> SEVERE: Coyote connector has not been started
>>>
>>> can anyone please help??
>>>
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/I-need-Help%21%21%21%21-tp25778515p25803280.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>

Mime
View raw message