title: how to call java.class from web.xml?
body: <p>i've problem when try to call java class from web.xml, when i'm running my application i'cant load my class/method ? <br/></p>
  
  <p>in my application : <br/>
  jsf 2.0 <br/>
  primefaces 3.1.1 <br/>
  springframework 3.0.2<br/></p>
  
  <p>please help me</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Production&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/app-config.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.FACELETS_LIBRARIES&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/springsecurity.taglib.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/app-config.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Spring MVC Dispatcher Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.security.web.session.HttpSessionEventPublisher&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;filter&gt;
      &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;Mama&lt;/servlet-name&gt;
      &lt;servlet-class&gt;hobic.controller.Mama&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Mama&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/hobic.controller&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Mama.java</p>
  
  <pre><code>public class Mama extends HttpServlet{
  
  public Mama() {
      super();
  }
  
  public void metalica() {
      System.out.println("nothing else matter");
      JOptionPane.showMessageDialog(null, "nothing else matter");
  }
  }
  </code></pre>
  
  <p>error</p>
  
  <pre><code>SEVERE: Exception while visiting CryptoMeWindow$1.class of size 122769
  java.lang.ArrayIndexOutOfBoundsException: 130207
      at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
      at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
      at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
      at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:362)
      at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:171)
      at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:133)
      at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)
      at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)
      at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)
      at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  
  INFO: SEC1002: Security Manager is OFF.
  INFO: SEC1010: Entering Security Startup Service
  INFO: SEC1143: Loading policy provider    com.sun.enterprise.security.provider.PolicyWrapper.
  INFO: SEC1115: Realm [admin-realm] of classtype  [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
  INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
  INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
  INFO: SEC1011: Security Service(s) Started Successfully
  INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
  INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
  INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
  INFO: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]
  INFO: WEB0171: Created virtual server [server]
  INFO: WEB0171: Created virtual server [__asadmin]
  INFO: WEB0172: Virtual server [server] loaded default web module []
  INFO: JTS5014: Recoverable JTS instance, serverId = [3700]
  INFO: Portable JNDI names for EJB TestSessionBean : [java:global/Hobic/Hobic-   ejb/TestSessionBean!hobic.view.TestSessionBeanRemote, java:global/Hobic/Hobic- ejb/TestSessionBean]
  INFO: Glassfish-specific (Non-portable) JNDI names for EJB TestSessionBean :   [hobic.view.TestSessionBeanRemote#hobic.view.TestSessionBeanRemote,  hobic.view.TestSessionBeanRemote]
  INFO: Initializing Mojarra 2.1.3 (FCS b02) for context '/Hobic-war'
  INFO: Instantiated an instance of  org.hibernate.validator.engine.resolver.JPATraversableResolver.
  WARNING: JSF1074: Managed bean named 'loginBean' has already been registered.     Replacing existing managed bean class type hobic.controller.LoginBean with  hobic.controller.LoginBean.
  INFO: Running on PrimeFaces 3.1.1
  INFO: PWC1412: WebModule[null] ServletContext.log():Initializing Spring root  WebApplicationContext
  SEVERE: log4j:WARN No appenders could be found for logger  (org.springframework.web.context.ContextLoader).
  SEVERE: log4j:WARN Please initialize the log4j system properly.
  SEVERE: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more  info.
  INFO: Instantiated an instance of  org.hibernate.validator.engine.resolver.JPATraversableResolver.
  INFO: PWC1412: WebModule[null] ServletContext.log():Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet'
  INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
  INFO: WEB0671: Loading application [Hobic#Hobic-war.war] at [Hobic-war]
  INFO: Hobic was successfully deployed in 45,269 milliseconds.
  </code></pre>