1 Reply Latest reply on Jul 10, 2003 9:38 PM by Jon Barnett

    mySQL DS and how to reach servlets

    Jen Newbie

      I am new to j2ee and moreso to EJB containers!

      I have installed JBOSS 3.2.1 and upgraded mySQL to v4.1 and am using driver mysql-connector-java-3.0.8 which I put in the C:\JBOSS_HOME\server\default\lib

      then i copied the mySQL-ds.xml file from C:\JBOSS_HOME\docs\examples\jca to \deploy and changed a few things


      <local-tx-datasource>
      <jndi-name>MySql</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/valentines</connection-url>
      <driver-class>com.mysql.jdbc.driver</driver-class>
      <user-name></user-name>

      </local-tx-datasource>



      and I deleted hsqldb-ds.xml from \deploy
      SHould jndi-name be DefaultDS here?

      then I changed any instance of Hypersonic DS to mySQL in two files
      C:\JBOSS_HOME\server\default\conf\standardjaws.xml
      and
      C:\JBOSS_HOME\server\default\conf\standardjbosscmp-jdbc.xml

      I've gotten a simple HelloWorld app to work and now am trying to work with session beans. With the hello example i typed localhost:8080/Hello and it worked

      for the session example I've tried the same thing- put my beans in a jar file in the \deploy dir and create a dir there with a .war extention
      /deploy
      /MyApplication.war
      /images
      /META-INF
      /WEB-INF
      web.xml
      jboss-web.xml
      /classes
      All your servlets go in here.

      and so I map the servelt to /search and tried to call it the same way- am I in the wrong context? What do I need to do to get this to work? Am I missing a deployment descripter? Do I have to war the servlets in order to test them? If so where do I save the actual classes and where to put the war?

      Any help would be great as I am on my last nerve!! Can I do my entire j2ee app in JBOSS? Do I need the one bundles w/tomcat? I promise to post when I get it sorted too!
      Thanks,
      Jen

        • 1. Re: mySQL DS and how to reach servlets
          Jon Barnett Master

          Since your new application is in MyApplication.war, you application context will define your URL to be:
          http://localhost:8080/MyApplication

          If you just type that in, it will look for a welcome file at the root level of your context (index.html, index.htm or index.jsp). So if you want to see something there when you type that in, put one of these files in server/default/deploy/MyApplication.war of your JBoss distribution.

          Your servlets should go in your classes subdirectory. Since you have mapped your servlet to /search (in the local WEB-INF/web.xml), the URL would be
          http://localhost:8080/MyApplication/search.

          I don't think we even get near your DS problem yet.

          Yes, you can do all your EJB/Servlet/JMS development in JBoss. No you don't really need to get the Tomcat bundle - the current default with Jetty (the servlet container) is fine. It chews less resource anyhow.

          Hope that helps.