Is it possible for jsp(tomcat container)  access ejb deployed in sun app se

if it's possible ,how to implement

Hi,
Yes it is possible for a JSP in tomcat container to lookup EJB in sun app server.
Please refer following article for guidelines. If you need further help please revert back.
http://www.onjava.com/pub/a/onjava/2003/02/12/ejb_tomcat.html?page=2
HTH
VJ

Similar Messages

  • Error while accessing EJB deployed in another app

    Hi,I have an EJB deployed in another application and was trying to access it from different application (both running on seperate weblogic server 5.1)when i do look-up like this : Hashtable hmRemote = new Hashtable(); hmRemote.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); hmRemote.put(Context.PROVIDER_URL, "http://localhost:7001/doc"); Hashtable hmLocal = new Hashtable(); hmLocal.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); hmLocal.put(Context.PROVIDER_URL, "http://localhost:7004/amit"); hmLocal.put(WLContext.DELEGATE_ENVIRONMENT, hmRemote); Context ctx = new InitialContext(hmLocal);I get following error on console :Wed May 02 12:28:30 CDT 2001:<I> <ConMan> Bootstrap unable to get a http connection to localhost/127.0.0.1Wed May 02 12:28:30 CDT 2001:<I> <ConMan> Bootstrap unable to get a http connection to localhost/127.0.0.1Exception caught in try javax.naming.CommunicationException [Root exception is java.net.ConnectException: No server found atHTTP://localhost:7001]Please help me.thanksamit

    I solved the problem or I learned the process. I forgot to add two jar files in tomcat shared library. It is working now. Thanks.

  • How to access EJB deployed in JBOSS 4 from Creator

    Hello.
    I am trying to access EJBs deployed on JBOSS in order to develop a web app client, when I import the EJB set from Creator (sessions and entities packages in a jar file) I got the following error message....."No EJB set found in file....." .
    I presume there is an kind of xml file description specific for Sun App Server missing. I would like to know if there is other way to expose EJB in creator?....maybe write a config file by hand.
    I already read the tutorials related to EJB but those only use pre build EJB jars for Sun App Sserver.
    Also I read all the posted about JBoos and EJB in this forum but those are pretty general.
    By the way I have Delegate classes to access the EJB. How do I register my delegates in Creator in order to expose their methods?
    I�ll really appreciate some light in this matter.
    Thanks in advance!!!

    Hi,
    The below forum thread may help you :
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=51321
    Thanks,
    Runa.

  • Can't access EJB deployed on remote OC4J - what am I doing wrong?

    I'm unable to access an EJB deployed on a remote OC4J instance (ie, part of a 9iAS installation on another machine vs local in JDeveloper).
    I've reverted to a stupid-simple EJB in hopes of getting it going prior to trying my actual code. The EJB works fine in JDev (9.0.3) - I 'run' the EJB to start the local OC4J instance, run my client code (generated via the "New Sample Java Client..." option in the Navigator context popup) and all is well.
    I then create an EAR file via the the "Create EJB Jar Deployment Profile..." context popup of the ejb-jar.xml node, followed by "Deploy to EAR file" from the context popup of the resulting ejb1.deploy node. I next "Deploy EAR File" via the "Oracle Enterprise Manager" that comes with 9iAS (the :1810 port). After successfully deploying, I modify my client code in JDeveloper, specifying the new connection information for the remote machine via the Hashtable constructor of InitialContext and attempt to run it. I've tried a number of Context.PROVIDER_URL forms, including: ormi://registered_pingable_host_name:23791/deployed_application_name
    ormi://registered_pingable_host_name:23791/session_deployment_name (from the <enterprise-beans><session-deployment name="xxx"/></enterprise-beans> section of my orion-ejb-jar.xml file, as per a tip in this forum)
    I've tried prefixing ormi:// with http:, but get no response whatesoever in this case.
    I've also tried it without the port number (this port number matches that in my remote OC4J's <oc4j_instance_home>/config/rmi.xml file).
    On the Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS settings, I've tried various values, generally using the 'admin' user, with passwords taken from:
    <oc4j_instance_home>/principals.xml
    <oc4j_instance_home>/application-deployments/application_name/principals.xml
    I've also tried matching the password in the jazn-data.xml, to no avail - this password appears encrypted anyway, but thought I'd give it a try on the off-chance that it was just a randomly-generated password - no go.
    I've also tried SCOTT/TIGER, anonymous, etc. Incidentally, the 'deactivated' attribute of the <user> tag is set to "false" in my principals.xml files.
    No matter what I do, I always get back "javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect"
    Additionally, I get this same message when I try to establish an Application Server Connection via JDev.
    Clearly, I'm missing something critical (and probably simple), but I can't for the life of me figure it out.
    Any help would be much appreciated!
    Thanks,
    Jim Stoll

    Ok, well this is a bit strange...
    3103 - 3103 also fails, and some experimentation has led me to find that any time that I specify a range smaller than 6 (3101 - 3106 works, 3101 - 3105, 3101-3101, 3103-3103, etc does not), the OC4J instance will not restart. I get "An error occurred while starting. The opmn request has failed. From opmn: HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html Response: 0 of 1 processes started. Check opmn log files such as ipm.log and ons.log for detailed." in the OEM window (I specify the RMI port range, hit Apply, go to the OC4J instance home page, see that the Status is 'Down', hit Start, and get that message.) <ORACLE_HOME>/product/iasinfra/opmn/logs/ipm.log tells me:
    02/12/03 09:41:12 There is no rmi port left for starting an OC4J process. Please check oc4j's port property in OPMN's configuration file.
    02/12/03 09:41:12 start_proc: UID 3719788: failed to build args
    02/12/03 09:41:12 start_proc_req: failed to start a process in GID OC4JJim2, type: 2
    If I bump it up to 3101 - 3106 or higher, it starts right up. Running opmnadmin debug, as suggested by Venky (thanks Venky!), yields:
    PROCESS TABLE
    UID PID FLAGS TYPE STATUS REF HTTP AJP RMI JMS
    3654011 84 00000040 OC4J Alive 1 0 3005 3106 3206
    424987 604 00000000 Apache Alive 1 7777 0 0 0
    2932088 14849 00000000 OC4J Alive 1 0 3003 3103 3203
    3063160 14878 00000000 OC4J Alive 1 0 3001 3101 3201
    3194232 14906 00000000 OC4J Alive 1 0 3000 3105 3205
    3325304 14936 00000000 OC4J Alive 1 0 3002 3102 3202
    3456376 14964 00000000 OC4J Alive 1 0 3004 3104 3204
    Which is what I would expect, given the specified range of 3101-3106. Trying each of these ports in turn, I've found that I can hit the EJB successfully on 3106, but 3101 - 3105 all fail with:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: No such domain/application: Project7_2; nested exception is:
         javax.naming.AuthenticationException: No such domain/application: Project7_2
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void Samplemypackage9.MySessionEJBClient1.main(java.lang.String[])
              MySessionEJBClient1.java:15
    I'm a little concerned about assuming the high-end of the range to be the active port on a regular basis (though thus far, among about 20 - 30 tries spaced over 20 - 30 minutes, it has been...) - I guess I can have my code loop through the range until it finds a good port or exhausts the list, but that seems a bit excessive.
    Can you think of a reason that my OC4J instance won't start with a range size of less than 6? I'm on 9iAS 9.0.2, if that makes any difference.
    Thanks,
    Jim

  • Is it possible for fragments to contain variable content?

    Hi everyone,
    I've been looking at using fragments to help with maintaining form consistancy. We have about 25 forms which all use the same template. Our company just changed our slogan, which is included in the footer of the master page. Now I find myself having to go through all 25 forms to update the slogan. This sounds like a perfect job for fragments.
    I would like to have one fragment for the entire header, and a second fragment for the entire footer. My issue is that each form has a different title in it's header, and a different document reference number in the footer. Idealy, I would like to be able to set up variables associated with my fragment, then use some javascript to update the fragment content.
    A part of me thinks that this goes against the very nature of fragments... but I wanted to ask to be certain. It would just be so much cleaner than the alternative... I could, for example, just include the static text that will be the same across all forms, and leave variable content outside of the fragment (but still a part of the template). That way, if I ever had to change to logo, I could, but I would still be able to manually specify a title and document number.
    My only concern with the above is; what if I am asked to change the font of the title in all forms. If I could somehow use a fragment, it would be very easy. I know that we have about 120 forms planned... I would hate to have to update each individually if it was something I could avoid.
    Thanks for your help!
    Bonus Question:
    Is there a faster way to batch 'refresh' an updated fragment than to open each form in Livecycle Designer and resave? True, it's a lot faster than manually making the changes to each form, but it would still be nice not to have to open each form to update them.

    Well, as I was writing the above question, I had an idea as to how I mihgt be able to acheive this... I tried it and it worked.
    In my master page, I he turned my entier header into a fragment. In the header is an empty text field that I have formatted to look as I want the title text to appear. Also in my master page is a "FormOptions" subform with text fields for each 'variable' such as title.
    In the Title text field in the fragment, in the initialize code I've used:
    this.rawValue = FormSettings.Title.rawValue;
    this.access = "readOnly";
    Now, when I create a new form, I can set the default values of the 'variable' text boxed to the appropriate values, then hide the "FormOptions" subform from view by setting it to invisible. I haven't had much of a chance to test, but it looks to work well. I've also mathe "FormOptions" subform and it's child fields to have no data binding, so that the exportable xml of the form doesn't get cluttered up.
    If anyone can think of a less convoluted method, I'd still love to hear it. I am also still interested in hearing about fater ways to updated multiple forms when I edit a fragment.

  • Client not able to access EJB deployed in Oracle8i

    Hi,
    After lot of pains, I was able to deploy EJB in the Oracle8i DB.
    Now I am facing problems when the Client makes an request to get the reference of this deployed EJB.
    This is the error I receive :
    "C:\JDeveloper3.0\java1.2\jre\bin\javaw.exe" -mx50m -classpath "C:\sandeep\JDeveloper3.0\class;C:\JDeveloper3.0\lib\jdev-rt.zip;C:\JDeveloper3.0\jdbc\lib\oracle8.1.5\classes111.zip;C:\JDeveloper3.0\lib\connectionmanager.zip;C:\JDeveloper3.0\li b\javax_ejb.zip;C:\JDeveloper3.0\aurora\lib\aurora_client.jar;C:\JDeveloper3.0\aurora\lib\vbjorb.jar;C:\JDeveloper3.0\aurora\lib\vbjapp.jar;C:\JDeveloper3.0\aurora\lib\vbjtools.jar ;C:\JDeveloper3.0\aurora\lib\vbj30ssl.jar;C:\sandeep\JDeveloper3.0\project\MyEJBRemoteSource.jar;C:\sandeep\JDeveloper3.0\project\MyEJBRemoteGenerated.jar;C:\JDeveloper3.0\java1.2\ jre\lib\rt.jar;C:\JDeveloper3.0\lib\jboejb.jar" LearnEJBPack.EJBClient
    Creating an initial context
    Looking for the EJB published as 'test/MyEJBClass'
    java.lang.NoClassDefFoundError: oracle.aurora.rdbms.ClassResolver
    java.lang.Object oracle.aurora.jndi.sess_iiop.sess_iiopURLContextFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)
    javax.naming.Context javax.naming.spi.NamingManager.getURLContext(java.lang.String, java.lang.Object, java.util.Hashtable)
    javax.naming.Context javax.naming.spi.NamingManager.getURLContext(java.lang.String, java.util.Hashtable)
    javax.naming.Context javax.naming.InitialContext.getURLOrDefaultInitCtx(java.lang.String)
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    void LearnEJBPack.EJBClient.main(java.lang.String[])
    Exception in thread main
    I donot understand why it is not able to find
    oracle.aurora.rdbms.ClassResolver.
    Do I also need to load some other classes also?
    Let me know.
    Thanks
    Sandeep
    Details : JDeveloper 3.0 Oracle 8.1.5i Windows 2000

    Hi Giri,
    In SQL Server Help file content are i pasted here
    Using the Local Service Account
    The Local Service account is a special, built-in account that is similar to an authenticated user account.
    The Local Service account has the same level of access to resources and objects
    as members of the Users group. This limited access helps safeguard your system
    if individual services or processes are compromised. Services that run as the Local
    Service account access network resources as a null session with no credentials.
    Using the Network Service Account
    The Network Service account is a special, built-in account that is similar to an authenticated
    user account. The Network Service account has the same level of access to resources and
    objects as members of the Users group. Services that run as the Network Service account
    access network resources using the credentials of the computer account.
    Important: 
    Microsoft recommends that you do not use the Network Service account for the SQL Server
    or SQL Server Agent services. Local User or Domain User accounts are more appropriate
    for these SQL services.
    Using the Local System Account
    The Local System account is a highly privileged account; use caution when assigning
    Local System permissions to SQL Server service accounts.
    Security Note: 
    To increase the security of your SQL Server installation, run SQL Server services under
    a local Windows account with the lowest possible privileges.
    Regards
    Jambulingam.P
    Edited by: Jambulingam P on Aug 12, 2009 1:58 PM

  • Search strategy for JSP tag files

    Hello everyone,
    I've been trying to find a solution to this for some time, but couldn't find a clean one. Maybe somewhere here has any ideas for a solution...
    Consider a JSP taglib which is composed of hundreds of .tag files. The library is referenced in JSP using the "*tagdir*" option of the taglib directive, which simply points to /WEB-INF/tags/ (where the .tag files are located).
    Our standard server software distribution includes that tag library, as well as JSP pages that make up the server's web user interface. Those JSP pages use the taglib extensively.
    Now, we want to be able to distribute upgrades to the JSP pages and the tablib, but allow customers to easily customize some tag files without worring about loosing their changes if they apply a future upgrade.
    If it were possible for JSP pages to declare two overlapping taglib directives (same prefix) pointing to two different tagdirs, it would allow us to place our hundreds of .tag files in one "standard" directory, and allow customers to place customized .tag files in another "customized" directory. That way JSP files would always use the same prefix for our tags, but the actual .tag file inserted would be coming either from the customers's "customized" tagdir or from our "standard" tagdir (depending if they chose to override a tag with a customized version or not).
    Is this possible? How do people deal with taglib customization and maintenance issues?
    Thank you!

    Thanks for the reply!
    We use the ClickOnce smart client deployment to the user's machine and we would not want to touch/change anything on the user's machine. So, we can't rely on an environment variable being set.
    It almost seems that the DB Support Team has to not only talk to the Tech Support team and arrange for deploying the right version of the tnsnames.ora file on their users machines, but also talk to the App Deployment Team and provide the most recent version of this file to be used for deployment. So I guess if this file is checked in a code repository, the DB Support team can notify the Tech Support Team and the App Deployment Team to refresh respectively all user machines and application deployment configuration files.
    Alternatively, as one of the app deployment instructions of App Deployment team can be: "check out the most recent version of tnsnames.ora from the repository before deploying the application".
    Any thoughts?
    Thanks.
    Regards,
    gkk1969

  • Unable to compile class for JSP: import ...

    Hi everybody!
    I've tried to change from Servlet to JSP. The Servlet used a package und compiled fine under NB 4.1.
    When the JSP is compiled on the Server (Sun Java System Application Server Platform Edition 8 2004Q4 Beta) the following error occurs:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    [javac] D:\Programme\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\NR_Java4Web1\org\apache\jsp\DisplayingDatabaseRecords_jsp.java:44: illegal start of expression
    [javac] import de.conus.util.DBUtil.*
    [javac] ^
    Do I have to place the classfile manually on the server?
    Thanks for your help,
    Michael

    All import-statements where of the same kind. I had to place trhe classfiles
    at the application server under lib\classes. Now it works
    Thanks

  • Accessing EJBs as COM objects.

    Hi,
    I want to access deployed EJBs from Visual Basic.
    I've used Sun's COM-CAS bridge inside a VB application to access EJBs deployed in their J2EE server and it worked OK.
    How do I do the same thing with EJBs in Oracle8i (8.1.5)?
    Does Oracle provide a similar package to Sun's COM-CAS bridge?
    Do I deploy to OAS instead of Oracle8i to achieve what I want to do?
    Any help would be appreciated.
    Thanks

    A search of the forum using "Java COM" turned this up:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=106901
    Try it on your machine and see what you get back. Searches are always a good thing, especially if you're new. - MOD

  • Accessing EJB from Console App.

    I have deployed in EJB with JNDI name "greeter" in Sun Java� System Application Server Platform Edition 8.
    Then i am trying to access EJB using a console app (given below).
    import javax.ejb.*;
    import javax.rmi.*;
    import java.util.*;
    import javax.naming.*;
    public class Client
    public static void main(String args[])
    Greeter myGreeterBean;
    GreeterHome myGreeterHome;
    Greeter myGreeterRemote;
    Context context = null;
    try
    context = new javax.naming.InitialContext();
    catch (Exception e)
    System.out.println( "Unable To Get Initial Context");
    return;
    System.out.println("Got Context...");
    try {
    String JNDIName = "greeter";
    Object objref = context.lookup(JNDIName);
    System.out.println("Got Access To Object");
    myGreeterHome =(GreeterHome) PortableRemoteObject.narrow(objref,
    GreeterHome.class);
    myGreeterRemote = myGreeterHome.create();
    String theMessage = myGreeterRemote.getGreeting();
    System.out.println(theMessage);
    catch(Exception ex) { System.out.println( ex.getMessage()); }
    } // end of main
    } // end of Client
    But, while i am running this program i am getting the following error:
    Got Context...
    Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    I don't know where i am wrong. Any idea about it ?
    Thank you,
    P.Srikanth.

    This is what you need to modify :)
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "<<your
    initial context factory>>");
    env.put(Context.PROVIDER_URL, "<<JNDI provider
    URL>>");
    // Check documentation for exact Strings to be set.
    // Pass the environment parameters to
    InitialContext.
    Context context = new InitialContext(env);
    Angel
    No this is not correct. Lookups in SUN AS works a bit differently.

  • TS3297 Is it possible for itunes on my MacBook Pro to play songs off my networked WD external hard drive and sync to my iPhone? I prefer to not keep all my music on my laptop and I don't want to pay $25 a year to access my songs if I don't have to.

    Is it possible for itunes on my MacBook Pro to play songs off my networked Western Drive external hard drive so I can sync to my Mac to my iPhone? I do not want to keep any music on my laptop and I don't want to pay $25 to itunes match a year to access my songs if I don't have to.

    Hi turingtest2,
    Thank you for replying.  I've been looking at your posts about setting up iTunes using an external drive.  A bit of background info.  My old computer broke down, so I got a new one from work.  I've always kept my music files on my external drive (I have around 170GB of music).  I didn't follow the suggestions in the "migrate iTunes library" post because my old computer died on me.  However, I've looked at your posts about lay out of the iTunes folders.  Before connecting to iTunes on the new computer, I had reorganized my iTunes folder on my E: external drive, and created an iTunes folder which contains an iTunes Media subfolder.  The music files are in a Music folder, which is in the iTunes Media folder.  I've also put the following files in my iTunes folder: iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, iTunes Music Library.xml, as well as sentinel.  I then followed the advice you gave bmw99 on 2 Nov 2013 at 9.58 (sorry, can't copy the exact answer). 
    Just to clarify:  I'd like to keep all my music media on the E: external hard drive (the computer hard drive is too small), and I'm aware i might never have my playlists back, and that all the songs in my library might be ticked.  However, I don't want my library to be duplicated. 
    I'm at work at the moment, but will be back home in about 10 hours, so I can be more specific about folders / files names. 
    I'm glad you picked up my message and greatly appreciate your help.
    Patrice

  • Unable to compile class for JSP. apache-tomcat-6. What could be wrong?

    Hello, I am new to JSP and I am trying a very basic jsp and class file on Windows XP. I get the Unable to compile class for JSP.
    Steps that I have done:
    javac ch06_01.java , placed the ch06_01.class under
    C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes
    Then grabbed the ch06_02.jsp and placed it under
    C:\Apps\apache-tomcat-6.0.16\webapps\ch06\
    When I run it (by placing this into Explorer or Firefox URL
    http://localhost:8080/ch06/ch06_02.jsp) I get the error further
    below. Things I have done and made sure they are in place are:
    set up JAVA_HOME to C:\Apps\jdk1.6.0_06
    Using CATALINA_BASE: C:\Apps\apache-tomcat-6.0.16
    Using CATALINA_HOME: C:\Apps\apache-tomcat-6.0.16
    Using CATALINA_TMPDIR: C:\Apps\apache-tomcat-6.0.16\temp
    Using JRE_HOME: C:\Apps\jre1.6.0_06
    I did a google on the error and I found people saying to place the
    tools.jar from the jsk into the lib directory under CATALINA_HOME. But
    the examples still don't work. What step could I be missing? Your help is greatly
    appreciated.
    This is the simple jsp file:
    <%@ page import="ch06_01" %>
    <HTML>
    <HEAD>
    <TITLE>Using a JavaBean</TITLE>
    </HEAD>
    <BODY>
    <H1>Using a JavaBean</H1>
    <% ch06_01 messager = new ch06_01(); %>
    The message is: <%= messager.msg() %>
    </BODY>
    </HTML>
    this is the simple ch6_01 java file:
    public class ch06_01
    public ch06_01()
    public String msg()
    return "Hello from JSP!";
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented
    it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the generated java file
    The import ch06_01 cannot be resolved
    An error occurred at line: 9 in the jsp file: /ch06_02.jsp
    ch06_01 cannot be resolved to a type
    6: <BODY>
    7: <H1>Using a JavaBean</H1>
    8:
    9: <% ch06_01 messager = new ch06_01(); %>
    10:
    11: The message is: <%= messager.msg() %>
    12:
    An error occurred at line: 9 in the jsp file: /ch06_02.jsp
    ch06_01 cannot be resolved to a type
    6: <BODY>
    7: <H1>Using a JavaBean</H1>
    8:
    9: <% ch06_01 messager = new ch06_01(); %>
    10:
    11: The message is: <%= messager.msg() %>
    12:
    Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Edited by: indikon1 on Jun 12, 2008 1:18 PM
    I just updated the directories of the variables to reflect the current status of my system.

    What is wrong is that you are using an "old" jsp tutorial :-)
    Since Java 1.4, JSPs have been unable to access classes in the "default" package.
    What you need to do:
    Put the java class ch06_01 in a package.
    Steps to do this
    - Edit ch06_01 and add the following to the very top of the file (without the quotes): "package mypackage;"
    - create a folder "mypackage"
    - move ch06_01.java into that folder
    - compile that class (now in the mypackage package)
    - place ch06_01.class under C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes\mypackage
    In your jsp:
    <%@ page import="mypackage.ch06_01" %>
    I would suggest using a more up-to-date tutorial that uses JSTL.
    Take a look at this [Apache Tomcat tutorial|http://www.coreservlets.com/Apache-Tomcat-Tutorial/index.html]

  • Tomcat 4.1 Bean error (Unable to compile class for JSP)

    Help,
    I am using Tomcat 4.1 with with JDK1.3.1_01. I have a JSP page in which I try to use a Bean, but I get the following error from Tomcat.
    The JSP page is very simple. I am using package names in the import statement. Code below.
    I've put the class files under
    <TOMCAT>\webapps\projectname\WEB-INF\classes under the appropriate packages. What else is missing? I can not figure out what I am doing wrong.
    ***************** START JSP CODE *********************
    <html>
    <head>
    <title>User Information</title>
    </head>
    <%@ page session="true" %>
    <%@ page import="com.xxx.yyy.data.*" %>
    <body>
    <P> </P>
    <P> </P>
    <P> </P>
    <!--
    <jsp:useBean id="user" class="com.xxx.yyy.data.User" scope="session"/>
    -->
    <%
         User user = (User) session.getAttribute("user");
    %>
    UserID = <%= user.getUserID() %><BR>
    User Name = <%= user.getUserName() %><BR>
    Password = <%= user.getPassword() %><BR>
    Password Hint = <%= user.getPasswordHint() %><BR>
    </body>
    </html>
    ***************** END JSP CODE *********************
    ***************** START TOMCAT ERROR MESSAGE *********************
    org.apache.jasper.JasperException: Unable to compile class for JSP
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:477)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 20 in the jsp file: /userInfo.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:7: package com.xxx.yyy.data does not exist
    import com.xxx.yyy.data.*;
    ^
    D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:61: package com.xxx.yyy.data does not exist
    com.xxx.yyy.data.User user = null;
    ^
    An error occurred at line: 20 in the jsp file: /userInfo.jsp
    Generated servlet error:
    D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:63: package com.xxx.yyy.data does not exist
    user = (com.xxx.yyy.data.User) pageContext.getAttribute("user", PageContext.SESSION_SCOPE);
    ^
    An error occurred at line: 20 in the jsp file: /userInfo.jsp
    Generated servlet error:
    D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:66: package com.xxx.yyy.data does not exist
    user = (com.xxx.yyy.data.User) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.xxx.yyy.data.User");
    ^
    An error occurred at line: 25 in the jsp file: /userInfo.jsp
    Generated servlet error:
    D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:77: cannot resolve symbol
    symbol : class User
    location: class org.apache.jsp.userInfo_jsp
         User user = (User) session.getAttribute("user");
    ^
    An error occurred at line: 25 in the jsp file: /userInfo.jsp
    Generated servlet error:
    D:\Apache_Group\Tomcat_4.1\work\Standalone\localhost\PALBO\userInfo_jsp.java:77: cannot resolve symbol
    symbol : class User
    location: class org.apache.jsp.userInfo_jsp
         User user = (User) session.getAttribute("user");
    ^
    6 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:315)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:326)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:182)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2397)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:536)
    ***************** END TOMCAT ERROR MESSAGE *********************

    Hi
    I am running my Tomcat apps (on a Windows dev machine) in an alternate location (ie. not default webapps). The same crap comes to me every time. Unable to install etc. I have tried every trick in the book regarding classpath settings etc.
    When I use 'javap' to check the classpath from any location on my machine, its works and javap returns the signature of my class.
    When I use it though Tomcat (with the import set to include the filename), it get the error. I have heard rumors that using JDK 1.3 in stead of 1.4 helps, but I just want it to work with 1.4 :)
    So if any of you can help me on this, please.
    PS. On my linux server it works just fine, as does every other thing on that machine ;)
    Chris (chris.schuit <at> euronet.nl)

  • Unable to compile class for JSP in tomcat

    Hi
    I developed an application. it works Ok in embedded OC4J server. But I get the following error when I deployed to tomcat server :
    org.apache.jasper.JasperException: Unable to compile class for JSP
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
         oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
         oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
         oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
         oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    I followed the steps of deploying exactly as Oracle developer guide and I don't know what is the reason of this error
    please how can I solve this problem

    Hi
    16-Jan-2007 04:09:17 org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet Faces Servlet threw exception
    Compile failed; see the compiler error output for details.
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
    at org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:219)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
    at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
    at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)

  • Is it possible to set a minimum height for a DIV container?

    Hello fellow developers,
    I wonder if it is possible to set a minimum height or a fixed height for a DIV container (P container, SPAN conrainer) like in HTML?
    Thank you!

    Thank you, Robin!
    But is it somehow possible to reserve a portion of space in the text flow so that later I can put a movie clip over this open space?
    (In HTML I would create a fixed dimension DIV element for this purpose and add its contents later.)

Maybe you are looking for

  • DNS configuration for webhosting - follow-up question

    In regard to my previous inquiry I want to add another question affiliated with that. We want to use our own DNS servers for domain registration. For this purpose, I need two DNS servers - ns1.domain.com and ns2.domain.com. domain.com is a domain own

  • Difference impact on Net Value

    Hi All, Similar questions have been answered but this has not solved my queries so I have to post. the user wants to post the difference in amount received and invoice amount in some loss account. this is happening but in doing this, I have to give t

  • Internet explorer menus on 4k monitors very very small

    When I run IE on my 4k monitor I use the control+mouse wheel capability to nicely zoom the contents of the browser window. Works great.  It would be really useful if the cursor could also size up to a usable size and for the menus, navigation bar etc

  • Adobe Reader X Refund

    Unhappy with Adobe Reader X.  It did not do what I wanted it to, and I canceled my membership the day I purchased the product.  I would like to receive a full refund for my purchase!! 

  • Getting PL/SQL:ORA-00933 when using CASE logic as a control structure

    Hello Everybody,I have created a PL/SQL block(Control Structure) to calculate bonus of employees based on salary of the employee,but I get errors like ORA-00933 and ORA-06550.Given below is the PL/SQL block which I tried to implement SQL> DECLARE 2 3