Hi
I am working on JMF applets.
My problem is that the Applet runs successfully in the appletviewer.
But when i run it using any browser it shows Appled Loading Failed Error
In Firefox and Netscape ,
The Java Console shows following error
java.lang.NoCla ssDefFoundError : javax/media/ControllerListe ner
at java.lang.Class Loader.defineCl ass0(Native Method)
at java.lang.Class Loader.defineCl ass(Unknown Source)
at java.security.S ecureClassLoade r.defineClass(U nknown Source)
at sun.applet.Appl etClassLoader.f indClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadCode(Unknown Source)
at sun.applet.Appl etPanel.createA pplet(Unknown Source)
at sun.plugin.Appl etViewer.create Applet(Unknown Source)
at sun.applet.Appl etPanel.runLoad er(Unknown Source)
at sun.applet.Appl etPanel.run(Unk nown Source)
at java.lang.Threa d.run(Unknown Source)
My ClassPath settings are
echo %CLASSPATH%
C:\Program Files\JMF2.1.1e \lib\jmf.jar;
I have copied and paste jmf.jar files in to run time environment
jar/lib/.
3 5193
Hi
I am working on JMF applets.
My problem is that the Applet runs successfully in the appletviewer.
But when i run it using any browser it shows Appled Loading Failed Error
In Firefox and Netscape ,
The Java Console shows following error
java.lang.NoCla ssDefFoundError : javax/media/ControllerListe ner
at java.lang.Class Loader.defineCl ass0(Native Method)
at java.lang.Class Loader.defineCl ass(Unknown Source)
at java.security.S ecureClassLoade r.defineClass(U nknown Source)
at sun.applet.Appl etClassLoader.f indClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadCode(Unknown Source)
at sun.applet.Appl etPanel.createA pplet(Unknown Source)
at sun.plugin.Appl etViewer.create Applet(Unknown Source)
at sun.applet.Appl etPanel.runLoad er(Unknown Source)
at sun.applet.Appl etPanel.run(Unk nown Source)
at java.lang.Threa d.run(Unknown Source)
My ClassPath settings are
echo %CLASSPATH%
C:\Program Files\JMF2.1.1e \lib\jmf.jar;
I have copied and paste jmf.jar files in to run time environment
jar/lib/.
Let's see your applet tags
Hi TypicalPlayerAp plet.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> Video Mail Player</title>
</head>
<body>
<applet code="TypicalPl ayerApplet" width=400 height=400>
<param name=file value="Video 4.avi">
</applet>
</html TypicalPlayerAp plet.java
import java.applet.App let;
import java.awt.*;
import java.lang.Strin g;
import java.net.URL;
import java.net.Malfor medURLException ;
import java.io.IOExcep tion;
import javax.media.*;
/**
<!-- Sample HTML
<applet code=TypicalPla yerApplet width=400 height=400>
<param name=File value="Video 4.avi">
* </applet>
* -->
*/
public class TypicalPlayerAp plet extends Applet implements ControllerListe ner
{
// media player
Player player = null;
// component in which video is playing
Component visualComponent = null;
// controls gain, position, start, stop
Component controlComponen t = null;
// displays progress during download
Component progressBar = null;
public void init()
{
// setLayout(new BorderLayout()) ;
String mediaFile = null;
String url1= "http://localhost:8092" ;
// URL for doc containing applet
// Get the media filename info.
// The applet tag should contain the path to the
// source media file, relative to the html page.
if ((mediaFile = getParameter("F ILE")) == null)
Fatal("Invalid media file parameter");
try
{
URL url= new URL(url1);
URL codeBase = getDocumentBase ();
// Create an url from the file name and the url to the
// document containing this applet.
if ((url = new URL(codeBase, mediaFile)) == null)
Fatal("Can't build URL for " + mediaFile);
// Create an instance of a player for this media
if ((player = Manager.createP layer(url)) == null)
Fatal("Could not create player for "+url);
// Add ourselves as a listener for player's events
player.addContr ollerListener(t his);
}
catch (MalformedURLEx ception u)
{
Fatal("Invalid media file URL!");
}
catch(IOExcepti on i)
{
Fatal("IO exception creating player for ");
}
catch(NoPlayerE xception j)
{
Fatal("IO exception creating player for ");
}
}
public void start()
{
// Call start() to prefetch and start the player.
if (player != null) player.start();
}
public void stop()
{
if (player != null)
{
player.stop();
player.dealloca te();
}
}
public synchronized void controllerUpdat e(ControllerEve nt event)
{
// If we're getting messages from a dead player,
// just leave
if (player == null) return;
// When the player is Realized, get the visual
// and control components and add them to the Applet
if (event instanceof RealizeComplete Event)
{
if ((visualCompone nt = player.getVisua lComponent()) != null)
add("Center", visualComponent );
if ((controlCompon ent = player.getContr olPanelComponen t()) != null)
add("South",con trolComponent);
// force the applet to draw the components
validate();
}
else if (event instanceof CachingControlE vent)
{
// Put a progress bar up when downloading starts,
// take it down when downloading ends.
CachingControlE vent e = (CachingControl Event) event;
CachingControl cc = e.getCachingCon trol();
long cc_progress = e.getContentPro gress();
long cc_length = cc.getContentLe ngth();
// Add the bar if not already there ...
if (progressBar == null)
if ((progressBar = cc.getProgressB arComponent()) != null)
{
add("North", progressBar);
validate();
}
// Remove bar when finished ownloading
if (progressBar != null)
if (cc_progress == cc_length)
{
remove (progressBar);
progressBar = null;
validate();
}
}
else if (event instanceof EndOfMediaEvent )
{
// We've reached the end of the media; rewind and
// start over
player.setMedia Time(new Time(0));
player.start();
}
else if (event instanceof ControllerError Event)
{
// Tell TypicalPlayerAp plet.start() to call it a day
player = null;
Fatal (((ControllerEr rorEvent)event) .getMessage());
}
}
void Fatal (String s)
{
// Applications will make various choices about what
// to do here. We print a message and then exit
System.err.prin tln("FATAL ERROR: " + s);
throw new Error(s); // Invoke the uncaught exception
// handler System.exit() is another
// choice
}
}
Hi
The problem is solved now. The applets do not access your classpath so the jmf.jar file is not access and applet shows the errors. To solve the problem define the copy and paste jmf.jar file in the currect folder and define it in archive tag of html file.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: WMMorgan |
last post by:
There's a website I like to visit that has an user-interactive java
application. There's a "visual applet" component and "control applet"
component. (No, it's not an adult or porno site.)
But the application isn't always usable because one or both of the
applets have "failed," and has to be reset or something like that.
I don't get it. How the hell does an applet "fail"?
It's a set of instructions in code, right? It doesn't...
|
by: Jeff T. |
last post by:
I have an applet that sizes itself to the size of the browser frame
that it is running in. On IE the applet resizes upon dragging the
frame divider.
I'm having a problem with getting this applet to resize itself when I
resize the html frame if it's in Netscape 7.x. Seems like the problem
is the lack of a refresh signal to the java applet from the page. Is
this a known bug, is there a workaround? Thanks.
-Jeff
|
by: Wayne's World |
last post by:
hi everyone,
i have a big problem, writing a image from my applet to my apache
webserver. i tried three way's of writing that file. every way was
described in forums to solve this problem, but non of them worked and
i don't know why. i'll give you the code of my writing-methods and
describe, what happen when i test them, in order someone of you can
give me a usefull tip, where the problem is.
as inputparameter i give my method a new...
|
by: Rowland |
last post by:
Hi,
I know this question has prob. been asked a million times, but I couldn't
find it in the FAQ, so here goes :
I'm trying to write a Java applet to call a dll that resides on the web
server (running IIS 6). I've written a little test applet that should call a
helloWorld function in the dll, but when I use System.loadLibrary, it gives
me this security warning :
|
by: Larry Martin |
last post by:
I am trying to run a Java Applet on my ascx page and am getting an IO
exception when IE6 tries to load the applet. It seems a lot of others are
getting the same problem but a search of the web did not turn up any sort of
solution. I have tried most of the suggestions but none of them seem to have
helped with the problem.
My error is below and the most significant part of it is the HTTP connection
failure.
load: class...
| |
by: ankur |
last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER
MY HttpChatApplet sccessfully Loaded from ChatDispatch but
running on some another PC HttpChatApplet not loaded
my Coad
ChatDispatch.java
|
by: shanmukhi |
last post by:
Hi All
I got a problem in running java programs.
i am not able to run java applet while running i got a problem as
Loading Java Applet Failed
java.lang.NoClassDefFoundError: App (wrong name: src/App)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
|
by: shanmukhi |
last post by:
Hi All
I got a problem in running java Applet
i am not able to run java applet while running i got a problem as
Loading Java Applet Failed
java.lang.NoClassDefFoundError: App (wrong name: src/App)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
|
by: sheephead86 |
last post by:
Hi,
I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing in the right direction.
Ok the problem.
I am creating a program that ask the user to input a height value, the program will then do a calculation and create a golden ratio width. The type of both the height and the width are double.
This is...
|
by: pssraju |
last post by:
Hi,
I am having applet display problem on my PC and the same thing working fine on some of my colleagues PC's. When I cross checked content through view source its exactly same on both the PC's. Something related to JRE is not allowing to display this applet through browser. Even I tried by uninstalling & reinstalling JRE and ended up with same problem. Can anyone tell whats problem on my PC.
Here is the error which I am getting in java...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |