Compile problem using TOMCAT 5.0 and Apache ANT

I got some sample from book.
i just follow the step, place it the class file. it work. it run. show all the detail.
but when i wan to compile it from java file, error came out
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error allocating a servlet instance
     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
     org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
     org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
     org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
     org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
     java.lang.Thread.run(Unknown Source)
root cause
java.lang.NoClassDefFoundError: com/jspbook/HelloWorld (wrong name: HelloWorld)
     java.lang.ClassLoader.defineClass1(Native Method)
     java.lang.ClassLoader.defineClass(Unknown Source)
     java.security.SecureClassLoader.defineClass(Unknown Source)
     org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
     org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
     org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
     org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
     org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
     org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
     org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
     org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
     java.lang.Thread.run(Unknown Source)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.in CMD:
set java_home = C:\Program Files\Java\jdk1.5.0_08
set classpath = C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib
and Apache tomcat originally dont have servlet.jar but servlet-api.jar, i copy the servlet.jar from my friend
i compile it using Apache ANT
here the build.xml
<?xml version="1.0" ?>
<project name="jspbook" default="build" basedir=".">
  <target name="build">
    <echo>Starting Build </echo>
    <!-- Turn Tomcat Off -->
    <antcall target="tomcatOff"/>
    <!-- Compile Everything -->
    <antcall target="compile"/>
    <!-- Turn Tomcat On -->
    <antcall target="tomcatOn"/>
    <echo>Build Finished </echo>
  </target>
  <target name="tomcatOff">
    <echo>Turning Off Tomcat </echo>
    <exec executable="bash" os="Windows">
      <arg value="../../bin/shutdown.bat"/>
    </exec>
    <exec executable="bash" os="Linux">
      <arg value="../../bin/shutdown.sh"/>
    </exec>
  </target>
  <target name="tomcatOn">
    <echo>Starting Tomcat </echo>
    <exec executable="bash" os="Windows">
      <arg value="../../bin/startup.bat"/>
    </exec>
    <exec executable="bash" os="Linux">
      <arg value="../../bin/startup.sh"/>
    </exec>
  </target>
  <target name="compile">
    <javac
      srcdir="WEB-INF/classes"
      extdirs="WEB-INF/lib:../../common/lib"
      classpath="../../common/lib/servlet.jar"
      deprecation="yes"
      verbose="no">
      <include name="com/jspbook/**"/>
    </javac>
  </target>
</project>compile success, but error in IE
paste the sample class file in,restart tomcat. i work again!
what is the problem!
even i compile the code inside the Jcreator, after set required libraries to servlet.jar or servlet-api.jar
compile it, success then run it in IE, same error!!!.
what should i do.
stil a beginer in servlet and jsp anyway.

and Apache tomcat originally dont have servlet.jar but servlet-api.jar, i copy the servlet.jar from my friend servlet.jar is an OLD version, you should only use servlet-api.jar!
wrong name: HelloWorldPerhaps there is a mistake in the class or packagename of the source file. Post the source here.

Similar Messages

  • Annotation processing using JDK 1.6 and Apache Ant

    Hello,
    I am trying to run my annotation processor using ant.
    I already built the processor, the javax.annotation.processor.Processor file is in the correct place with the correct content.
    The jar with the processor is in the classpath (i can see it in ant -v), but it does not process my classes. in fact, i get the warning:
    warning: Annotation processing without compilation requested but no processors were found.Do i have to specify -processor or -processorpath or can i just leave it to the default classpath scanning?
    I think everything is in the correct place, because when i compile with maven instead of ant, specifying the processor, it runs nicely. My pom contains:
                   <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                             <source>1.6</source>
                             <target>1.6</target>
                             <compilerArguments>
                                  <processor>br.com.sonner.infra.seguranca.SegurancaAnnotationProcessor</processor>
                             </compilerArguments>
                        </configuration>
                   </plugin>i am using jdk 1.0.6_02 and ant 1.7.0.
    Can anyone help me find out what am i doing wrong?

    Julio.Faerman wrote:
    Hello,
    I am trying to run my annotation processor using ant.
    I already built the processor, the javax.annotation.processor.Processor file is in the correct place with the correct content.
    The jar with the processor is in the classpath (i can see it in ant -v), but it does not process my classes. in fact, i get the warning:
    warning: Annotation processing without compilation requested but no processors were found.Do i have to specify -processor or -processorpath or can i just leave it to the default classpath scanning?When -processor is not given, a service loader is used to find the annotation processors (if any). In addition to the class files of the process, to allow your processor to be found as a service, make sure you've also provided the needed META-INF data in the jar file. The general service file format is described in
    http://java.sun.com/javase/6/docs/api/java/util/ServiceLoader.html
    That said, I'd recommend setting an explicit processor path separate from your general classpath.

  • Tomcat 4.0 and Apache 2.0.35

    Hello,
    I am trying to install mod_jk or mod_webapp.so with Tomcat 4.0 and Apache 2.0.35, running on Windows XP Professional. When I try to start Apache, it fails to see it the new module in the modules/ directory, even though it's most definitely there. Anybody have any thoughts?

    The Tomcat 4 has different settings compared to the previous releases (Tomcat 3.3.x and Tomcat 3.2.x). If the previous releases use mod_jk.dll and/or mod_jk.so, the version 4 uses different modules. I have obtained the following from the server.xml file from Tomcat 4.0.3.
    The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
    as its servlet container. Please read the README.txt file coming with
    the WebApp Module distribution on how to build it.
    (Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
    To configure the Apache side, you must ensure that you have the
    "ServerName" and "Port" directives defined in "httpd.conf". Then,
    lines like these to the bottom of your "httpd.conf" file:
    LoadModule webapp_module libexec/mod_webapp.so
    WebAppConnection warpConnection warp localhost:8008
    WebAppDeploy examples warpConnection /examples/
    The next time you restart Apache (after restarting Tomcat, if needed)
    the connection will be established, and all applications you make
    visible via "WebAppDeploy" directives can be accessed through Apache.

  • Hi. I am just about to move from the UK to Kuwait. Will I have any problems using my iPhone 4 and able to join a local carrier using this device please?

    Hi. I am just about to move from the UK to Kuwait. Will I have any problems using my iPhone 4 and able to join a local carrier using this device please?

    If your phone is locked to a particular carrier, you must contact them to request they unlock it. Once they've taken care of that and you've followed the instructions to complete the unlock process, you will be able to use the phone elsewhere.
    ~Lyssa

  • Any Problems using SSL with Safari and the move with Internet explorer to require only TLS encryption.

    Any Problems using SSL with Safari and the move with Internet explorer to require only TLS encryption.

    Hi .
    Apple no longer supports Safari for Windows if that's what you are asking >  Apple apparently kills Windows PC support in Safari 6.0
    Microsoft has not written IE for Safari for many years.

  • Problem using Tomcat 4.1

    I'm trying to establish connection with the database from JSP.When I'm running it's giving the following error
    "oracle.jdbc.driver.Oracle.Driver class not found"
    I'm using Tomcat 4.1 and database is Oracle 8i.I've already set the classpath."C:\oracle\ora92\jdbc\lib"(Oracle is intalled in C drive).
    Kindly help me resolve this issue.
    Bye.

    Tomcat does not use the system classpath.
    As far as Tomcat is concerned the classpath for a web app is
    1 - web-inf/classes
    2 - jar files in web-inf/lib
    3 - jar files in [TOMCAT]/shared/lib
    4 - jar files in [TOMCAT]/common/lib
    If you are going to be using Tomcat's connection pooling, you need the JDBC driver jar file in [TOMCAT]/common/lib
    I would recommend you put the file ojdbc14.jar (or equivalent) in the [TOMCAT]/common/lib directory
    Restart tomcat, and try again.
    Cheers,
    evnafets

  • Does anyone have problems using the  highlights, shadows and sharpness edits in iphoto? Since I uploaded Mountain Lion, those editing tabs do not work!

    Does anyone have problems using the highlights, shadows and sharpness controls in iphoto 11? Since I uploaded Mountain Lion on my
    mac mini, those editing features no longer work!!!!

    Sorry, I booted into 10.8 just to test this, but I only have iPhoto 08.

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • Problems with Tomcat 4.0 and jdk 1.3.1 (jsp:include) Help Gurus...

    Im running examples of the include:
    <jsp:include page="xxx.jsp" flush="true">
    and received error:
    org.apache.jasper.JasperException: No se puede compilar la clase para JSP
    An error occurred at line: 17 in the jsp file: /jsp/include/include.jsp
    Generated servlet error:
    /Programas/Tomcat4/work/localhost/examples/jsp/include/include$jsp.java:79: Method include(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, javax.servlet.jsp.JspWriter, boolean) not found in class org.apache.jasper.runtime.JspRuntimeLibrary.
    JspRuntimeLibrary.include(request, response, "/jsp/include/foo.html" + jspxqStr, out, true);
    ^
    Please Help me Im running this equal with:
    <%@ include file="xxx.jsp" %>
    and runnig fine....

    The two means of including files are different in their approach.
    Using <jsp:include .../> compilation of the included jsp is done at run -time not during compilation.
    Using <%@ include .../> compiles at compile time.
    Looking at the error it seems that the method JspRuntimeLibrary.include is not being found which suggests that you may have a classpath problem. Check that there is not a servlet.jar in the classpath that is from a earlier spec than the one provided with Tomcat.
    Dave

  • Using tomcat 5 along with apache 2.2

    hi
    i am facing a strange problem
    i am trying to build a web application using servlets with tomcat 5 and apache 2.2 and i am using oracle 10g as the data base
    now when try to access the database from my pc it works fine but when i try to access it from other pc through lan its showing an exception
    i am using mod_jk connector to forward the servlets requests to tomcat.
    log file looks like this
    2009-02-01 00:04:07 StandardContext[manager]HTMLManager: init: Associated with Deployer 'localhost'
    2009-02-01 00:04:07 StandardContext[manager]HTMLManager: init: Global resources are available
    2009-02-01 00:04:07 StandardContext[manager]HTMLManager: list: Listing contexts for virtual host 'localhost'
    2009-02-01 00:04:23 StandardWrapperValve[home]: Servlet.service() for servlet home threw exception
    java.lang.NullPointerException
    at Home.doGet(Home.java:26)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Unknown Source)
    please help me its my semister project
    thanking you

    ronit wrote:
    java.lang.NullPointerException
    at Home.doGet(Home.java:26)Some object reference at the mentioned line inside the mentioned method of the mentioned class is null while the code is trying to access/invoke it.
    The solution should be obvious: make sure that it is not null, or only access/invoke it when it is not null.
    That said, and apart from this specific problem, you should always be placing classes in packages. Not doing so is a bad practice and also asking for trouble.

  • JSP Compilation Problem in Tomcat 5.0.28

    I am having problem after i deploy my applcation in tomcat 5.0.28. While accessing a jsp an excpetion is generated:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Help on this is appricated.
    -Nilesh

    Show me the code

  • Dynamic class loading problem using unknown JAR archive and directory names

    I read the following article, which enlightened me a lot:
    Ted Neward: Understanding Class.forName().
    However, it took me some while to understand that my problem is the other way around:
    I know the name of the class, I know the name of the method,
    but my program/JVM does not know where to load the classes from.
    Shortly, my problem is that the server engine that I am writing
    uses two different versions of the same library.
    So I am trying out the following solution:
    My program is named TestClassPathMain.java
    Assume the two libraries are named JAR1.jar and JAR2.jar
    and the class/instance method that should
    be exposed to TestClassPathMain.java by them is named
    TestClass1.testMethod().
    As long as I was depending on just one library,
    I put JAR1.jar in the classpath before starting java,
    and I was happy for a while.
    At the moment I got the need to use another version of
    TestClass1.testMethod() packaged in JAR2.jar,
    a call would always access JAR1.jar's
    TestClass1.testMethod().
    I then decided to remove JAR1.jar from the classpath,
    and programmatically define two separate ClassLoaders, one for use
    with JAR1.jar and the other for use with JAR2.jar.
    However, the problem is only partly solved.
    Please refer to the enclosed code for details.
    (The code in the JAR1.jar/JAR2.jar is extremely simple,
    it just tells (by hardcoding) the name of the jar it is packaged in
    and instantiates another class packaged in the same jar using
    the "new" operator and calls a method on it. I don't enclose it.)
    The TestClassPathMain.java/UC1.java/UC2.java code suite was
    successfully compiled with an arbitrary of JAR1 or JAR2 in the classpath,
    however removed from the classpath at runtime.
    (I know that this could have been done (more elegantly...?) by producing an Interface,
    but I think the main problem principle is still untouched by this potential lack of elegancy(?))
    1) This problem should not be unknown to you experts out there,
    how is it generally and/or most elegantly solved?
    The "*** UC2: Variant 2" is the solution I would like best, had it only worked.
    2) And why arent "*** UC2: Variant 2" and
    "*** static UC2: Variant 2" working,
    while "*** Main: Variant 2" is?
    3) And a mal-apropos:
    Why can't I catch the NoClassDefFoundError?
    The output:
    *** Main: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** Main: Variant 2 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** Main: Variant 2 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** UC1: Variant 1 JAR 1 ***:
    Entering TestClass1.testMethod() packaged in JAR1.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR1.jar
    *** UC1: Variant 1 JAR 2 ***:
    Entering TestClass1.testMethod() packaged in JAR2.jar
    About to instantiate TestClass2 with the new operator
    About to call TestClass2.testMethod()
    Entering TestClass2.testMethod() packaged in JAR2.jar
    *** static UC2: Variant 2 JAR 1 ***:
    Exception in thread "main" java.lang.NoClassDefFoundError: TestClass1
            at UC2.runFromJarVariant2_static(UC2.java:56)
            at TestClassPathMain.main(TestClassPathMain.java:52)
    TestClassPathMain.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class TestClassPathMain {
        public static void main(final String args[]) throws MalformedURLException, ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
                // Commented out because I cannot catch the NoClassDefFoundError.
                // Why?
                try {
                    final TestClass1 testClass1 = new TestClass1();
                    System.out.println(
                        "\nThe class TestClass1 is of some unexplicable reason available." +
                        "\nFor the purpose of the test, it shouldn't have been!" +
                        "\nExiting");
                    System.exit(1);
                } catch (NoClassDefFoundError e) {
                    System.out.println("\nPositively confirmed that the class TestClass1 is not available:\n" + e);
                    System.out.println("\n\nREADY FOR THE TEST: ...");
                // Works fine
                System.out.println("\n*** Main: Variant 1 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 1 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                System.out.println("\n*** Main: Variant 2 JAR 1 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** Main: Variant 2 JAR 2 ***:");
                runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Works fine
                final UC1 uc1 = new UC1();
                System.out.println("\n*** UC1: Variant 1 JAR 1 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC1: Variant 1 JAR 2 ***:");
                uc1.runFromJarVariant1("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                System.out.println("\n*** static UC2: Variant 2 JAR 1 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** static UC2: Variant 2 JAR 2 ***:");
                UC2.runFromJarVariant2_static("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
                // Crashes
                final UC2 uc2 = new UC2();
                System.out.println("\n*** UC2: Variant 2 JAR 1 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP1/JAR1.jar");
                System.out.println("\n*** UC2: Variant 2 JAR 2 ***:");
                uc2.runFromJarVariant2("file:/W:/java/eclipse/workspaces/simped_test/CP2/JAR2.jar");
        private static void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
        private static void runFromJarVariant2(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    UC1.java
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC1 {
        public void runFromJarVariant1(final String jarFileURL)
            throws MalformedURLException,
                   ClassNotFoundException,
                   InstantiationException,
                   IllegalArgumentException,
                   IllegalAccessException,
                   InvocationTargetException,
                   SecurityException,
                   NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final Object testClass1 = clazz.newInstance();
            final Method testMethod1 = clazz.getMethod("testMethod", null);
            testMethod1.invoke(testClass1, null);
    UC2.java
    import java.lang.reflect.InvocationTargetException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLClassLoader;
    public class UC2 {
        public void runFromJarVariant2(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
         * Identic to the "runFromJarVariant2" method,
         * except that it is static
        public static void runFromJarVariant2_static(final String jarFileURL)
        throws MalformedURLException,
               ClassNotFoundException,
               InstantiationException,
               IllegalArgumentException,
               IllegalAccessException,
               InvocationTargetException,
               SecurityException,
               NoSuchMethodException {
            final URL url = new URL(jarFileURL);
            final URLClassLoader cl =
                new URLClassLoader(new URL[]{url},
                                   Thread.currentThread().getContextClassLoader());
            final Class clazz = cl.loadClass("TestClass1");
            final TestClass1 testClass1 = new TestClass1();
            testClass1.testMethod();
    }

    2. i need to load the class to the same JVM (i.e. to
    the same environment) of the current running
    aplication, so that when the loaded class is run, it
    would be able to invoke methods on it!!!
    ClassLoader(s) do this. Try the URLClassLoader.
    (I was talking about relatively esoteric "security"
    issues when I mentioned the stuff about Class objects
    "scope".) You might use the URLClassLoader kind of
    like this.
    Pseudo-code follows:
    // setup the class loader
    URL[] urls = new URL[1];
    urls[0] = new URL("/path/to/dynamic/classes");
    URLClassLoader ucl = new URLClassLoader(urls);
    // load a class & use make an object with the default constructor
    Object tmp = ucl.loadClass("dynamic.class.name").newInstance();
    // Cast the object to a know interface so that you can use it.
    // This may be used to further determine which interface to cast
    // the class to. Or it may simply be the interface to which all
    // dynamic classes have to conform in your program.
    InterfaceImplementedByDynamicClass loadedObj =
        (InterfaceImplementedByDynamicClass)tmp;It's really not as hard as it sounds, just write a little test of
    this and you will see how it works.

  • Problems with Tomcat 5.5 and 6 - HTTP Status 404

    I'm trying to make this simple "*Hello World*" Application from here
    When I try to run the application.
    From Tomcat:
    HTTP Status 404 -
    type Status report
    message
    description The requested resource () is not available.
    Apache Tomcat/5.5.27From Intellij:
    cmd /c C:\tomcat\bin\catalina.bat run
    Using CATALINA_BASE:   C:\Documents and Settings\User\.IntelliJIdea8x\system\tomcat\Unnamed_FirstProject994ff1db1
    Using CATALINA_HOME:   C:\tomcat
    Using CATALINA_TMPDIR: C:\tomcat\temp
    Using JRE_HOME:        C:\Program Files\Java\jdk1.6.0_13
    18.05.2009 11:32:59 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:
    C:\Program Files\Java\jdk1.6.0_13\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Java\jdk1.6.0_13\bin\;
    18.05.2009 11:33:00 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    18.05.2009 11:33:00 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2939 ms
    18.05.2009 11:33:00 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    18.05.2009 11:33:00 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
    18.05.2009 11:33:03 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    INFO: Parsing configuration file [struts-default.xml]
    18.05.2009 11:33:04 org.apache.catalina.core.StandardContext start
    SEVERE: Error filterStart
    18.05.2009 11:33:04 org.apache.catalina.core.StandardContext start
    SEVERE: Context [] startup failed due to previous errors
    18.05.2009 11:33:06 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    18.05.2009 11:33:06 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    18.05.2009 11:33:06 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/187  config=null
    18.05.2009 11:33:06 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 6415 ms
    Connected to server

    I don't know what should I exclude from the log file, so I will leave the whole thing:
    [Filefront Link|http://files.filefront.com/localhost2009+05+18log/;13773865;/fileinfo.html]
    Some lines from the log:
    SEVERE: Exception starting filter Struts 2 filter
    Unable to load configuration. - bean - jar:file:/C:/Documents%20and%20Settings/user/My%20Documents/NetBeansProjects/WebApplication2/build/web/WEB-INF/lib/struts2-core-2.1.6.jar!/struts-default.xml:46:178
    Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest - bean - jar:file:/C:/Documents%20and%20Settings/user/My%20Documents/NetBeansProjects/WebApplication2/build/web/WEB-INF/lib/struts2-core-2.1.6.jar!/struts-default.xml:46:178
    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUploadException
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileUploadExceptionEdited by: asemenea on May 18, 2009 2:22 AM

  • Help!!! I have a compiling problem using rfcsdk

    Hello.
    I have a compiling problem.
    My server is  SUN OS 5.9.
    And I made a rfcsdk folder.
    When I used gcc comiler I had a error message as below.
    %>cat mk_gcc2
    gcc  -funsigned-char  -Wcast-align -fPIC -c -I.  -I/home/user/rfcsdk_32/include        -L/home/user/rfcsdk_32/lib  $1.c
    gcc    -funsigned-char    -L/home/user/rfcsdk_32/lib    -o $1 $1.o  -I/home/user/rfcsdk_32/lib/librfccm.so  -laio  -lm   -lrfc   -L.  -lsocket -lnsl -lw -ldl
    %>
    %>
    %>mk_gcc2 plantcl
    &#51221;&#51032;&#46104;&#51648; &#50506;&#51020;                   &#52395;&#48264;&#51704; &#52280;&#51312;&#46108;
    &#44592;&#54840;                       &#54028;&#51068;&#51032;
    __1cG__CrunKpure_error6F_v_         /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    __1cG__CrunKvector_con6FpvIIpF1_vp2_v_ /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    __1cG__CrunMex_rethrow_q6F_v_       /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    c::c(N6,  (int0_t))                 /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    c::c(n6,  (int0_t))                 /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    __1c2K6Fpv_v_                       /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    __1c2k6Fpv_v_                       /home/user/rfcsdk_32/lib/librfc.a(cpictlib.o)
    ld: &#52824;&#47749;&#51201;: &#44592;&#54840; &#52280;&#51312; &#50724;&#47448;. plantcl&#50640; &#52636;&#47141;&#51060; &#44592;&#47197;&#46104;&#51648; &#50506;&#51020;
    collect2: ld returned 1 exit status
    %>
    %>
    Do anyone have a idea about this kinds of errors ?
    I couldn't find any reference from the internet and documents.
    I'll thank you very much if you recommend me.

    Trying
    <description><![CDATA[About 4 PM , March 31,1917.
    The salute from the Fort Christian&rsquo;s Saluting Battery as
    the Captain and officers leave the USS Hancock on their way to
    shore to take over the Danish West
    Indies.]]></description>
    This fixes the
    onmouseover="ShowToolTip('{dsPhotos::description}') problem,
    BUT
    <p>{dsPhotos::description}</p>
    now appears as
    'About 4 PM , March 31,1917. The salute from the Fort
    Christian&rsquo;s Saluting ..."
    with the undesireable &rsquo; instead of '.
    So my problem requires both html translation and javascript
    argument quoting/non-parsing.
    Any ideas?

  • Error Compiling when using RGB Color Corrector and Unsharp Mask

    If I apply the RGB Color Corrector and and Unsharp mask to a clip within a sequence and try to render the sequence or a small portion of the work area I get the Error Compiling: Unknown error.
    This is occurring within a project I have updated to Premiere CS6 from Premiere CS5. 
    I have tried creating a new sequence and importing the same clip and other clips.  Anytime I try to use both the Unsharp Mask and RGB Color Corrector I am unable to render.  I have tried this with Mercury Playback both in hardware and software modes with the same result.
    Has anyone else seen something like this?

    Okay, glad this occurs for others too and I am not experiencing something isolated. The issue here is this shouldn't be happening at all. 
    Premiere CS5 has no problem with this.
    Yeah if I turn off one effect or the other no problem.  Unfortunately it doesn't matter the order I place the effects in I get the same error regardless of which is placed first.
    Nesting does work.  If I create a sequence, apply one or the other to the clip in the sequence then embed the sequence in another sequence and apply the remaining filter to the sequence containing the clip then I can get my color correction and edge definition.  But this is a work around. 
    There seems to a bug here since there were no issues when using RGB Color Corrector and Unsharp Mask simultaneously applied to one clip in CS5.  I doubt there will be a fix for this anytime soon so it looks like I will have to use another method for color correcting or apply RGB color correction to clips already embedded in a sequence as I move forward into solely using CS6.
    (How this can become an issue is that after applying effects and color correction to several clips within a sequence I like to render that entire sequence.  Then this sequence is ebedded in another main sequence and I can add additional effects and transitions and overlays without killing the live playback speed and only have to render smaller amounts of content from additional tracks.  It ends up saving a lot of time after the initial length of rendering.)
    Thanks for the suggestions.

Maybe you are looking for

  • Installation of RAC with ASM on Solaris

    Hello Everybody I have to install and config oracle 10g RAC and ASM on Solaris, and as per my understanding network prerequisite is 3 IP's for each node, 1) A public IP's registered on DNS and 2) A virtual IP's registered on DNS, but NOT defined in t

  • HT4854 how to re download mountain lion on my mac book pro

    i deleted from purchases accedently but i just downloaded it to mac but now if i go into app store on my laptop it says the price of the app and i dont want to pay for it again

  • Builder and IMAQ 1408

    Can anyone tell me how, using Borland Builder 3, I can acquire images from the IMAQ 1408 card? Melvyn.

  • Lifetime and behavior of the String Constant Pool

    If you 'inline' a String constant in Java, I'm aware in the VM spec that it says this String is put in the constant pool. What is the lifetime of the constant pool and what is it tied to? Is there one constant pool per Class, per Class instance, or p

  • ACNS, bypass list, server-error

    Im using Content Engine Module in Cisco 3700 to transparently monitor Webtraffic to an upstream Squid Proxy. Unfortunatly I'm getting a lot of bypass packets. Every request is leading to insert the upstream proxy into the bypass list (Entry type "ser