Signing a class instead of a jar

Would be possible to sign a .class file instead of a .jar file?
Dani

I am not explaining very well.
I have a architecture who has a JSP file. This JSP loads an applet and I need the applet to be signed for a correct execution, but the applet is not a jar, it's a class. The JSP file uses a <jsp:plugin> in order to import an applet, but I wanted to avoid changing the code (it works properly) and uses an JAR as applet.
<jsp:plugin type="applet"
          code="myApplet.class"
               codebase="/idp"
               name="pinApplet"
width="300"
height="300">
          <jsp:fallback>
                    Authentication Form is not supported by the browser
               </jsp:fallback>
</jsp:plugin>
I need myApplet.class to be signed, but I am obliged to change the code to include the applet as a JAR if I want a signed applet.
Edited by: 805978 on 12-ene-2011 8:27

Similar Messages

  • Classes not found for jars listed in manifest

    I have an applet whose main jar has a number of dependent jars listed in the manifest. All the jars are signed.
    The applet works fine when downloaded from an HTTP server.
    Previous to 1.6.14 it would also run from a local directory.
    As of Java 1.6.15 and 1.6.16, the classes in the dependent jars are no longer loadable from the local directory. ClassDefNotFound is the reported on the java console. Obviously the class is present, as the application is running fine in JVMs 1.6.14 and previous.
    I see that 1.6.16 includes changes for the security baseline, but I cannot find anything that suggests changes are needed to support dependent jars. None of the dependent jars request a specific version of JRE.
    Anybody know what is going on?

    Is this the error? ...Yes, sorry, the exception is NoClassDefFoundError
    If you provide a Short, Self Contained, Correct Example someone may be able to diagnosis the problem, as opposeed to guessing. A link to the real live application can be found at: http://download.equitrac.com/38834/InstallGUI.html. (This original application does not meet the definition of short ... but demonstrates the problem well.)
    When run as an applet off this site, it works fine.
    If you click on the download button, it will place a copy on your local harddrive. To execute it locally double click on your local copy of InstallGUI.html.
    When running it locally with Java 1.6.15 and 1.6.16 it will give you a class def not found exception without doing any thing.
    When running locally with Java 1.6.14, it will not experience any trouble.
    This applet needs permissions to open sockets and store data on the harddrive.
    Probably due to the presence of class files that once existed outside of the jars, but are now not thereClose ... the application is made up of a main jar (our product) and a number of third party jars. The manifest for the main jar properly references the other jars, and works in all JVMs before 1.6.15. As of 1.6.15, none of the classes from the referenced jars can be opened.
    I found that I can work around the problem by placing all classes into a single jar ... which may infringe on licensing requirements for some of the third party jars we use.
    Dave

  • Why is U51 blocking individual class files not in jars but U45 accepted them?

    Let me answer the "why do you need individual class files?" question first. We have a rather large applet based application with a current client-side minimum jar download size of 1.8 MB. If we put ALL of our class files into jars, that size will probably double. Most users only use a small portion of the class files for their particular tasks. Which of the class files they use depends upon the tasks they perform. Having ALL users download ALL the classes, albeit compressed in jars, is extremely time consuming and a major problem after application updates due to the large number of users and the network load it would cause.
    Jar file manifest:
    Permissions: all-permissions
    Codebase: *
    Application-Name: MyApplication
    Application-Library-Allowable-Codebase: *
    Caller-Allowable-Codebase: *
    Trusted-Library: true
    We have 11 directories with one containing the applet and main client application code. The other 10 directories contain class files relating to the various sub-applications in the system. The system has a third-party runtime jar file, too.
    We have a private network and servers for our business so the exposure is small. This is a screen-scraping, reformattring application that does no real data processing so doesn't need the same security as a true data processing application. Since we are not open to the Internet and of limited security risk, we chose to keep a more simplified structure.
    This all worked under 1.7.0_45. I read the security guide and it was my understanding that these attributes in the manifest would also work for U51. Apparently not. Looking at the guides, now, it appears they have been changed sometime last year regarding mixed-code to mean jars with certificates and jars without certificates. The support for individual class files appears to have been removed. If this is true, then there should have been a beta of the U51 code because the rules seem to have been changed since the last release or there is a new bug.

    This is exactly my same problem. My app (and applet) is about 5 MB if I consider all the classes and libraries used by the app. (I mean 5MB is the size of the jar file). I can't ask customers to download 5 MB every time they want to access the program.
    We need java ask code signing for the principal applet but then we must have the possibility to run single class files as needed.
    Help us all please.
    Thanks Paolo

  • Class not found in jar

    I have a servlet that is using request.forward() to invoke a class in a jar file.
    This class is in the class path, as below. However, when that class runs, it cannot find other classes in that same jar file.
    In my resin.conf file I have:
    <web-app id='/test' app-dir='d:/apps/test'>
         <classpath id='d:/apps/otherApp/WEB-INF/lib/otherApp.jar'/>
    </web-app>
    The jar file is in the web-inf/lib folder.
    Running under Resin.
    What do I need to do such that the invoked class will find it's fellow classes that are in the same jar file?

    I don't see why
    you would need to add that jar to the conf file.My web-app cannot otherwise find the target class. It is part of a different 'web-app'.
    how did you create the jar?I didn't. This is a third party app. I cannot disturb the jar.
    Due to the third party app, there are legacy issues that I am having to work around.
    So my situation is like this.
    c:/apps/app1
    c:/apps/app2
    c:/apps/app3
    So, another servlet will contact app1. Depending on the 'POST'ed data, app1 will invoke either app2 or app3.
    All code for app2 is in jars in WEB-INF/lib.

  • Taglib: class not found in jar-file

    I've got the following problem:
    I whant to deploy a taglib to tomcat 5.0.25.
    If I point to the jsp which uses the taglib I got the following error:
    org.apache.jasper.JasperException: Unable to read TLD "META-INF/taglib.tld" from JAR file "file:/C:/Programme/Apache Software Foundation/Tomcat 5.0/webapps/taglibtest/WEB-INF/lib/gsa_prod3_db_taglib.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: ch.gsa.prodass3.taglib.TagAddAttributeTEI
    If I copy the taglib.tld out of the jar-file into WEB-INF and do the mapping in web.xml, I get this error:
    org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: ch.gsa.prodass3.taglib.TagAddAttributeTEI
    root cause
    java.lang.ClassNotFoundException: ch.gsa.prodass3.taglib.TagAddAttributeTEI
    It seems like none of the files in the jar-file could be loaded.
    Has anybody an idea?
    Help would be very appreceated!
    Greetings, Jonas

    1 - double check the class is in the jar file, in that path, and is spelt correctly
    2 - restart Tomcat
    3 - check the contents of the tld file - particularly the extra-info tag and class name for it.

  • Declaring top level classes instead of subclasses

    I seem to have misunderstood something very basic.
    It's always better, where possible, to declare the top-level class instead of the sub-class, right?
    Ok, then why do I have the following problem?
    I declare, from the JavaMail API the following:
    Message theMessage = new MimeMessage(session);instead of declaring directly the subclass like this:
    MimeMessage theMessage = new MimeMessage(session);but when I use a method which is only found in the MimeMessage class I get a compile error.
    [javac] 189.           theMessage.setSubject(subject, "iso8859_1");
    [javac] <-------------------------------->
    [javac] *** Error: No match was found for method "setSubject(java.lang.String, java.lang.String)".
    Have I really misunderstood something so basic?? Surely the compiler knows that theMessage is an instance of MimeMessage??
    Any clear explanation to explain why I get this compile error would be gratefully received. I have been faithfully declaring top-level classes instead of subclasses in my code, but if the compiler doesn't let you do so, then what's the point?

    Ok, my confusion was started by an article on the
    Collection classes which stated that:
    Map theMap = new HashMap(); was better
    programming practice.
    Yep.
    But the Map class is an Interface, right? - Whereas
    Message is a normal class with subclass MimeMessage.
    I think that's where my confusion started.Well, this isn't really a class vs. interface difference. It goes to which class (or interface) is the "highest" (closest to Object) and still has all the public interface you need.
    There are cases where you'll declare a variable to be of a base class type like Message.
    You just need to get into the habit of separating the left side of the = from the right side. On the left, you put the bare minimum that completely meets your needs. You say, "I need a List" or "I need a Map" or "I need a SortedMap" (a subinterface of Map) or "I need a Message" or "I need a MimeMesage".
    Then, on the RHS =, you decide which particular class best implements the public interface that you said you need (by declaring it on the LHS). "For my Map, I'll use a HashMap." "For my Message, I'll use a MimeMessage." "For my MimeMessage, I'll use a MimeMessage".

  • How to use URL class instead of Socket

    Hi all. I am developing a small inventory control system for a warehouse.
    I am suing a Java desktop application that connects to a servlet via Internet.
    I have been searching the net how to use JSSE for my application since i am new to secure sockets and JSSE.
    Since I havent implemented security In my current system yet, i am using URLConnection conn = url.openConnection(); to connect to a servlet.
    However, in a good tutorial that I found about JSSE, sockets are used directly for connection, insted of URLCOnnection. They use the code like this: SSLSocketFactory sf = sslContext.getSocketFactory();
    SSLSocket socket = (SSLSocket)sf.createSocket( host, port ); Since, using sockets is overly complex for me, I want to make use of the URLConnection class instead to keep it simple.
    Could anyone please tell me how to make use of the URLConnection class to establish secure http connection.
    by the way, the tutorial is here:
    http://www.panix.com/~mito/articles/articles/jsse/j-jsse-ltr.pdf
    thanks.

    Here you go. The following code snippet allows you post data to http URL. If you have to do the same to https URL , please let me know.
    OutputStream writeOut = null;
    HttpURLConnection appConnection = null;
    URL appUrlOpen = null;
    //data to be posted.
    String data = "This is the test message to post";
    byte[] bytesData = this.data.getBytes();
    appUrlOpen = new URL(""Your Servlet URL");
    appConnection = (HttpURLConnection) appUrlOpen.openConnection();
    appConnection.setDoOutput(true);
    appConnection.setDoInput(true);
    appConnection.setUseCaches(false);
    appConnection.setInstanceFollowRedirects(false);
    appConnection.setRequestMethod("post");
    appConnection.setRequestProperty("Content-Type","application/text");
    appConnection.setRequestProperty("Content-length", String.valueOf(bytesData.length));
    writeOut=appConnection.getOutputStream();
    writeOut.write(bytesData);
    writeOut.flush();
    writeOut.close();
    String inputLine;
    StringBuffer sb = new StringBuffer();
    reader = new BufferedReader(new InputStreamReader(appConnection.getInputStream()));
    char chars[] = new char[1024];
    int len = 0;
    //Write chunks of characters to the StringBuffer
    while ((len = reader.read(chars, 0, chars.length)) >= 0)
    sb.append(chars, 0, len);
    System.out.println("Response " + sb.toString());
    reader.close();
    sb=null;
    chars = null;
    responseBytes = null;
    ******************************************************************************************

  • When to use abstract classes instead of interfaces with extension methods in C#?

    "Abstract class" and "interface" are similar concepts, with interface being the more abstract of the two. One differentiating factor is that abstract classes provide method implementations for derived classes when needed. In C#, however,
    this differentiating factor has been reduced by the recent introduction of extension methods, which enable implementations to be provided for interface methods. Another differentiating factor is that a class can inherit only one abstract class (i.e., there
    is no multiple inheritance), but it can implement multiple interfaces. This makes interfaces less restrictive and more flexible. So, in C#, when should we use abstract classes
    instead of interfaces with extension methods?
    A notable example of the interface + extension method model is LINQ, where query functionality is provided for any type that implements IEnumerable via
    a multitude of extension methods.

    Hi
    Well I believe Interfaces have more uses in software design. You could decouple your component implementing against interfaces so that
    you have more flexibility on changing your code with less risk. Like Inversion of Control patterns where you can use interfaces and then when you decide you can change the concrete implementation that you want to use. Or other uses for interfaces is you could
    use Interceptors using interfaces (Unity
    Interceptor) to do different things where not all of these is feasible or at least as straightforward using abstract classes.
    Regards
    Aram

  • Conversion of a .class file into a .jar file

    Conversion of a .class file into a .jar file
    How Will I convert a .class file into a .jar file.
    Pls answer ASAP.

    You don't.
    You add a .class file into a .jar file. You don't convert anything.
    Read the help page for jar for details.

  • Can we extend the Throwable class instead of Exception Class??

    Hi all..
    Can we extend the Throwable class instead of Exception Class while creating our own custom Exception?If not Why?
    Please give your valuble advices..
    Ramesh.

    I don't want to hijack the thread here, but in a conversational tone...on a related note.. I've thought about this too a bit and wondered if there are some recommended practices about catching and handling Throwable in certain applications. Like the other day I was debugging a web application that was triggering a 500. The only way I could find the problem in an error stack was to write code to catch Throwable, log the stack, and then re-throw it. I considered it "debug" code, and once I solved the problem I took the code out because, my understanding is, we don't want to be handling runtime problems... or do we? Should I have a catch clause for Throwable in my servlet and then pass the message to ServletException?
    So along with the OP question, are there separate defined occasions when we should or should not handle Throwable? Or does it just all depend on circumstance?

  • Class missing in weblogic.jar ?

    Hi,
    On Weblogic 10.3 Integration, when I am trying to use the ant from the command prompt to build Java web services based project, I am getting the following (in verbose mode):
    Caused by: java.lang.NoClassDefFoundError: weblogic/diagnostics/debug/DebugLogger
            at weblogic.wsee.util.Verbose.checkDebugLogger(Verbose.java:74)
            at weblogic.wsee.util.Verbose.init(Verbose.java:56)
            at weblogic.wsee.util.Verbose.<clinit>(Verbose.java:46)
            at weblogic.wsee.tools.anttasks.JwscTask.<clinit>(JwscTask.java:34)
            at java.lang.Class.forName0(Native Method)Now, JwscTask class is in Weblogic.jar. Also, the package weblogic.diagnostics.debug is present in the same jar but I do not see a DebugLogger. I think this is not a classpath issue because weblogic.jar is accessible, right? Or does DebugLogger reside in any other jar?
    Any suggestions?
    Thank you!
    - Aditya

    The DebugLogger class is in the com.bea.core.logging_1.4.0.0.jar module in $BEA_HOME/modules, but it's referenced in the weblogic.jar manifest. It's odd that it can't find it, but try explicitly adding that JAR to the classpath for the task.

  • Missing classes from servicegen client jar

    If you generate the WSDL, stubs, etc from an EJB jar, not all the required classes
    are copied to the service_client.jar.
    If your EJB method takes a class (say HomeAddressDTO) and that class inherits from
    a base-class, AddressDTO, then the AddressDTO is not included in the client jar.
    Regards,
    Nick

    if you want to use the same classes on both client and server side
    pls set useservertypes=true in the client element of servicegen.
    It seems wls 7.0ga is not adding base classes for value types to
    the client.jar file. I have filed a CR on this bug. Hope this will be
    fixed for sp1.
    Anyway, it is ok to add more classes to the client.jar manually.
    You may have to do it when reflection cannot find all the required
    classes or if you want to add your client app specific classes.
    regards,
    -manoj
    "Michael Jouravlev" <[email protected]> wrote in message
    news:[email protected]..
    I have the same problem. Do you think it is a bug? AFAIK, the processlooks
    like this: value objects --> WSDL --> client-side stubs for value objects,
    that actually do not have much in common with original ones. As I
    understand, it is possible either to copy manually created value objectsto
    client JAR file (no portability to non-Java clients), or to generate these
    stubs from WSDL. There is a parameter for clientgen task which changes the
    default behaviour. In my case all the parent classes in my value object
    hierarchy are not "mirrored" in client JAR. I think that this is correct,
    because client stubs do not have any hierarchy in them, they are just flat
    structures.
    I added needed classes to client JAR manually, but I think that this is my
    personal design error that I need these classes.
    What do you think?
    Michael.
    "Nick Minutello" <[email protected]> wrote
    in message news:3d094c10$[email protected]..
    If you generate the WSDL, stubs, etc from an EJB jar, not all the
    required
    classes
    are copied to the service_client.jar.
    If your EJB method takes a class (say HomeAddressDTO) and that classinherits from
    a base-class, AddressDTO, then the AddressDTO is not included in theclient jar.
    Regards,
    Nick

  • CLASS-PATH troubles in JARs

    I'm having trouble with my Jar files. I have all the classes associated w/ the project in jar files in a lib directed. I then jar that directory w/ the main class file along with some extra directories (images etc). When I run the jar file created using the -jar switch...it states that it can't find a file that is inside the jar file itself. It will work if I have the directories and the files un-jar'ed in the same directory as the jar however I'm hoping that I dont' have to do that.
    Below is my manifest file:
    Main-Class: btCommander
    Class-Path: lib\namespace.jar lib\relaxngDatatype.jar lib\jaxb-libs.jar lib\jaxb-api.jar lib\jaxb-impl.jar lib\classbox.jar
    (i do have a carriage return after the last jar file in classpath).
    When i jar the files (using either Ant or jar.exe) it packs the files however it doesn't allow me to execute the jar alone.
    Any help will be appreciated.
    Llama

    My main class is in the root of the jar file in question. the only other item in the jar is the lib directory which houses the other jar files. After playing around with the different switches and such I ended up just getting rid of the overall jar and for distribution just went for zip format and then just the file from outside...nothing big...just a bit annoying that's all :) Maybe I'll be able to do this with future versions of the JDK (hopefully).
    Thanks you guys for the suggestions none-the-less.

  • Finding total number of class files present inside jar

    Is there any way to find the total numbef of class files present inside jar?
    Any link will be helpful.

    http://java.sun.com/j2se/1.4.2/docs/api/java/util/jar/JarFile.html#entries()
    You'll have to search through it.

  • Beginner: Can't convert a hello.class file into a jar file: HELP PLEASE!!!

    Hi, I created a hello.java file, converted into a hello.class file by using the java 2SDk compiler. The problem is that the hello.class file is in a directory I created: C:\JavaBuilder\hello.class
    I have a problem converting the hello class file into a jar file. I don't know which approach to take. I've looked at tutorials...but I keep getting more confused each time I view the tutorials on creating jar files. Please can someone help..by taking me through a step by step process. Please be explicit and do not leave or assume that I know any details because I'm a new born beginner. Thank you very much, I seriously appreciate it.

    Hi i did as you suggested, only with these exceptions:
    jar -cvf hello.jar C:\JavaBuilder\hello.class
    I did this and got the message: "adding : C:\JavaBuilder\hello.class (in=1150) (out=708) (deflated=38%)"
    The problem is that when I tried to execute the jar file...by typing: " java -jar hello.jar" I received the error message: "Failed to load Main-Class Manifest attribute from hello.jar" Is there any way to correct this problem? please help, thank you.

Maybe you are looking for

  • Get CMdetails based on Reference Number

    Hi, I am developing Credit Memo Details report, here user wants all the details including Acct Docu Number based on Reference number. The report is working fine if the Credit memo has account docu number, but now user wants this report to work if Cme

  • Release for blocked invoices (Ref: Q4-6)

    Dear Sirs, After executing the u201CRelease for blocked invoicesu201D using transaction MRBR, the u201CManual Blocku201D indicator can be released in Invoice Header u2013 Payment tab. However, the indicator was still checked in Invoice Item(s). Even

  • I can't decline or accept Invitations on iCal

    I use i cal at work to have an idea about the things my co-workers are doing, to attend meetings, go to events etc. i use my private mac at work. When there are meetings or events i get invitations for them. this part is normal. however, for some rea

  • Jsp include issue

    hi i've tested a new version of my jsp include file (a header which is referenced by about 40 pages) on one jsp page, and its wokred ok. i've changed the coding of the include page though none of the other jsp pages have picked up the new include and

  • STO Billing Problem

    Hi Sap Gurus we are doing stock transfer from one plant to another palnt with same company code and the STO from plant to plant  is chargable it means we have genarate invoce on receiving plant.   we did all setting in MM and  SD. Created p.o and don