Discussions

XML & Web services: Unable to compile class for JSP

  1. Unable to compile class for JSP (23 messages)

    When using the "DocumentBuilderFactory" and the other set of objects that go with it, I get the error in the subject line. Here's my code:

    String fileName= "http://slashdot.org/slashdot.rss";
    int listLength, listLengthAuthors;
    try {

    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

    //Read XML file
    //Open the file for reading:
    URL u = new URL(fileName);
    InputStream inputXML = u.openStream();

    //Build document:
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(inputXML);

    //Generate the NodeList;
    org.w3c.dom.NodeList nodeList = document.getElementsByTagName("item");
    listLength = nodeList.getLength(); // how many elements there are

    // Query through XML File
    for (int i=0; i<nodeList.getLength(); i++) {
    String elementTitle = document.getElementsByTagName("title").item(i).getFirstChild().getNodeValue();
    String elementLink = document.getElementsByTagName("link").item(i).getFirstChild().getNodeValue();
    String elementDescription = document.getElementsByTagName("description").item(i).getFirstChild().getNodeValue();
    String elementReleaseDate = document.getElementsByTagName("date").item(i).getFirstChild().getNodeValue();

    ...
    //HTML code to output the variables above...
    ...
    }
     
    catch (Exception e) {
          System.err.println("Exception: " + e.getMessage());
        }


    I then get the following error:


    org.apache.jasper.JasperException: Unable to compile class for JSP

    No Java compiler was found to compile the generated source for the JSP.
    This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
    to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
    If using an alternate Java compiler, please check its installation and access path.

    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:132)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:356)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:420)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:444)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:557)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)

    What am I doing wrong? Here are my environment variables:

    JAVA_HOME: C:\j2sdk1.4.2_04
    J2EE_HOME: C:\Development\appServer
    PATH: %JAVA_HOME%\bin;%J2EE_HOME%\jdk\bin

    Any feedback would be greatly appreciated.

    Threaded Messages (23)

  2. My guess is that Tomcat is not installed correctly, or that the security settings for Tomcat are incorrect. Either (a) re-install Tomcat or (b) check Tomcat's security policy file:

    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/security-manager-howto.html

    Another thing you might try is putting the Xerces jars into the WEB-INF/lib directory of your web application:

    http://xml.apache.org/xerces2-j/download.cgi
  3. I'm using Sun Application Server 8.0. Where do I find the Tomcat files on there? Is it even using Tomcat?

    I actually scrapped the whole "tag library" approach. I decided to build a Java Bean to do all the work for me, and I now just want to invoke that bean in my JSP page. However, I'm getting the same message.

    Here's how my bean looks:

    package myBeans.src;

    import java.beans.*;
    import java.io.Serializable;
    import javax.xml.parsers.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.DOMException;
    import java.net.URL;
    import java.io.InputStream;
    import java.io.IOException;

    public class feedBean extends Object implements Serializable {
        
        public static final String PROP_SAMPLE_PROPERTY = "sampleProperty";
        
        private String elementTitle;
        private String elementLink;
        private String elementDescription;
        private String elementDate;
        private String elementFeed;
        
        private int listLength;
        
        private String sampleProperty;
        private PropertyChangeSupport propertySupport;
        
        public feedBean() {
            propertySupport = new PropertyChangeSupport(this);
        }
        
        public void processFeed() {
            try {
              Document document;
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

              //Read XML file
              //Open the file for reading:
              URL u = new URL(elementFeed);
              InputStream inputXML = u.openStream();
              
              //Build document:
              DocumentBuilder builder = factory.newDocumentBuilder();
              document = builder.parse(inputXML);
              
              //Generate the NodeList;
              org.w3c.dom.NodeList nodeList = document.getElementsByTagName("item");
              listLength = nodeList.getLength(); // how many elements there are
              
              // Query through XML File
              for (int i=0; i<listLength; i++) {
                this.elementTitle = document.getElementsByTagName("title").item(i).getFirstChild().getNodeValue();
                this.elementLink = document.getElementsByTagName("link").item(i).getFirstChild().getNodeValue();
                this.elementDescription = document.getElementsByTagName("description").item(i).getFirstChild().getNodeValue();
                this.elementDate = document.getElementsByTagName("date").item(i).getFirstChild().getNodeValue();
              }
              
            } catch (Exception e) {
              System.err.println("Exception: " + e.getMessage());
              }
        }
        
        public void setFeedName(String feed) {
            elementFeed = feed;
        }
        public String getFeedFeed() {
            return elementFeed;
        }
        
        public String getFeedTitle() {
            return elementTitle;
        }
        
        public String getFeedLink(){
            return elementLink;
        }
        
        public String getFeedDescription() {
            return elementDescription;
        }
        
        public String getFeedDate() {
            return elementDate;
        }
        
        public String getSampleProperty() {
            return sampleProperty;
        }

        public void setSampleProperty(String value) {
            String oldValue = sampleProperty;
            sampleProperty = value;
            propertySupport.firePropertyChange(PROP_SAMPLE_PROPERTY, oldValue, sampleProperty);
        }
        
        public void addPropertyChangeListener(PropertyChangeListener listener) {
            propertySupport.addPropertyChangeListener(listener);
        }
        
        public void removePropertyChangeListener(PropertyChangeListener listener) {
            propertySupport.removePropertyChangeListener(listener);
        }
    }

    Here's how my JSP looks:

    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>

    <jsp:useBean id="feedBean" class="/WEB-INF/classes/myBeans/src/feedBean" scope="page">
     <jsp:setProperty name="feedBean" property="elementFeed" value="http://slashdot.org/slashdot.rss"/>
    </jsp:useBean>

    ...
    HTML doc type and body tag.
    ...

    <%
      feedBean.processFeed();
    %>

    ...
    Logic to output the bean methods.
    ...

    Now, I am able to create a WAR file and deploy this to the server. I use the Sun Application Server 8.0 deploy tool for this. A WAR file is basically created, and it is deployed to the server. I still get the same message when trying to load the page:

    org.apache.jasper.JasperException: Unable to compile class for JSP

    No Java compiler was found to compile the generated source for the JSP.
    This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
    to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
    If using an alternate Java compiler, please check its installation and access path.

    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:132)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:356)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:420)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:444)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:557)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)


    I can also provide you with a copy of the WAR file, if you are not able to gleam what I might have done wrong here. Note that my JAVA_HOME and J2EE_HOME variables are all the same.

    What I don't understand is why it's having trouble finding the Java compiler, if I'm reading that error correctly.
  4. Here's an output of the environment parameters for the server startup batch file. The paths seem to look good. I can't understand that error message. Could it be something else?

    Someone please help! I'm dyin over here!


    C:\Development\appServer\bin>set AS_ANT=C:\Development\appServer\lib\ant

    C:\Development\appServer\bin>set AS_ANT_LIB=C:\Development\appServer\lib\ant\lib


    C:\Development\appServer\bin>set AS_POINTBASE=C:\Development\appServer\pointbase


    C:\Development\appServer\bin>set AS_POINTBASE_SAMPLESDB=C:\Development\appServer
    \pointbase

    C:\Development\appServer\bin>set AS_WEBSERVICES_LIB=C:\Development\appServer\lib


    C:\Development\appServer\bin>set AS_PERL=C:\Development\appServer\lib\perl

    C:\Development\appServer\bin>set AS_NSS=C:\Development\appServer\bin

    C:\Development\appServer\bin>set AS_NSS_BIN=C:\Development\appServer\lib\admincg
    i

    C:\Development\appServer\bin>set AS_IMQ_LIB=C:\Development\appServer\imq\lib

    C:\Development\appServer\bin>set AS_IMQ_BIN=C:\Development\appServer\imq\bin

    C:\Development\appServer\bin>set AS_CONFIG=C:\Development\appServer\config

    C:\Development\appServer\bin>set AS_INSTALL=C:\Development\appServer

    C:\Development\appServer\bin>set AS_JAVA=C:\Development\appServer\jdk

    C:\Development\appServer\bin>set AS_ACC_CONFIG=C:\Development\appServer\domains\
    domain1\config\sun-acc.xml

    C:\Development\appServer\bin>set AS_JHELP=C:\Development\appServer\lib

    C:\Development\appServer\bin>set AS_ICU_LIB=C:\Development\appServer\bin

    C:\Development\appServer\bin>set AS_DEF_DOMAINS_PATH=C:\Development\appServer\do
    mains

    C:\Development\appServer\bin>call "C:\Development\appServer\bin\asadmin.bat" sta
    rt-domain domain1

    C:\Development\appServer\bin>set AS_ANT=C:\Development\appServer\lib\ant

    C:\Development\appServer\bin>set AS_ANT_LIB=C:\Development\appServer\lib\ant\lib


    C:\Development\appServer\bin>set AS_POINTBASE=C:\Development\appServer\pointbase


    C:\Development\appServer\bin>set AS_POINTBASE_SAMPLESDB=C:\Development\appServer
    \pointbase

    C:\Development\appServer\bin>set AS_WEBSERVICES_LIB=C:\Development\appServer\lib


    C:\Development\appServer\bin>set AS_PERL=C:\Development\appServer\lib\perl

    C:\Development\appServer\bin>set AS_NSS=C:\Development\appServer\bin

    C:\Development\appServer\bin>set AS_NSS_BIN=C:\Development\appServer\lib\admincg
    i

    C:\Development\appServer\bin>set AS_IMQ_LIB=C:\Development\appServer\imq\lib

    C:\Development\appServer\bin>set AS_IMQ_BIN=C:\Development\appServer\imq\bin

    C:\Development\appServer\bin>set AS_CONFIG=C:\Development\appServer\config

    C:\Development\appServer\bin>set AS_INSTALL=C:\Development\appServer

    C:\Development\appServer\bin>set AS_JAVA=C:\Development\appServer\jdk

    C:\Development\appServer\bin>set AS_ACC_CONFIG=C:\Development\appServer\domains\
    domain1\config\sun-acc.xml

    C:\Development\appServer\bin>set AS_JHELP=C:\Development\appServer\lib

    C:\Development\appServer\bin>set AS_ICU_LIB=C:\Development\appServer\bin

    C:\Development\appServer\bin>set AS_DEF_DOMAINS_PATH=C:\Development\appServer\do
    mains

    C:\Development\appServer\bin>set Path=C:\Development\appServer\bin;C:\Developmen
    t\appServer\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Development
    \appServer\domains\domains1;C:\Development\appServer\jdk\bin;C:\Development\appS
    erver\bin;C:\j2sdk1.4.2_04\bin;C:\j2sdk1.4.2_04\lib;C:\Development\appServer\lib
    ;C:\Development\appServer\bin;C:\Development\AppServer\domains\domains1;C:\Devel
    opment\appServer\jdk\bin

    C:\Development\appServer\bin>"C:\Development\appServer\jdk\bin\java" -Dcom.sun.a
    as.instanceRoot="C:\Development\appServer" -Dserver.name=server -Djava.library.p
    ath="C:\Development\appServer\bin";"C:\Development\appServer\bin" -Dcom.sun.aas.
    configRoot="C:\Development\appServer\config" -Djava.endorsed.dirs="C:\Developmen
    t\appServer\lib\endorsed" -cp "C:\Development\appServer\lib";"C:\Development\app
    Server\lib\appserv-rt.jar";"C:\Development\appServer\lib\appserv-ext.jar";"C:\De
    velopment\appServer\lib\j2ee.jar";"C:\Development\appServer\lib\admin-cli.jar";"
    C:\Development\appServer\lib\appserv-admin.jar";"C:\Development\appServer\lib\co
    mmons-launcher.jar";"C:\Development\appServer\lib\ant\lib\ant.jar";"C:\Developme
    nt\appServer\lib\ant\lib\optional.jar";"C:\Development\appServer\lib\install\app
    lications\jmsra\imqjmsra.jar" com.sun.enterprise.cli.framework.CLIMain start-do
    main domain1
    Starting Domain domain1, please wait.
    Log redirected to C:\Development\appServer\domains\domain1\logs\server.log.
    Domain domain1 started.
  5. This might be the root of your problem:

    AS_JAVA=C:\Development\appServer\jdk

    Sun's J2EE server ignores the JAVA_HOME and J2EE_HOME environment variables. The above value in the C:\Development\appServer\config\asenv.bat file is what specifies the location of your JVM. Try modifying this batch file to:

    set AS_JAVA=C:\j2sdk1.4.2_04

    Alternately, uninstall and reinstall both your JVM and the J2EESDK (since there appears to be something wrong with the installation).

    If this none of the above works, I have one more question: are you having problems with all your JSP, or just the one in question?
  6. This might be the root of your problem:AS_JAVA=C:\Development\appServer\jdkSun's J2EE server ignores the JAVA_HOME and J2EE_HOME environment variables. The above value in the C:\Development\appServer\config\asenv.bat file is what specifies the location of your JVM. Try modifying this batch file to:set AS_JAVA=C:\j2sdk1.4.2_04Alternately, uninstall and reinstall both your JVM and the J2EESDK (since there appears to be something wrong with the installation).If this none of the above works, I have one more question: are you having problems with all your JSP, or just the one in question?
    I changed the "AS_JAVA" variable in my startup script, and it had the same affect. To answer your last question, I can deploy other JSP files successfully and they load up just fine.

    I thought that perhaps I didn't have the class files necessary to build the JavaBean code I posted above. However, if that was the case, I wouldn't be able to compile it into a class file in the first place.

    I'm hesitant to re-install J2EE, but I guess I have no other alternative. Since I'm using Sun App Server 8.0, I'll download just the J2EE sdk from Sun and re-install the sdk.
  7. If the problem is with a single JSP, then it is likely that the issue is not the server itself, so I withdraw my suggestion of reinstalling.

    Try using the Bean in another, currently functioning JSP. This will determine if the problem is in your Bean code or your JSP code.

    If the problem is in your Bean code, I am at a loss. I don't see anything that should cause a problem.

    If the problem is in your JSP code (maybe your JSP is malformed in a way that is not easy to see), rewrite your JSP using one of your work JSP as a starting point.
  8. If the problem is with a single JSP, then it is likely that the issue is not the server itself, so I withdraw my suggestion of reinstalling.Try using the Bean in another, currently functioning JSP. This will determine if the problem is in your Bean code or your JSP code.If the problem is in your Bean code, I am at a loss. I don't see anything that should cause a problem.If the problem is in your JSP code (maybe your JSP is malformed in a way that is not easy to see), rewrite your JSP using one of your work JSP as a starting point.
    I narrowed it down to this line:

    <jsp:useBean id="feedBean" class="/WEB-INF/classes/myBeans/src/feedBean" scope="page">
     <jsp:setProperty name="feedBean" property="elementFeed" value="http://slashdot.org/slashdot.rss"/>
    </jsp:useBean>

    Whenever I place this line on even my working JSPs, I get the same error. It's almost like it's having trouble finding the bean class?

    I have the "/WEB-INF/classes/myBeans/src/feedBean" off the docroot directory, where I'm running the bean, and I also have it in my "applications\j2ee-modules" off of the main "domain1" directory.

    Why is it having problems compiling this class? Do I have the "class" property in the useBean tag incorrect?

    Thanks.
  9. compiling jsp[ Go to top ]

    Why do you have the bean class defined in the JSP page as class="/WEB-INF/classes/myBeans/src/feedBean"? Use the correct notation, i.e.; com.mypackage.feedBean. You do not need the /WEB-INF.....

    Your container loads all classes under the classes directory of the webapp.
  10. compiling jsp[ Go to top ]

    I also forgot, do you have an import declaration in your jsp?

    E.g.;

    <%@page contentType="text/html" import="mypackage.feedBean%>
  11. compiling jsp[ Go to top ]

    Here is what I have. Based on my last "bean code" post, you let me know if I'm right. It still gives me the same error with this header information:

    <%@ page contentType="text/html" import="myBeans.src.feedBean" %>;

    <jsp:useBean id="feedBean" class="myBeans.src.feedBean" scope="page">
     <jsp:setProperty name="feedBean" property="elementFeed" value="http://slashdot.org/slashdot.rss"/>
    </jsp:useBean>
  12. compiling jsp[ Go to top ]

    Perhaps it's having problems importing the classes within the bean? They are:

    import java.beans.*;
    import java.io.Serializable;
    import javax.xml.parsers.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.DOMException;
    import java.net.URL;
    import java.io.InputStream;
    import java.io.IOException;

    How do I make sure that my server can see these classes? Certainly my IDE can, since I was able to compile the bean class from my previous posts.
  13. compiling jsp[ Go to top ]

    Why do you have the bean class defined in the JSP page as class="/WEB-INF/classes/myBeans/src/feedBean"? Use the correct notation, i.e.; com.mypackage.feedBean. You do not need the /WEB-INF..... Your container loads all classes under the classes directory of the webapp.
    Ok, that may be my problem. Since my bean is in the "myBeans.src" package, do I say class="myBeans.src.feedBean"?

    I apologize, but I'm rather new to the J2EE area. I'm so use to J2SE. I appreciate your patience.
  14. compiling jsp[ Go to top ]

    Yes try that.
  15. compiling jsp[ Go to top ]

    Ok, I don't know what I was doing before, but I don't get compile errors with this:

    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>

    <%@ page contentType="text/html" import="myBeans.src.feedBean" %>

    <jsp:useBean id="feedBean" class="myBeans.src.feedBean" scope="page">
    </jsp:useBean>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <!--
    Authored by Ricardo Rodriguez
    June 6, 2004
    -->

    BODY
    ...
    <%
      feedBean.setFeedName("http://slashdot.org/slashdot.rss");
      feedBean.processFeed();
    %>

    H2 tag: Test Slashdot Feed :END H2 tag

    PARAGRAPH TAGS

    END BODY tags
    END HTML tags

    However, it gives me that same compile error when I try to output a value from the bean like this:

     ... href="<%=feedBean.getFeedDate(); %>" ...

    Am I calling that method incorrectly?
  16. compiling jsp[ Go to top ]

    It seems that any "get" method that I try to perform on the bean results in that "No Java compiler found..." error.

    Would it be much to ask for you to compile that small bean on your test server and integrate it into a jsp?

    Perhaps there's something I'm doing wrong with the method call. At least you'll be able to verify that the code is correct.

    If it can instantiate the bean and call two methods, why is it having problems with the get methods??
  17. compiling jsp[ Go to top ]

    The problem with the following line of code is the ";"
    <%=feedBean.getFeedDate(); %>
    If you are using an expression (<%= ... %>), you should only include the value, and no other Java syntax. The correct expression is:
    <%= feedBean.getFeedDate() %>
  18. compiling jsp[ Go to top ]

    The problem with the following line of code is the ";"
    <%=feedBean.getFeedDate(); %>
    If you are using an expression (<%= ... %>), you should only include the value, and no other Java syntax. The correct expression is:
    <%= feedBean.getFeedDate() %>
    I take out the semicolon, and it still gives me that compile error. I made it even simpler. I call this function:

    <%=feedBean.getFeedName() %>

    This simply calls for the variable I set earlier on in the code. It's not even trying to get information from the parsed feed.

    Would someone be able to put that bean code and integrate it into a JSP page? I know that's a lot to ask, but I'm driving myself crazy.

    If it works on your server and not mine, then perhaps there's some library files that I'm missing. However, it is curious that I'm simply calling an element I populated a couple of lines beforehand and it's breaking down.
  19. compiling jsp[ Go to top ]

    Here is my JSP code:

    -----------------------------------------------------------
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>

    <jsp:useBean id="feedBean" class="myBeans.src.feedBean" scope="page" >
    </jsp:useBean>

    DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

    START HTML TAG
    START BODY TAG

    <%
      feedBean.setFeedName("http://slashdot.org/slashdot.rss");
      feedBean.processFeed();
    %>
    START H2 TAG: Test Slashdot Feed :END H2 TAG

    <%=feedBean.getFeedName() %>


    END BODY TAG
    END HTML TAG

    -----------------------------------------------------------

    It gives me the compile error with that code. However, once I take out "<%=feedBean.getFeedName() %>", it displays the H2 tag "Test Slashdot Feed" fine. Obviously, although it doesn't error with the other JSP/Java code, it does me no good if I can't access the bean element data.
  20. compiling jsp[ Go to top ]

    Looking at the code you posted earlier, your feedBean class does not have a getFeedName() method. It has a getFeedFeed() method. I also noticed that your processFeed() is reporting errors by printing to System.err. It could be that this method is generating error messages which you don't see in Sun's server.

    Here are some more suggestions:

    1. Write a normal command-line Java program that uses your feedBean, to make sure that the bean is working correctly. If you are using an IDE like Eclipse, you can use the debugger to pinpoint any problems.

    2. Cut and paste snippets of your working code from your command-line program into your JSP. The logic in your JSP should be super-simple, with little room for failure.

    3. Consider switching from Sun's J2EE server to Tomcat (http://jakarta.apache.org/tomcat/). Tomcat is much easier to work with, especially for beginners.
  21. compiling jsp[ Go to top ]

    1. Write a normal command-line Java program that uses your feedBean, to make sure that the bean is working correctly. If you are using an IDE like Eclipse, you can use the debugger to pinpoint any problems.2. Cut and paste snippets of your working code from your command-line program into your JSP. The logic in your JSP should be super-simple, with little room for failure.3. Consider switching from Sun's J2EE server to Tomcat (http://jakarta.apache.org/tomcat/). Tomcat is much easier to work with, especially for beginners.
    Java 101: Make sure your classes can test themselves.

    I think it was in my first Java class that I learned to "test" the reliability of my classes by building either a "TestClass" within that class or with a "main method".

    Your first point solved my problem. The "date" within the feed was null, and it was "crapping out" because of that. I changed it to only "do if not null", and it worked like a charm. Now I know that "...can't find Java compiler..." is a generic error message and that I need to look elsewhere, especially if other JSPs are compiling.

    Thank you so much to everyone who helped me with this. It was my first J2EE application, and I learned a lot from it. I'm going to look into just using Tomcat, instead of Sun's App server. I'm guessing it won't be as easy to set up as Sun's App server, but it'll probably help me to diagnose problems easier in the future.

    Thanks again!!
  22. compiling jsp[ Go to top ]

    Actually, Tomcat is pretty easy to set up. It has a Windows installer, just like Sun's App Server.

    Tomcat is just servlets and JSP, though, and does not support any other J2EE features (like EJB or JMS). On the other hand, if Servlets and JSP is all you are using, it is much simpler to manage and figure out.
  23. Security Error[ Go to top ]

    Actually, Tomcat is pretty easy to set up. It has a Windows installer, just like Sun's App Server.Tomcat is just servlets and JSP, though, and does not support any other J2EE features (like EJB or JMS). On the other hand, if Servlets and JSP is all you are using, it is much simpler to manage and figure out.
    Paul,

    Could you take a look at another posting I made, here:

    http://theserverside.com/discussions/thread.tss?thread_id=26667

    I'm not sure how to approach the "security" error I got. Thanks!
  24. Also of note, when I change the "class" parameter in the useBean tag, to simply "feedBean", I get this error:

    java.lang.NoClassDefFoundError: feedBean (wrong name: myBeans/src/feedBean)

    Now, I made sure the path, "myBeans/src/feedBean" was in every "/WEB-INF" directory, and that the "feedBean" class was in the appropriate "src" directory. How does it know what directory to look in, and why does it "crap" out when I use "feedBean" in the "class" parameter?

    I also renamed the value in the "class" parameter to "feedBean.class", and it gave me the same "No Java compiler..." error.