Please Urgent sound applet in jsp problem
Hi please any body hekp me urgently.
I have a problem while playing a sound applet in the jsp file the error is class not found.
My applet class file is in the com.mypack.common
its code is
public class PlayErrorSoundApplet extends Applet
public PlayErrorSoundApplet()
public void init()
public void playSound()
String soundObj = getParameter("soundObj");
AudioClip sound = getAudioClip(getDocumentBase(), "success.wav");
sound.play();
in the jsp i have written the code like this
<applet codebase="com.mypack.common" code="PlayErrorSoundApplet.class" name="soundApplet" width="0" height="0">
<param name="soundObj" value="error.wav">
</applet>
In the applet console i got class not found error.
please help me .....advanced thanks......
actually, codbase is a directory. so
<applet codebase="com/mypack/common" code="PlayErrorSoundApplet.class" name="soundApplet" width="0" height="0">
<param name="soundObj" value="error.wav">
</applet>this means you have something like
pacakge com.mypack.common
public class PlayErrorSoundApplet {
Make sure to put the html file in the root directory of the package structure
/myhtmlfile.html
/com
/mypack
/common
PlayErrorSoundApplet.class
Similar Messages
-
Swing Applet in JSP: problem with fetching data from database
i am facing a problem while fetching data from database using Swing Applet plugged in a JSP page.
// necessary import statements
public class NewJApplet extends javax.swing.JApplet {
private JLabel jlblNewTitle;
private Vector vec;
public static void main(String[] args) {
JFrame frame = new JFrame();
NewJApplet inst = new NewJApplet();
frame.getContentPane().add(inst);
((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
frame.pack();
frame.setVisible(true);
public NewJApplet() {
super();
initGUI();
private void initGUI() {
try {
this.setSize(542, 701);
this.getContentPane().setLayout(null);
jlblTitle = new JLabel();
this.getContentPane().add(jlblTitle);
jlblTitle.setText("TITLE");
jlblTitle.setBounds(197, 16, 117, 30);
jlblTitle.setFont(new java.awt.Font("Dialog",1,20));
jlblNewTitle = new JLabel();
this.getContentPane().add(jlblNewTitle);
Vector vecTemp = getDBDatum(); // data fetched fm DB r stored here.
jlblNewTitle.setText(vecTemp.get(1).toString());
jlblNewTitle.setBounds(350, 16, 117, 30);
jlblNewTitle.setFont(new java.awt.Font("Dialog",1,20));
} catch (Exception e) {
e.printStackTrace();
}//end of initGUI()
private Vector getDBDatum() {
// fetches datum from oracle database and stores it in a vector
return lvecData;
}//end of getDBDatum()
}//end of class
in index.jsp page i have included the following code for calling this applet:
<jsp:plugin type="applet" code="NewJApplet.class" codebase="applets"
width="600" height="300">
<jsp:fallback>Could not load applet...</jsp:fallback>
</jsp:plugin>
if i view it in using AppletViewer it runs perfectly and display the data in JLabel. (ie, both jlblTitle and jlblNewTitle).(ie, DATA FETCHES FROM db AND DISPLAYS PROPERLY)
BUT IF I CLICK ON INDEX.JSP, ONLY jlblTitle APPEARS. jlblnNewTitle WILL BE BLANK(this label name is supposed to fetch from database)
EVERY THING IS DISPAYING PROPERLY EXCEPT DATA FROM DATABASE!!!
i signed the applet as follows :
grant {
permission java.security.AllPermission;
Can any body help me to figure out the problem?This is the Swing Applet java code
import java.awt.Dimension;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.JScrollPane;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
public class HaiApplet extends javax.swing.JApplet {
private JLabel jlblTitle;
private JLabel jlblNewTitle;
private Vector vec;
* main method to display this
* JApplet inside a new JFrame.
public static void main(String[] args) {
JFrame frame = new JFrame();
NewJApplet inst = new NewJApplet();
frame.getContentPane().add(inst);
((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
frame.pack();
frame.setVisible(true);
public HaiApplet() {
super();
initGUI();
private void initGUI() {
try {
this.setSize(542, 701);
this.getContentPane().setLayout(null);
jlblTitle = new JLabel();
this.getContentPane().add(jlblTitle);
jlblTitle.setText("OMMS");
jlblTitle.setBounds(197, 16, 117, 30);
jlblTitle.setFont(new java.awt.Font("Dialog",1,20));
jlblTitle.setHorizontalAlignment(SwingConstants.CENTER);
jlblTitle.setForeground(new java.awt.Color(0,128,192));
jlblNewTitle = new JLabel();
this.getContentPane().add(jlblNewTitle);
Vector vecTemp = getDBDatum();
jlblNewTitle.setText(vecTemp.get(1).toString());
jlblNewTitle.setBounds(350, 16, 117, 30);
jlblNewTitle.setFont(new java.awt.Font("Dialog",1,20));
} catch (Exception e) {
e.printStackTrace();
}//end of initGUI()
private Vector getDBDatum() {
Vector lvecData = new Vector(10,5);
Connection lcon = null;
Statement lstmt = null;
ResultSet lrsResults = null;
String lstrSQL = null;
String lstrOut = null;
try {
OmmsDBConnect db = new OmmsDBConnect();
lcon = db.connectDb();
lstmt = lcon.createStatement(lrsResults.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
lstrSQL = "select DT_ID from P_DATATABLES";
lrsResults = lstmt.executeQuery(lstrSQL);
int i = 0;
lrsResults.last();
int length = lrsResults.getRow();
System.out.println(length);
lrsResults.beforeFirst();
int recCount = 0;
while (lrsResults.next()) {
recCount++;
lvecData.addElement(new String(lrsResults.getString("DT_ID")));
// System.out.println("ID : " + lrsResults.getString(1));
i++;
}System.out.println("here 3 out fm while");
catch(SQLException e) {
System.out.print("SQLException: ");
System.out.println(e.getMessage());
catch(Exception ex) {
lstrOut = "Exception Occured " + ex.getMessage();
finally {
try {
lrsResults.close();
lstmt.close();
lcon.close();
System.out.println("[DONE]");
catch(Exception e) {
System.out.println(e);
}//end of finally
return lvecData;
}//end of getDBDatum()
}//end of classOfcourse the above code compiles and runs well. in Applet Viewer
I plugged the above Swing Applet in a JSP page index.jsp
<jsp:plugin type="applet" code="NewJApplet.class" codebase="applets"
width="600" height="300">
<jsp:fallback>Could not load applet...</jsp:fallback>
</jsp:plugin>Every thing is working fine in AppletViewer...But if i view this in any browser, then only the jlblTitle is displaying. jlblNewTitle is not displaying(this label name is actually fetching from thedatabase)
can any body help me regarding this matter.? Thx in Advance. -
Including applets in JSP - problem!!
I'll begin by admitting that I am fairly new to JSP. That said, I am experiencing a ClassNotFoundException when trying to include an applet in a JSP under certain conditions. Here's the detail:
I'm using Tomcat 4.0.4 and am working in the default ROOT webapp directory. This is running on Win2k Pro on port 8080. I HAVE managed to get the applet to load under the following circumstances:
- JSP page in ROOT/jsp directory
- applet class file (and supporting classes) ALSO in ROOT/jsp directory
That's just great... but I want to be able to place the applet class file and supporting classes with all of the other class files in ROOT/WEB-INF/classes. Here's the scenario that fails time and time again:
- JSP page in ROOT/jsp directory
- applet class file (and supporting classes) in ROOT/WEB-INF/classes
- in this scenario I have added a 'codebase' attribute to the applet tag (please be aware that I have tried this with both the APPLET tag and the jsp:plugin tag, each method yielding identical results)
- I have tried several different codebase values, all listed below:
codebase="../WEB-INF/classes/"
codebase="http://localhost:8080/servlet/"
codebase="http://localhost:8080/WEB-INF/classes/"
codebase="."
and I have tried it w/o a codebase at all
None of these help the JSP to find the applet class file. I've really thrown my hands up in the air with this. I realize that every 3rd or 4th thread is typically a beginner with some Class not found error... but I've put my time in on this one, and I cannot figure it out. Thanks.Hi, Ben
You bring up a very good issue that a lot of these books about JSPs and Servlets usually forget to mention.
I dont know what sort of Web Servlet Container you are using, but I know that in Tomcat there is a 'lib' and and 'classes' directory, so if you want to have classes that are used by different applications from different directories then you can place them there. If you want you can compile all these classes into a jar and put that jar either in the 'TOMCAT_HOME/lib' or 'TOMCAT_HOME/common/lib' directories or you can simply put all the .class files into either the 'TOMCAT_HOME/classes' or 'TOMCAT_HOME/common/classes' directories. This way your classes will be known to any applications running on your webserver.
If, however, you want supporting classes to be only used by servlets or jsps, then you should put them in the web-inf directory.
Let me know if this works,
Val. -
Can anyone please help me, I'm having problems with sound while watching video clips using flash player & Internet Explorer
There's a good chance that this is a known issue. We'll have a Flash Player 18 beta later this week that should resolve this at http://www.adobe.com/go/flashplayerbeta/
-
my ipod got wet and allow time to dry, I turn now the musics and sound and everything but the screen is blank and nothing is visible. a solution please urgent.
See my reply to your other post
-
How to import and display an applet from JSP
i m using netbeans 5.0
i have class named myapplet.class
and jsp named myjsp.jsp
now i want to access(import) this myapplet.class from jsp
also i want to display this applet from this jsp
i am able to do either thing but not both
so please help me it is so urgent and important for me bcoz
i have to complete my project as early as possible
Thanks in advancemy jsp source file page path is D:\Reliance
project\WebApplication3\web\
and classes path is D:\Reliance
project\WebApplication3\build\web\WEB-INF\classes\
so problem is that if i want to use myapplet.class
then i have to put my class in D:\Reliance
project\WebApplication3\build\web\WEB-INF\classes\
location
but at that time i am not able to display this applet
on my jsp
if i put my myapplet.class in
D:\Reliance project\WebApplication3\web\ then i m
able to display
applet but not able to access(import) this class
hope you will got the problem!!!
thanks for your reply !!!try to set the path of your applet on jsp something like this
"WEB-INF/classes/myclass.class" -
Applets in Jsp generates ClassNotFoundException
hi there,
I face a problem of calling applets in Jsp.
The code to call applet is:
<jsp:plugin type="applet"
code="core.TextApplet"
width="475" height="350">
</jsp:plugin>
And I have a 'core' directory in source packages and TextApplet.java in core directory.Wehn I run the TextAppletJSP ,it gives me an error message in applet display area:
Exception:java.lang.ClassNotFoundException:core.TextApplet
Anyone who help me for this problem plz.
thanks for your help.
gezahegnI am also getting out of memory errors, and Tomcat keeps increasing in memory on every page refresh. Please let me know if you get this resolved how you did it. Thanks.
-
Applets in JSP --- I'm going crazy!
I am using an applet I have written on a JSP page which I have also written.
Using: Win2K, IE6, J2SDK 1.4, Tomcat 4.0.3
I have several problems. Even if you can answer only one of them, it will be a great help!
Here is how I'm adding the applet.
<jsp:plugin type="applet" code="RawData.class" name="rawData" jreversion="1.4" width="700" height="55" >
<jsp:fallback>
Plugin tag OBJECT or EMBED not supported by browser.
</jsp:fallback>
</jsp:plugin>
</TD>
Problem 1) I can only get the applet loaded if the applet class file is in the same folder as the JSP file. Anything else, and I get a ClassNotFoundException.
Can't get the CODEBASE to do anything for me at all.
I set my codebase="/RawData/classes", but makes no difference.
I then tried Jarring my applet and placing RawData.jar in the same folder with the JSP. But also no go. I then set codebase="RawData.jar", but guess what... Nothing.
So my questions are: How do I get the applet to load from the applet.class files using codebase if the applet files are in a sub folder? And how do I get my applet to load from a Jar?
Problem 2) Once this applet is loaded, I have the biggest nightmare imaginable to get the browser to load a new version after I have updated it. And trust me, there is not and old version of the applet.class in my ClassPath. In fact there is not another copy of the applet.class file anywhere on my PC. I made sure. I have also disabled the Java Plugin Cache option, and deleted my temporary internet files with Explorer. But the thing persists in loading the old version from somewhere. What the heck do I do? I fear this is driving me insane.. :)
Problem 3) I need the HTML components to interact with the applet.
When I do a call to an applet function passing no parameters it works fine, and I get the value back, like this:
<SCRIPT LANGUAGE="VBScript">
<!--
Sub btnGetID1_OnClick
document.all("id1Pattern").innerText = document.rawData.getSelection()
End Sub
-->
</SCRIPT>
But when I do a function call, passing parameters, the scrip just stops working altogether, like this.
<SCRIPT LANGUAGE="VBScript">
<!--
Sub id1Pos_onfocus
document.rawData.setSelection(5, 10)
End Sub
-->
</SCRIPT>
Why is this. What am I doing wrong.
And better yet... Is there a way of manipulating the HTML components from within JSP scriplet <% ... %>?
Please if anyone can help... It will be greatly appreciated. I am at a loss!
Thanx. QuigrimQuigrim wrote:
Problem 1) I can only get the applet loaded if the applet class file
is in the same folder as the JSP file. Anything else, and I get a
ClassNotFoundException. Can't get the CODEBASE to do anything for me
at all.Set CODEBASE to point to the relative directory where your code is. If it is in the same directory as the JSP then CODEBASE="."; if it is in a sub-directory 'classes' then CODEBASE="classes".
Problem 2) Once this applet is loaded, I have the biggest nightmare
imaginable to get the browser to load a new version after I have
updated it. Close ALL browser windows - you have to force the plugin JVM to re-initialise - I've not found any other way to do it.
Hope these help you.
Phil. -
Cinnamon Sound Applet Dropdown Menu Is Empty
Hi!
Sound Applet (volume) that sits in panel has a strange behavior. If no media player launched dropdown menu shows all the items:
Launch Player
Volume
Sound Settings
Output Device
But when I launching player all these items disappears and I getting an empty menu
image link
Has anyone had this problem?
modedit (Xyne)
Removed huge image. Please read our forum policy: https://wiki.archlinux.org/index.php/Fo … s_and_Code
Last edited by chord (2013-05-10 23:22:53)I am having this issue too. There are a few issue threads on github for this, but AFAIK, no solution as of now.
https://github.com/linuxmint/Cinnamon/issues/1962
https://github.com/linuxmint/Cinnamon/issues/2092 -
My iPhone 6 ear speaker is not working properly I couldn't able to hear any thing from ear speaker to listen I had to put on loud speaker or to use hands free please help me out with this problem if some body have answer?
Hi Venkata from NZ,
If you are having an issue with the speaker on your iPhone, I would suggest that you troubleshoot using the steps in this article -
If you hear no sound or distorted sound from your iPhone, iPad, or iPod touch speaker - Apple Support
Thanks for using Apple Support Communities.
Best,
Brett L -
How do I play sound in a JSP page with out using the <EMBED> tag? I tried using the
java.applet.* but I keep getting errors.
Thankstry using Java's Multimedia Framework ... JMF
-
Premiere Pro 2.0 and Windows 7 - Direct Sound Input soundcard driver problem
My XP machine crashed, I reinstalled Premiere Pro 2.0 with Windows 7, and I got the following error: 'The Currently installed soundcard driver does not support Direct Sound Input. Recording audio is not possible.' The soundcard drivers are updated. Any ideas? Here's what I have: AMD Phenom II X4 965 Processor 3.40 GHz 8 GB, 64 bit. Thank you for looking.
Thanks! Though I upgraded to solve the problem, this is good to know.
Bob
Date: Wed, 9 Nov 2011 04:45:42 -0700
From: [email protected]
To: [email protected]
Subject: Premiere Pro 2.0 and Windows 7 - Direct Sound Input soundcard driver problem
Re: Premiere Pro 2.0 and Windows 7 - Direct Sound Input soundcard driver problem created by Steve-Italy in Premiere Pro CS4 & Earlier - View the full discussion
VERY VERY VERY EASY (now, when I solved the problem, not before...!!!)
Insert Micropone or any jack in Micropone Input or Aux Input, on your sound card or motherboard !
AND NOW YOU CAN USE PREMIERE PRO 2.0
Enjoy
Steve - Italy
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4015730#4015730
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4015730#4015730. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Premiere Pro CS4 & Earlier by email or at Adobe Forums
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
i have already made an applet code for my program....now i want to make it flexible by using JSP...
Should i write the code from scratch (for JSP)....or is there some way i can call the applet from JSP ...
Please suggest.see if this thread helps you
http://forum.java.sun.com/thread.jsp?forum=45&thread=166514
Cheers
Khalid -
Hi al,
When we try to invoke an applet from jsp, applet class is not able to initialize (not able to load the class)
Exception got in java console as follows :
Load: class SignedAppletDemo.class not found.
java.lang.ClassNotFoundException: SignedAppletDemo.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
We are using <jsp:plugin> tag for access applet from jsp in Oracle Appserver.(OC4J).
If anyone have any idea on the above,please let us know. Please pass on steps to follow for access applet from jsp file.
Thanks,
RajkumarReview
URL.openConnection()
and HttpURLConnection -
Unable to load Applet in JSP using Tomcat 5.5.12
Hi
I am aunable to applet in jsp using Tomcat 5.5.12 and JRE 1.5. Below is the code that I am using
<applet
codebase = "."
archive = "WebPOSApplet.jar"
code = "webposprint.WPMainApplet.class"
name = "Trans Applet"
width = "450"
height = "115"
hspace = "0"
vspace = "0"
align = "middle"
>
<param name = "redirectInfo" value = "SearchProducts.do">
</applet>
<%/*%>
<OBJECT
classid = "clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA"
codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0"
WIDTH = 450 HEIGHT = 115 >
<PARAM NAME = CODE VALUE = webposprint.WPMainApplet.class>
<PARAM NAME = archive VALUE = WebPOSApplet.jar>
<PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.2">
<param name = "redirectInfo" value = "SearchProducts.do">
<PARAM NAME = "scriptable" VALUE = "false">
<PARAM NAME = model VALUE=models/buckminsterfullerine.xyz>
<embed width="450" height="115" code="webposprint.WPMainApplet.class" archive="WebPOSApplet.jar" type="application/x-java-applet;jpi-version=1.4.2" redirectinfo="SearchProducts.do" scriptable="false" model="models/buckminsterfullerine.xyz" src="webposprint.WPMainApplet.class">
</embed> <COMMENT> <EMBED
type = "application/x-java-applet;jpi-version=1.4.2" \
CODE = webposprint.WPMainApplet.class\
archive = WebPOSApplet.jar\
WIDTH = 373 \
HEIGHT = 167 \
model =models/buckminsterfullerine.xyz \
scriptable = false \
pluginspage = "http://java.sun.com/products/plugin/index.html#download"> <NOEMBED>
alt="Your browser understands the <APPLET>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET>
tag! </NOEMBED> </EMBED> </COMMENT>
</OBJECT>
<%*/%>
This code doesn't seems working with Tomcat 5.5.12. I works fine with Tomcat 4.1.31
Please help
ThanksApplets run client side - which means the relevant class files need to be downloaded to the client.
Anything under the WEB-INF directory is not directly accessible by the client. Nothing under WEB-INF can be downloaded.
ergo, specifying the WEB-INF directory as part of your applet codebase is a bad idea.
I would suggest try copying the applet classes from under WEB-INF to some other place in your application.
Also, you should probably specify the full class name of your Applet in the plugin tag.
<%@ page import="com.util.MyApplet" %>
<jsp:plugin type="applet" code="com.util.MyApplet" codebase="/classes" width="250" height="100" jreversion="1.6">
<jsp:fallback>
<B>Unable to start plugin!</B>
</jsp:fallback>
</jsp:plugin>cheers,
evnafets
Maybe you are looking for
-
Oracle 8.1.7 and Linux 6.2
Hi Please help us in solving the below mentioned problem. We are trying to install Oracle 8.1.7 under Linux 6.2 . During the installation the following error displays and could not able to finish the instllation. The problem is Error in invoking targ
-
Please Help with Burn Error in iDVD 4.0.1
I'm using a G5 and running OS 10.3.9. I've burned a slideshow once with no problems using iDVD over a year ago and went to try again recently (after upgrading whenever an upgrade was available) and I'm getting the following error: Errors were found d
-
HI I have downloaded some TV shows from Itunes and when I go to sync them to my iPod I get an error message saying the item can't be downloaded because the item can't be played in this iPod. I am not sure what is wrong. I have an Ipod Nano 4gb i thin
-
Hi All Is there any Sleep or Delay function available in Indesign Javascript. I need that function to proceed my task. Sajeev
-
Is your Siri working right now? I have been told "something is wrong plz try again later" since this morning. Is there a server problem for apple today?