How to run applet within packages in tomcat

I have servlet packages and applet packages in my application. I can successfully called my servlet packages by using:
http://localhost/servlet/mypackage1.mypackage2.myServlet
However, I can't call my applet packages by using:
http://localhost/myapplet.html
<Applet
CODE = "myApplet.class"
BASECODE = "mypackage1.mypackage2/"
</Applet>
I am currently using tomcat default web services directory structure as follows:
webapps\ROOT\WEB-INF\classes\mypackage1\mypackage2\myServlet.class
webapps\ROOT\mypackage1\mypackage2\myApplet.class
I received the following error:
noClassDefFoundError:myApplet (wrongname: mypackage1\mypackage2\myApplet)
Thanks in advance for any helps.

This doesn't have anything do with servlets. Your
problem, as you said, is how to write the HTML to run
an applet. Whatever is trying to load that HTML
doesn't know anything about your servlets and doesn't
care. I think it is complaining because you did or
didn't put your applet in the (badly-named) package
mypackage1.mypackage2.The package names I used was just an example. My real package names were really long and 10 levels deep so I didn't want to use it. I finally figured out how to tell the browser to find my applet class package. Using my original example (with the bad package names):
<Applet
CODE = "mypackage1.mypackage2/myApplet.class"
</Applet>
I removed the codebase and just put the package class file in the root directory.
I am sure there are more than one way to make this thing work but this is how I got my to work. Thanks.

Similar Messages

  • HOw to run Applet in browser.

    Hi guys. I've got 2 problems.
    1. In Window, I've got Java installed (and using NetBean IDE as Java editor), so of course I've got j2sdk_nb-1.4.2 installed as well. But I couldn't run any applet in IE, for example, in games.yahoo.com, I couldn't join any game because applet always failed to load. But yesterday, I've got a pop up asking to install jre1.4.2 and after install this JRE, everything works fine. My point here is, when I have SDK1.4.2 which contains JRE, why should I have to install new JRE to run applets ?
    2. Could anyone tell me how to run applet in Mozilla, Linux. I'm using Linux RedHat 9 as well. And in Redhat, I've got J2sdk_nb-1.4.2 installed with NetBeans IDE. It said that I need appropriate Plugs-in, but in my Java directory, I also found Plugsin directory. So how to configure Mozilla to run applet.
    Thanks for reading.

    Just to let you guys know that I sorted it out already. Well, the problem lies in I'm confused between two directory /usr/lib/Mozilla and /usr/lib/Mozilla and two Java plugs-in available in nsc60 and nsc60-gcc (don't remember exactly)
    For my Linux (Red Hat 9), I've got to create symbol link from nsc60 directory to /usr/lib/Mozilla, not any other way.
    Thanks

  • Urgent: how to run applet which connected to the servlet?

    hi frends:
    i have written an applet on the server side and it supposed to pass parameters to my servlet and retrieve some info from the servlet.
    i put both applet and servlet under tomcat../WEB-INF/classes. but when i run the applet from the web browser, there is no response from the servlet.
    could anyone help me to solve this problem?
    one more thing is i know that applet is able to connect to servlet, but how about java application? is it able to do so? if yes, is it also using URLconnection as applet? and how to run it?
    i will be very appreciate if anyone can help me... thanx a million.

    You can connect to the servlet from an application.There's a URL class in java.net that has an openConnection method. Then cast the return to an HttpURLConnection and use setMethod to set up as a post request.This may be the default if you call setDoOutput(true) on the URLConnection. Then you'll need to get an OutputStream and write properly formatted form POST data to it. It's also possible to encode your data on the URL, even when using the POST method, and this may be easier when doing it programmatically from an application. To send a get request you can append the name-value pair at the end of the url.

  • How to run jsp file in Apache Tomcat 5.0?

    hi,
    i'm using jdk1.5,jsp1.2 & Apache Tomcat 5.0 as a web server.in my application i have 2 jsp files,1 html file & 1 javabean class.where i must place the html,jsp files and the .java file & .class file for a bean class.how to run this application.
    bean class:
    public class Userdata {
    private String username;
    private String email;
    private int age;
    public void setUsername( String value )
    username = value;
    public void setEmail( String value )
    email = value;
    public void setAge( int value )
    age = value;
    public String getUsername() { return username; }
    public String getEmail() { return email; }
    public int getAge() { return age; }
    getname.html file:
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="Savename.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    savename.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>
    nextpage.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>
    refer these source code and plz,give the result at the earliest.
    whether i want to write a web.xml file for this jsp file.
    if yes,means plz present the web.xml file for this application.
    plz,if anybody knows give me detailed description for this application.

    create a dir under webapps dir
    place your .html and .jsp files here
    also create WEB-INF dir here
    Under WEB-INF create classes and lib dir
    under classes dir put your .class file
    You also need to put web.xml under your WEB-INF dir.
    You ca keep your java file any where u want on your computer.

  • How to Run 2012 SSIS packages on 2008R2 Version

    HI Friends,
    I have scheduled a job to run 2012 SSIs packages on 2008R2. I am getting this error can you please Give any ideas how can I run them without converting!
    ERROR Is :
    Package migration from version 6 to version 3 failed with error 0xC001700A "The version number in the package is not valid. The version number cannot be greater than current version number."

    Hello,
    There is backward compatibility in SSIS but no forward compatibility, meaning, when 2008 R2 is developed they were aware of all versions less than 2008 R2 and included execution scenarios , this is backward compatibility
    while 2008 R2 is being developed , 2012 is not yet developed. so we cannot execute a 2012 package on 2008 R2 Server where vice versa is possible 
    Correct.
    The "backwards compatibility" is implemented by SSIS upgrading older versions of packages to the current version of SSIS when executing. If the upgrade fails, you're out of luck.
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • How to run applet in a browser

    I know already how to jar files but my only problem is how to attached my applet in an html.. how to run this in a browser.. please help..

    http://java.sun.com/docs/books/tutorial/deployment/applet/deployindex.html

  • How to run different versions of Apache Tomcat on one machine?

    Hi, I am developing a web application. My application runs on Apache Tomcat 5.5.12 and i am using jdk 1.5_03. My application detects files that are automatically scanned to a specific directory and queues them for capture in a database.
    The scanner software (HP Toolbox) is also a web application (Unfortunately), it installs itself with Apache Tomcat 4.03. It is "wired" in a specialised way (not the way you would usually deploy web apps). So the Web server is customised by HP (Hewlett-Packard).
    The scanner needs this software running inorder to automatically scan to a specified folder. You can only specify local directories to scan to from the Toolbox application
    There seems to be some resource conflict when I run my version of Tomcat when the Toolbox application is running (I get an exception
    ..IllegalMonitorState...current thread not owner). Visa vera is alos true..if i start my application first the Toolbox application won't run.
    I tried to install the Toolbox app on another machine and monitor a directory remotely...this doesn't work because you can't read or write to remote files from a servlet or JSP.
    I tried loading my application in the web apps directory of Apache 4.03 but it did not detect my application. I don't know how to configure the Tomcat customised by HP.
    How can i go about this problem? Is there a way of running two versions of Apache Tomcat on one machine?
    Thanks
    Parthiv

    This is the exception i get when i try to run my version of Apache Tomcat when the Toolbox is running: My application is set to port 80.
    Exception in thread "http-80-1" java.lang.IllegalMonitorStateException: current thread not owner
         at java.lang.Object.notifyAll(Native Method)
         at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1216)
         at java.lang.Thread.run(Unknown Source)

  • How to run Applet programe in IE

    I' am beginner in java & i want to run applet in IE.But when i tried to do it in IE,"page can not displayed" error is shown.
    why this is so?
    which steps to follow?

    which JVM is used by IE? The 1.1.8JVM from IE is very old so you should use a Java2 JVM or a Swing-Plugin for IE

  • How to run ActiveX bridge packager without VC++

    Hello everybody,
    The ActiveX Bridge Developer Gude states that I have to
    install Microsoft Visual C++ 6.0 with SP3 to run the ActiveX packager.
    Is there a way to run the packager without installing MS VC++ on my computer?
    What components from VC++ are actually required?
    May be they can be found in other software?
    Thank you to anyone who give me a hint.

    I found the link below while trying to determing the same thing, but I have not actually attempted to get it working yet.
    http://forum.java.sun.com/thread.jsp?forum=40&thread=522688&tstart=0&trange=15

  • How to run python within Java?

    I want to run python command within java. Not sure how to do this.
    Seems like runtime.getRuntime.exec() is something that i can use.
    but all the examples were for unix platform and not any other.
    Can i run python command using getRuntime().. please let me know
    Thanx

    I want to run python command within java.I've created a project, "Java Embedded Python" that might work for you.
    Check out http://jepp.sourceforge.net . Maybe it'll work for you...

  • How to run applet program in browser

    I am new in the field. I have begun with some basic programming. I wish to know how do you run a java programme in browser. I have added the html tag in the .java file. can anyone kindly let me know. thanks

    You don't add the tag to the .java file. You need a separate HTML document (such as a .html file, or a .jsp, etc.) that has the <applet> tag in it. (Also there's some stuff you can do with <object> and/or <embed>, apparently.) The applet tag tells the browser to load your applet.
    http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

  • How to run Applet using jsp in netbeans 5.5

    hi,
    I want to run an applet program using jsp and tomcat. I have created an applet class in NetBeans 5.5 and also a Jsp. In that jsp I have given the <jsp:plugin type="" code="" ......> tag. But its not warking. Can any one please tell me the correct steps to run that applet?
    Thanks

    no clue???????????

  • How to run applet after open an IE vit in labview?

    Dear all,
    In my application, I open IE using labview vit to run an html page which contains an applet.
    But the problem is at my computer at home, when I run the JVM automatically shows up and run the applet, but at the office, this JVM does not show up show it can not run (although if I open it using standalone IE, it runs fine)
    I did check for the IE settings, windows Xp (sp2), JVM 1.5, and others but still not solved.
    Is there anything to do with labview to make sure that the JVM run the applet?
    Thanks.

    Thanks,
    I did as you advise, but still not work.
    For a more clear explaination:
    I attach 4 files (in zip file called esco.vip, pls change back to .zip and open it): one is labview file to open the IE, one is the html file, the other is the .class file of java applet, the last one is the source code of this java applet (for you to recompile and check the safety in case you doubt my .class file about security). Pls put all of them in the same folder
    So, if your computer has the JVM, you open the html file using an IE, you will be able to see scroll text runing.
    if you open the labview vi, key in the file name, and run it, my home computer can see, but my office computers is not allowed to see (it will appear the grey line). I'm not sure you computer will experience the same (hope you do )
    So my question is: how to make it running in labview?
    I had check the setting and configuration, they are quite similar:
    -win XP, SP2
    -IE 6
    Attachments:
    esco.zip ‏70 KB

  • How to run applets on the internet?

    I want my applet class run on the Internet but not in the Internet browser but instead maybe in appletviewer or something else...For example in java.sun.com the chatroom is an applet and it doesn't run in browser as I understand.because when I clicked on the exit button on the right most side, it understands that I clicked on it which means that it has got window events(e.g. windowclosing) which belongs to appletviewers.But I think internet browsers doesn't have such a capability to understand these windowevents.So the question is: how can I run my applet over the Internet without running it on the browser? or how I can make the browser understand that the windowclosing event occured on it?
    thanks for your attention??

    what chatroom are you talking about ?

  • How to run procedure in package?

    Hi,
    I'd like to know how I can run the following procedure successfully. here is the package and the procedure.
    Code:
    create or replace PACKAGE TEST_PK AS
    /* TODO enter package declarations (types, exceptions, methods etc) here */
    type project_type is record(c1 test.visits%TYPE);
    type project_type1 is ref cursor return project_type;
    procedure myproc_sp(result1 in out project_type1);
    END TEST_PK;
    The body is bellow:
    create or replace PACKAGE BODY TEST_PK AS
    procedure myproc_sp(result1 in out project_type1) AS
    BEGIN
    /* TODO implementation required */
    open result1 for
    select test.visits from TEST;
    END;
    END;
    On SQL-PLUS I try to do the following:
    variable c1 refcursor
    execute TEST.MYPROC_SP(:c1)
    And as soon as I type that I get the following error message:
    Error Msg
    BEGIN proc_name(:);
    ERROR at line 1:
    ORA-06550: LINE 1, COLUMN 7:
    PLS-00201: identifier 'proc_name' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statment ignored
    Can someone tell me what is wrong with this process and how to fix it?
    Thanks for your help.
    Gene

    By using PL/SQL.
    DECLARE
    TYPE return_cur IS REF CURSOR RETURN temp_jl%ROWTYPE;
    p_retcur return_cur;
    rec temp_jl%ROWTYPE;
    BEGIN
    for c_rec in (SELECT * FROM temp_jl)
    LOOP
    rec := c_rec;
    dbms_output.put_line('Out put is : '||rec.name || ' - ' || rec.name2);
    end loop;
    END;

Maybe you are looking for