3 Replies Latest reply on Oct 11, 2012 6:57 AM by Nicklas Karlsson

    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from [Module .... from service Module Loader]

    Deniel M Newbie

      im use AS 7 in intellij idea 11.1.3

       

      i get error Kesalahan pada 1 : java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from [Module "deployment.koneksidatabase_war_exploded.war:main" from Service Module Loader]

       

       

      my source is :

       

       

      <HTML>

      <HEAD>

          <TITLE>Tes Koneksi Database</TITLE>

      </HEAD>

      <BODY>

      <%@page import="java.sql.Connection,java.sql.DriverManager,java.sql.Statement,java.sql.ResultSet" %>

      <%

          boolean ada_kesalahan = false;

       

          try{

              Class.forName("com.mysql.jdbc.Driver");

          }

          catch (Exception ex){

              out.println("Kesalahan pada 1 : " + ex);

              ada_kesalahan = true;

          }

          if (!ada_kesalahan){

              Connection koneksi = null;

              try{

                  koneksi = DriverManager.getConnection("jdbc:mysql://localhost/projectaaa");

                  out.println("koneksi berhasil");

              }

              catch (Exception ex) {

                  out.println("kesalahan 2 pada :" + ex);

                  ada_kesalahan = true;

              }

              if (!ada_kesalahan){

                  ResultSet hasilquery =null;

                  try{

                      Statement statement = koneksi.createStatement();

                      hasilquery = statement.executeQuery(

                              "select id_pengguna, pengguna,sandi from projectaaa.koneksi"

                      );

                  }

                  catch (Exception ex){

                      out.println("Kesalahan 3 : " +ex);

                      ada_kesalahan = true;

                  }

                  if (!ada_kesalahan){

                      out.println("<Tabel Border = \"1\">");

                       out.println("<tr><th>ID</th><th>Pengguna</th>"+"<th>sandi</th></tr>");

                      try {

                          while (hasilquery.next()){

                              String id_pengguna = hasilquery.getString("id_pengguna");

                              String pengguna = hasilquery.getString("pengguna");

                              String sandi = hasilquery.getString("sandi");

       

                              out.println("<tr><td>" + id_pengguna + "</td><td>" + pengguna + "</td><td>" + sandi +"</td></tr>");

                          }

                      }

                      catch (Exception ex){

                          out.println("kesalahan 4 : "+ex);

                      }

                      out.println("</table>");

                  }

              }

          }

       

       

      %>

      </BODY>

      </HTML>

       

       

       

       

       

       

       

       

       

      C:\jboss-as-7.1.1.Final\bin\standalone.bat

      Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"

      ===============================================================================

       

        JBoss Bootstrap Environment

       

        JBOSS_HOME: C:\jboss-as-7.1.1.Final

       

        JAVA: C:\Program Files (x86)\Java\jdk1.7.0_07\bin\java

       

        JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.config=standalone.xml

       

      ===============================================================================

       

      [2012-10-11 04:37:41,872] Artifact koneksidatabase:war exploded: Server is not connected. Press 'Deploy' to start deployment.

      16:37:42,526 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

      16:37:42,848 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

      16:37:42,933 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

      16:37:44,282 INFO  [org.xnio] XNIO Version 3.0.3.GA

      16:37:44,284 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)

      16:37:44,300 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA

      16:37:44,314 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA

      16:37:44,345 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

      16:37:44,350 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem

      16:37:44,398 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

      16:37:44,439 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

      16:37:44,453 INFO  [org.jboss.as.connector] (MSC service thread 1-8) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

      16:37:44,498 INFO  [org.jboss.as.naming] (MSC service thread 1-3) JBAS011802: Starting Naming Service

      16:37:44,503 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]

      16:37:44,507 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

      16:37:44,561 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

      16:37:44,576 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem

      16:37:44,622 INFO  [org.jboss.as.security] (MSC service thread 1-1) JBAS013100: Current PicketBox version=4.0.7.Final

      16:37:44,637 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      16:37:44,900 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-7) JBoss Web Services - Stack CXF Server 4.0.2.GA

      16:37:45,360 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.1.Final\standalone\deployments

      16:37:45,439 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on /127.0.0.1:9999

      16:37:45,440 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:4447

      16:37:45,468 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-7) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080

      16:37:45,833 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      16:37:45,870 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "mysql-connector-java-5.0.8-bin.jar"

      16:37:46,087 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015951: Admin console listening on http://127.0.0.1:9990

      16:37:46,088 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 4079ms - Started 153 of 230 services (76 services are passive or on-demand)

      16:37:46,144 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "mysql-connector-java-5.0.8-bin.jar"

      Connected to server

      [2012-10-11 04:37:46,267] Artifact koneksidatabase:war exploded: Artifact is being deployed, please wait...

      16:37:46,346 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "koneksidatabase_war_exploded.war"

      16:37:47,141 INFO  [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /koneksidatabase_war_exploded

      16:37:47,172 INFO  [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "koneksidatabase_war_exploded.war"

      [2012-10-11 04:37:47,194] Artifact koneksidatabase:war exploded: Artifact is deployed successfully

       

       

      what  i must to do ? i'm newbie here

       

      i'm really nead help ...