Applet inside a JAR: Cannot access other classes within the JAR

Hello,
Description
Web app + applet (packaged in a JAR)
I have followed this tutorial
JAR contents
package mypackage
SimpleApplet.class
SimpleObj.class
_"SimpleApplet" uses "SimpleObj"_
package mypackage;
public class SimpleApplet extends JApplet {
    @Override
    public void init() {
        SimpleObj obj = new SimpleObj();
HTML code
<applet archive="SimpleApplet.jar" codebase="." code="mypackage.SimpleApplet.class" width="800" height="600" />
SimpleObj cannot be found (Java Console)
java.lang.NoClassDefFoundError: mypackage/SimpleObj
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: mypackage.SimpleObj
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 8 more
Caused by: java.io.IOException: open HTTP connection failed:*http://localhost:8080/SimpleApp/mypackage/SimpleObj.class*
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 12 more
Exception: java.lang.NoClassDefFoundError: mypackage/SimpleObj
It looks like JRE does not search for the SimpleObj class inside the JAR, but tries to get it from the server...
Any ideas?
Thanks in advance,
Gerard
Edited by: gsoldevila on Dec 10, 2008 2:05 AM

misread, deleted
Edited by: atmguy on Dec 10, 2008 1:12 PM

Similar Messages

  • Accessing other classes in the same package

    I have the following two classes in the same package. Why cant I access the myString vairable from Test2 like I try and do below?
    package test;
    class Test1 {
         public static String myString = "Hello world";
    package test;
    class Test2 {
         static void printMe(){
              System.out.println(Test1.myString);
         public static void main(String args[]) {
                   printMe();
    }

    Why when I take the "package test;" line of code away I can compile it normally?This depends on how you call the compiler and how you have set the class search path. Classes that are in a package are expected to be found from some place in the search path under a directory that has the same name as the package. The default class path consists of only the current directory, ".", so you can avoid all problems by compiling and running from the directory above "test" rather than "test" itself.

  • Java file cannot access other class in same package???????

    I have written a bean as follows-------
    package CustTags;
    public class TomMovieBean
         private String movieName;
         private String movieDirector;
         public void setmovieName(String movieName)
              this.movieName = movieName;
         public String getmovieName()
              return this.movieName;
         public void setmovieDirector(String movieDirector)
              this.movieDirector = movieDirector;
         public String getmovieDirector()
              return this.movieDirector;
    Now i am writing a tag handler for my JSP custom tag as follows----------
    package CustTags;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.*;
    public class Dynamic extends TagSupport
         private List movieList;
         public void setmovieList(List movieList)
              this.movieList = movieList;
         public int doStartTag() throws JspException
              Iterator iterator = movieList.iterator();
              TomMovieBean TMBObj = null;
              try
                   JspWriter out = pageContext.getOut();
                   while(iterator.hasNext())
                        TMBobj = (TomMovieBean)iterator.next();
                        String movieName = (String)TMBObj.getmovieName();
                        String movieDirector = (String)TMBObj.getmovieDirector();
                        out.println(movieName+"...."+movieDirector+"<br>");
              }catch(Exception ex)
                   throw new JspException("Error in doStartTag()");
              return SKIP_BODY;
    Now when i compile Dynamic.java it shows foll. errors
    Dynamic.java:19: cannot resolve symbol
    symbol : class TomMovieBean
    location: class CustTags.Dynamic
    TomMovieBean TMBObj = null;
    ^
    Dynamic.java:27: cannot resolve symbol
    symbol : variable TMBobj
    location: class CustTags.Dynamic
    TMBobj = (TomMovieBean)iterator.next();
    ^
    Dynamic.java:27: cannot resolve symbol
    symbol : class TomMovieBean
    location: class CustTags.Dynamic
    TMBobj = (TomMovieBean)iterator.next();
    ^
    3 errors
    I am unable to comprehend why it can't recognize TomMovieBean despite the fact that its a public class and in the same package as that of Dynamic.java

    Is your classpath set correctly? I.e. does it point to the directory containing the CustTags directory?
    BTW, by convention, package names are written in lower case.

  • How to retrieve hashmap Values in other class within the same package.

    I have created two class ie A and B.
    In A class I have created one hashmap and stored some keys and values.
    But i want to retrieve that values in class B.
    So can any one can give any code ,so that i will try on Eclipse IDE

    Maybe anything. I'm not that interested. It's Java programming 101, about 10 minutes into the first class.

  • Hi. I am using a time capsule for few PC s. I have made 5 different account to access time capsule. but in windows when i enter account name and password for one account, i cannot access other accounts, because windows saves username

    Hi. I am using a time capsule for few PC s. I have made 5 different account to access time capsule. but in windows when I enter account name and password for one account, i cannot access other accounts, because windows saves username. how can i prevent this from happenning. I really need to access all my accounts and dont want it to save automaticlly.

    Why have 5 accounts if you need to access all of them.. just have one account?
    Sorry I cannot follow why you would even use the PC to control the Time Capsule. Apple have not kept the Windows version of the utility up to date.. so they keep making it harder and harder to run windows with apple routers.

  • HELP: signer info doesn't match info of other classes in the same package

    I have several jars which need to be signed. They contain several applications and packages which
    are split up based on which parts are needed by server vs client code. How do I get rid of this error?
    I'm signing all the jars using the keytool and jar signer in java 1.3.1. I generate a certificate file.
    My assumption is that each time I sign a different jar, the info is updated in the keystore and
    certificate file. What might I be doing wrong when signing multiple jars?
    (Yes, code from the same package may be in different jars. I don't have any controll of this,
    I'm not in charge of the build and distribution of the various packages).
    Exception in thread "main" java.lang.SecurityException: class
    "com.ibm.ucm.bootup.UCMSysMgtConstants"'s signer information does not match signer
    information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at com.ibm.ucm.bootup.UCMServerUpdater.<init>(Unknown Source)
    at com.ibm.ucm.bootup.UCMServerUpdater.<init>(Unknown Source)
    at com.ibm.ucm.bootup.UCMAdminServerUpdater.<init>(Unknown Source)
    at com.ibm.ucm.bootup.UCMAdminServerUpdater.main(Unknown Source)

    Where you able to solve this issue? (I'm seeing the same problem.)
    Thanks,
    Stacy

  • I copied a lot of photos from an iphone to a DVD using a Windows 7 laptop, now I cannot access those photos on the DVD. HELP!

    I copied a lot of photos from an iphone to a DVD using a Windows 7 laptop, now I cannot access those photos on the DVD. HELP! In Windows Exlporer I can see the data on the disk in the details but when I click on it nothing appears as if there is nothing on it.

    It should. So they aren't shown in the Last Import smart album, right? Try the following:
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - Run Option #4, Rebuild Database, followed by Option #1 if needed.
    OT

  • HT1725 I purchased a book and although it is shown in my library the word "paused" is written across it and I cannot access.  i presume the download did not complete, but can't seem to fix it.

    I purchased a book in advance.  It is now in my library, but the word "paused" appears across the book and I cannot access. I assume the download did not complete, but I cannot seem to fix it.  Does anyone know what the problem could be?

    Close all open apps by double-tapping the home button, then swiping upward on the app window (not the smaller icon) off the screen.
    Then reset: hold down the home button along with the power button until you see the Apple, then let go.

  • My iPhone is split from front panel on top, and back cover of my is swollen too. I am not able to use my phone and I cannot access my data in the phone. Please suggest what could be the cause of this problem?

    My iPhone is split from front panel on top, and back cover of my is swollen too. I am not able to use my phone and I cannot access my data in the phone. Please suggest what could be the cause of this problem?

    It sounds like the battery might have gone bad, and is swelling and causing the symptoms you describe.  Do not attempt to use the phone, but take it to Apple for evaluation.

  • After installing latest update cannot access "messenger options" under the options tab

    After installing Firefox latest update I cannot access "messenger options" under the options tab. The other tabs, themes and mail options work when clicked but nothing happens when I click "messenger options" It works fine in IE.

    When I go to the settings page to access iCloud and click on terms and conditions it gives the message

  • HT4061 I cannot access my device. The screen is blank however it has power. The phone will ring but since the screen is blank i canot answer.

    I cannot access my device. The screen is blank however it has power. The phone will ring but since the screen is blank I cannot answer. It seems to be dead but has power?

    When restoring to factory defaults/new iPod fails to resolve a problem that indicates a hardware problem an an appointent at the Genus Bar of an Apple store is in order.
    Check your warranty coverage here:
    Apple - Support - Check Your Service and Support Coverage

  • I cannot access my photos after the last Iphoto upgrade.  How frustrating!

    I cannot access my photots since the last upgrade.  Why upgrade when it only corrupts your files?  So disappointed in Apple.

    With the amount of information you've provided it's impossible to offer a potential solution.  We can't see your computer so we need to know the details of your problem and setup, i.e.:
    what version of iPhoto are you using?
    what system version are you running?
    what do you see when you launch iPhoto?
    what fixes have you tried?
    where is your library located?
    did you apply any updates or upgrades just prior to the problem occurring?
    are you running a "managed" or "referenced" library?
    what type of Mac?
    how much free space on your boot drive?
    OT

  • Java Inner classes within the Threading paradigm

    Hi all.
    Im familiar with static nested classes, method local classes, inner classes and anonymous classes.
    But what I am a little perplexed by, is when exactly to use inner classes or static nested classes? (forgetting anonymous classes and method local classes).
    I read this article (http://www.javaworld.com/javaworld/javaqa/2000-03/02-qa-innerclass.html) and the first point makes for a good argument, but why nest the class? Why not define it as an external class?
    Also you typically find nested classes within the Threading paradigm, but why?
    I typically would create a top level class (non nested) that would implement the Runnable interface, override run() and then
    use this class when constructing a new Thread.
    Any clarification would be greatly received.
    Thanks and Happy Friday.

    Boeing-737 wrote:
    I read this article (http://www.javaworld.com/javaworld/javaqa/2000-03/02-qa-innerclass.html) and the first point makes for a good argument, but why nest the class? Why not define it as an external class?
    I was going to provide some reasons, but when I read the article I found they were already there. Following the DRY principle I'm going to let the article speak for itself.
    Also you typically find nested classes within the Threading paradigm, but why?No, I don't. If that's where you typically find them then you haven't had a varied experience.
    I typically would create a top level class (non nested) that would implement the Runnable interface, override run() and then
    use this class when constructing a new Thread.So carry on doing that, if it works for you.

  • Cannot invoke method "setMessageListener" within the J2EE container.

    I use TopicSubscriber.setMessageListener method to convert messages to my own type, but oc4j jms throws following exception:
    javax.jms.JMSException: TopicSubscriber[Oc4jJMS.Consumer.ypchang-cn.12da4a6:111d4f12137:-8000.94,Topic[CreatedSponsorTopic],null,null,false]: cannot invoke method "setMessageListener" within the J2EE container.
         at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1072)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1152)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1123)
         at com.evermind.server.jms.JMSUtils.assertNotContainer(JMSUtils.java:1538)
         at com.evermind.server.jms.EvermindMessageConsumer.setMessageListener(EvermindMessageConsumer.java:217)
         at com.firepond.bcmf.bus.BusSubscriberImpl.setMessageListener(BusSubscriberImpl.java:397)
    OC4J JMS doesn't support user defined MessageListener?????!!!!!!!!!!
    Who can help me out?
    Thanks!

    Hi,
    I am facing the same problem did you got any solution for it.
    I am getting the following error message too:
    Exception in Constructor
    javax.jms.JMSException: QueueReceiver[Oc4jJMS.Consumer.ssipl-wrkst-139.-7dd2dd24:1122873d95f:-8000.269,Queue[360Transaction]]: cannot invoke method "setMessageListener" within the J2EE container.
         at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1072)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1152)
         at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1123)
         at com.evermind.server.jms.JMSUtils.assertNotContainer(JMSUtils.java:1538)
         at com.evermind.server.jms.EvermindMessageConsumer.setMessageListener(EvermindMessageConsumer.java:217)
         at com.skillnetinc.storehub.connector.pos.publisher.ejb.publishTransactionWithSalesAudit.PublishTransactionWithSalesAuditBean.<init>(PublishTransactionWithSalesAuditBean.java:94)
         at PublishTransactionWithSalesAuditBean_RemoteProxy_1dpbn83.OC4J_createBeanInstance(Unknown Source)
         at com.evermind.server.ejb.StatelessSessionBeanPool.createContextImpl(StatelessSessionBeanPool.java:37)
         at com.evermind.server.ejb.BeanPool.createContext(BeanPool.java:418)
         at com.evermind.server.ejb.BeanPool.allocateContext(BeanPool.java:244)
         at com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:25)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:86)
         at PublishTransactionWithSalesAuditBean_RemoteProxy_1dpbn83.invoke(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • Linking to other stories within the folio

    Could use a little instruction on how to create a hyperlink and/or a button that can send people to other stories within the folio.

    See the "Create links to other articles" section of this help page:
    http://help.adobe.com/en_US/digitalpubsuite/using/WS67cb9e293e2f1f60-8ad81e812b10bfd837-80 00.html#WS67cb9e293e2f1f606f59889512d69320e0d-8000

Maybe you are looking for

  • Error compiling MS HTML Help from RH7

    I have today installed Robohelp 7 and converted an existing RH X5 project. This seemed to work fine. However, on attempting to compile single source Microsoft HTML Help, I immediately get an error dialog - 'Cannot find the HTML Help browser installed

  • Windows XP on boot camp

    I have a new iMac and decided to set up boot camp. I purchased Windows XP a couple of years ago and had not even opened the box. When I put the disk in my computer to install it under boot camp, I got a message that the disk could not be read. Are th

  • Problem publishing using pub-sub adapter

    Hi, I want to see events from my EPN in the Visualizer. For that I created an adapter that connects to a channel in side the EPN. It is a httppub adapter. When I am trying to start it for publishing from the visualizer I get in the Eclipse (I run the

  • FM to get work center information from routing

    Hi all, Is there any FM to get work center information from routing? Points assured. Thanks and regards, Nilesh

  • OpenSSO Agent Installation

    Hi I ` ve been working, with OpenSSO v1 build 2, on a GlassFish server. On a Centos 5. I deployed this build of opensso several times whitout a problem. Then I try to use Agents of opensso. I realize that its not possible from the opensso GUI (I read