Embedding third-party code in a jar: SecurityException

For about a year, I've been creating my jar file the following way:
- Unjar all third party jars into my class tree (JDOM, JFreeChart, etc).
- Jar everything up
I just incorporated Java Mail into my app...but now I get a SecurityException when I try to execute the jar complaining "no manifest for signature file entry....".
a) Is there a better way to include third-part jars in my jar? I don't want users to have to set a classpath.
b) What's the purpose in signing a jar?
c) Do I just need to modify my manifest somehow to include this stuff?

It seems that there is no way to directly incorporate third-party libraries into your jars, but there is an open-source software claim to correctly repackage multiple jars into one so that you can repackage your application jar and third-party jars.
http://one-jar.sourceforge.net/

Similar Messages

  • Deploying third party EJB 3.0 jar in web application

    I have a web application which calls services provided by EJB 3.0 beans packaged in third party jar. How do a configure the web application project to deploy the beans to the embedded OC4J container when I run the application? The jar file is reference by the project, and I have a META-INF/application.xml referencing those jar files as EJB modules. I've set the EJB Version property to 3.0, but the Annotated EJB 3.0 Bean Classes list remains empty, presumably because I have no beans defined in the sources of the application. When running the project, the oc4j container warns that the EJB module contains no beans. I'd like to deploy the beans in the jar file, but can't figure out how.
    Thanks,
    Steve
    JDeveloper 10.1.3.4
    Windows Vista
    Edited by: user10375549 on Oct 29, 2009 6:38 AM - Fixed typo.

    I don't think this technique will work. I added a META-INF/ejb-jar.xml file to the application, and added a <session> section for one of the EJB 3.0 beans from my third party jar. I specified values for <ejb-name>, <ejb-class>, and <session-type> hoping the rest of the configuration would be determined from the annotations in the class. When the server starts, this warning message is displayed:
    Oct 30, 2009 12:06:41 PM com.evermind.server.ejb.logging.EJBDeploymentMessages warningSessionBizInterfaceNotDefined
    WARNING: \[current-workspace-app: ... \] - The session bean does not has at least one business interface defined for client access. The bean is not accessiable and usable at runtime.
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 11042 ms.
    \[sic\]
    EJB 3.0 beans are not required to define business interfaces, as they are supposed to be generated by the container.
    Good idea, but still cannot deploy beans from the third party EJB 3.0 jar referenced by my project to the embedded OC4J container. Still investigating.
    Thanks,
    Steve
    By the way, I have been able to use your technique to deploy EJB 2.1 beans from third party jars in other projects, just not EJB 3.0 beans that do not provide ejb-jar.xml deployment descriptors, nor business interfaces.
    Edited by: user10375549 on Oct 30, 2009 9:51 AM - Added relevant comment regarding technique described for solving problem. It works for EJB 2.1 beans but not EJB 3.0 beans.

  • How to Deploy the third party EJB 3.0 jar in web application

    I have a web application which calls services provided by EJB 3.0 beans packaged in third party jar. How do a configure the ViewController project to deploy the beans to the weblogic server when I run the application rather than deploy the EJB ear as a stand application to the server?
    The jar file has already referenced by the project. In the "EJB Module" of project properties I've set the EJB Version property to 3.0, but the Annotated EJB 3.0 Bean Classes list remains empty, presumably because I have no beans defined in the sources of the application. When running the project the EJB jar did not deploy automatically. Is there something wrong? How can I achive this goal?
    Best Wishes~
    ELeven.Xu
    IDE: JDeveloper 11g (11.1.1.2.0)
    OS: Linux

    I don't think this technique will work. I added a META-INF/ejb-jar.xml file to the application, and added a <session> section for one of the EJB 3.0 beans from my third party jar. I specified values for <ejb-name>, <ejb-class>, and <session-type> hoping the rest of the configuration would be determined from the annotations in the class. When the server starts, this warning message is displayed:
    Oct 30, 2009 12:06:41 PM com.evermind.server.ejb.logging.EJBDeploymentMessages warningSessionBizInterfaceNotDefined
    WARNING: \[current-workspace-app: ... \] - The session bean does not has at least one business interface defined for client access. The bean is not accessiable and usable at runtime.
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 11042 ms.
    \[sic\]
    EJB 3.0 beans are not required to define business interfaces, as they are supposed to be generated by the container.
    Good idea, but still cannot deploy beans from the third party EJB 3.0 jar referenced by my project to the embedded OC4J container. Still investigating.
    Thanks,
    Steve
    By the way, I have been able to use your technique to deploy EJB 2.1 beans from third party jars in other projects, just not EJB 3.0 beans that do not provide ejb-jar.xml deployment descriptors, nor business interfaces.
    Edited by: user10375549 on Oct 30, 2009 9:51 AM - Added relevant comment regarding technique described for solving problem. It works for EJB 2.1 beans but not EJB 3.0 beans.

  • BC/Muse syncing issue with third-party code

    Hi there, I was hoping someone had a solution to this issue - which is this:
    I have used some third party code for a Hotel's 'QuickBook' function on every page. Periodically, this code stops working on some pages, and works on others - mainly when I republish the site via Muse.
    I asked the code's developer to look at it and they found this problem:
    <form method="post" action="http://fe.avvio.com/convert/site/Clandeboye%20Lodge/index.php" id="c5QuickBook3Fields"></form>
    The form effectively begins and ends on the same line.
    However, the </form> appears on a completely different line in the code - rather than the wrong place (as indicated above) it appears in excatly the correct place. Does BC 'render' this either in the wrong place, or doesn't recognise it being there at all?
    As a temporary fix: When I log into BC and edit the website from the back end, all I have to do is navigate to the offending page where the QuickBook rests, click 'Update' without making any changes at all and it begins working again.
    As a workaround this is obvioulsy a bit of a chore, but more importantly it's impossible to tell when, or on what page, this third party code decides not to work!
    It's worth pointing out that the third party code seems to be fine - I've had it looked over and it does in fact work continuously on competitor websites I've been checking.
    Apologies if it doesn't make sense... honestly, it has me baffled. I might even have to re-word this at a later stage!
    Thanks for any help though.

    If you have the entire iTunes folder from the old system and have restored this into <User's Music> on the new one then iTunes should treat this as the "home" library for the device. It should sync without removing any content. If not, see Recover your iTunes library from your iPod or iOS device.
    I suspect the options are greyed out because there are currently no Tones in the iTunes library to sync.
    tt2

  • Login window - Third party code/Tool/Gui????

    Hai Friends,
    Is there any third party code/tool/gui/ available for login frame.
    I want to store/keep all login/logout details -in a file.
    i need to store user names and passwords -encrypted in a file.
    The login frame(or a single frame with) Login,Cancel,Create new user,change password.
    Please guide me.
    Thank You

    Thanks for ur reply. I want to store the user name and passwords in encrypted form.
    i am using type4 jdbc3.0 driver to access Ms Sql Server.
    and i don't want to use any connection with the database until the user login. Also i don't want to keep the login/logout information in database-it could be much better if i use a file.
    please guide me!
    Expecting help from experts,
    MartinHilpert , Michal Dunn, Camickr, and others.

  • Cannot find embedded third-party .class in my own signed .cab

    Hello,
    This is complicated.
    I'm building an applet that operates a piece of hardware on a PC (think Win32-only.) A third-party provider (henceforth referred to as TPP) provides software drivers that will be installed on client machines.
    ORIGINALLY the TPP provided a <client>.dll and a C/C++ SDK. To make the project work, I followed the article http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html.
    I built <homegrown>.DLL using JNI, made a signed <homegrown>.cab, and the applet works just great on IE. However, I have to ditch the entire thing (see below.)
    Now the TPP is providing a Java SDK in a <client>.JAR. The SDK interfaces with a <client_jni>.dll.
    I can expect that the client machine will have <client>.dll and <client_jni>.dll installed in the \winnt\system32 (or whichever %SYSTEMROOT% directory.)
    So, I ditched the <homegrown>.dll, and built a new .cab. Now, to build the .cab, I took the contents of <client>.jar and dumped them into the same directory structure as the one I use to build <homegrown>.cab. Note that <client>.jar is not signed.
    So in other words, if you look at the exception below, I, in fact, do have a directory structure that contains: "com/IridianTech/PIDresult.class" and "com/panasonic/authenticam/LoginApplet.class"
    When I run the applet, it asks me if I want to run the signed applet. I click Yes. The Java Console responds with the following:
    Error loading class: com.IridianTech.PIDresult
    java.lang.NoClassDefFoundError
    java.lang.ClassNotFoundException: com.IridianTech.PIDresult
         at com/ms/vm/loader/URLClassLoader.loadClass (URLClassLoader.java)
         at java/lang/ClassLoader.loadClassInternal (ClassLoader.java)
         at com/panasonic/authenticam/PIDInterface.<init> (PIDInterface.java:12)
         at com/panasonic/authenticam/LoginApplet.init (LoginApplet.java:52)
         at com/ms/applet/AppletPanel.securedCall0 (AppletPanel.java)
         at com/ms/applet/AppletPanel.securedCall (AppletPanel.java)
         at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
         at com/ms/applet/AppletPanel.processSentEvent (AppletPanel.java)
         at com/ms/applet/AppletPanel.run (AppletPanel.java)
         at java/lang/Thread.run (Thread.java)
    I have looked at the contents of <homegrown>.cab with WinZip, and I can see PIDresult.class in the right place.
    HOW I AM TESTING: I have IBM Websphere running directly on my PC.
    TWO QUESTIONS:
    1. Do I need to sign the applet anymore, just to use a pre-installed client_jni.dll? (Probably)
    2. WHAT DO I DO??

    This is some code i'm using:
    <applet code="upload.class" archive="upload.jar" codebase="." width="500" height="200">
    <!--<param name="codebase" value="."> -->
    <param name="cabbase" value="upload.cab">
    <param name="button_text" value="Upload via HTTP">
    <param name="file_varname" value="filename_value"><!-- where is this for? -->
    <param name="upload_url" value="http://10.2.1.133/upload/recieve.php">
    </applet>

  • Positioning of third party code/ buttons

    does anyone know a html tag that would position a link e.g. counterstat.com always by the end of a page disregarding different height of the pages?
    hope i can make it clear what i am talking about. basically the height of my pages varies with the different content. i want to add third party html code (e.g. a button or similar) to my page. i want to have it at the end of each page (e.g aligned: centered)
    yet the only way i could move buttons on my page in the code was to configure text boxes with a specific x/y position and then add the link before the div/ of the text box. this is certainly not a comfortable way to do it. any suggestions to make life easier??? remark the button must go still in the page-background area not in the browser background area.
    harpo

    Since adding a stat counter is a post publish edit, put the code between the following tags at the bottom of your page and it will be at the very bottom of the page and centered:
    < / div >
    <center><@br /@>
    CODE GOES HERE
    </center><@br /@>
    </body >
    (remove the @ when entering the code)
    Like it is here.
    Do you Twango?
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD, QT 7.1.3,   Mac OS X (10.4.9)   22 LCD, 250G/200G/160G FW HDs, Canon: SD700IS/i850/LIDE 50, Epson R200, 30G iPod

  • How to generate csr for third party code signing cert?

    I've been reading about code signing, but can't see how to generate a csr to use with a third party CA. Does someone have a tutorial, link, suggestion?

    Hi,
    Here is an document which discussed on how to implement code signing with using third party certificate for you reference:
    http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/best_practices.doc
    For further suggestions, it is recommend you to get further support in the MSDN Forum so that you can get the most qualified pool of respondents.
    http://social.msdn.microsoft.com/forums/en-US/categories/
    Thanks
    Tiger Li 
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Third party libraries for hibernate(jar files)

    Hi I am new in hibernate.I follow some steps of hibernate tutorial from
    http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html
    In chapter-1 1.2.3. Hibernate configuration when i try
    java -classpath ../lib/hsqldb.jar org.hsqldb.Server
    database should be started but it,s not
    most probably reason is also include third party libraries
    I try all but still not getting success.
    In command prompt I get ::
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\shobhitsingh>cd\
    C:\>cd hibernatet*
    C:\hibernateTutorial>java -classpath ../lib/hsqldb.jar org.hsqldb.Server
    Exception in thread "main" java.lang.NoClassDefFoundError: org/hsqldb/Server
    C:\hibernateTutorial>pl guide
    Regards
    -S.Singh

    I'm sorry.I used classpath in wrong manner.I got where I'm wrong.
    Regards
    -S.Singh

  • Embedding third party windows

    I am attempting to set up a Labview wrapper around a third-party vision system. The labview wrapper is intended to control systems external to the vision system. The vision system is accessible through calls to a DLL. A particular call to this DLL will produce a borderless window that displays video from the vision system.
    While I could call image data frame by frame from the dll, I would rather embed this 3rd party display in my application as a child window. Unfortunately, I am not familiar with the Microsoft windowing systems or how labview handles it. 

    A long time ago I used the windows dll to do something like this (I think user32.dll), the process was to get a handle to the window and then make it a child of the labview window, it did work.  Dont know if this is still able to be done (I did this on windows XP)  somewhere there are some examples of wrapper functions on the windows dll.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Accessing third party code from JNI. URGENT !!!!

    Hi,
    I have to use a .so library (Solaris) from another company. As this library has not the correct syntax to be accessed from JNI, I made another .so that calls it.
    For compile this library I just need the header file and I can compile it succesfully, but when I run it, throws an error:
    relocation error: file /usuarios/davidj/java/jnitest/libtmlog.so: symbol lgprnERRPar: referenced symbol not found
    where lgprnERRPar is a function in the 3 party library.
    Can anybdy helps me, please???
    This is very urgent for me.
    Thanks in advance

    Hi,
    I've found
    http://forums.java.sun.com/thread.jsp?forum=52&thread=94378
    http://forums.java.sun.com/thread.jsp?forum=52&thread=95551
    http://forums.java.sun.com/thread.jsp?forum=52&thread=95531
    http://forums.java.sun.com/thread.jsp?forum=52&thread=95577
    http://forums.java.sun.com/thread.jsp?forum=52&thread=95549
    http://forums.java.sun.com/thread.jsp?forum=52&thread=95567
    http://forums.java.sun.com/thread.jsp?forum=52&thread=91606
    http://forums.java.sun.com/thread.jsp?forum=52&thread=93411
    http://forums.java.sun.com/thread.jsp?forum=52&thread=95728
    Hope it helps,
    Klaus

  • Embedding third party web pages within a site

    Duplicate post - sorry - can a mod delete?

    Frames are not usually the optimal choice. However, this
    application
    requires that you would use them. Iframes are no better than
    frames, they
    just work a bit differently.
    > That's the thing with this web design lark - sometimes
    it seems no matter
    > what
    > you look to do, someone somewhere is saying :
    > 'I wouldn't do it like that....'
    Isn't that true with everything?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Iain71" <[email protected]> wrote in
    message
    news:f4cik4$2fl$[email protected]..
    > This isn't going as well as it might have :D (ever since
    i managed to post
    > it
    > so many times)
    >
    > Someone else said that d'uh - that's what frames /
    iframes are for - so I
    > guess I can just remind myself how to use them -
    although I had gotten the
    > impression that frames were considered bad practice
    these days, so thought
    > maybe there was a better way using <div>s.
    >
    > I'm also guessing that iframes are somehow better than
    regular frames,
    > although I saw that they only work in IE - which isn't
    that helpful.
    >
    > That's the thing with this web design lark - sometimes
    it seems no matter
    > what
    > you look to do, someone somewhere is saying :
    > 'I wouldn't do it like that....'
    >
    > :D
    >

  • Debug third party source code

    Hello Friends,
    I have jar files from a third party and the corresponding source code. I wanted to know how I could add the jar files to my weblogic runtime and then debug it by pointing to the source code. I don't want to directly add the source code to the project because that will mean compiling all of them when doing a clean build. I am unable to find a way to do this in workshop?

    I'm guessing you're referring to the Workshop for WebLogic 8.1, and not the 9.x series. If not, there'd be a different answer.
    You may have to debug your third-party code with a different debugger, like Eclipse or NetBeans. In the IDE project, just add the source code for your third-party code, and connect remotely to the server (make sure you have the correct "-Xdebug ..." parameters on the server). You may not be able to debug the app in both IDEs at the same time.

  • Problem creating a EJB from third party into NWDS

    Hi everybody:
    I´m trying to create a EJB from a third party software (jar file). I imported the jar file into my EJB Module (Properties->Java Build Path->Library), selected the EJB candidate and wrote the ejb-jar.xml according to the vendor's instructions in order to define home and remote interfaces.
    When I deploy my application (containing the EJB Module), I got this error from the server:
    java.rmi.RemoteException: Cannot deploy application sap.com/TestEjbApp.. Reason: Incorrect application sap.com/TestEjbApp:Bean AccountLocateBean: the ejb-class must implement, directly or indirectly, the javax.ejb.SessionBean interface. EJB specification 7.10.2.; nested exception is: com.sap.engine.services.deploy.container.DeploymentException: <--Localization failed: ResourceBundle='com.sap.engine.services.deploy.DeployResourceBundle', ID='com.sap.engine.services.ejb.exceptions.deployment.EJBDeploymentException: Incorrect application sap.com/OlivierTestEjbApp:Bean AccountLocateBean: the ejb-class must implement, directly or indirectly, the javax.ejb.SessionBean interface. EJB specification 7.10.2.
    at com.sap.engine.services.ejb.deploy.verifier.Verifier.check(Verifier.java:66)
    at com.sap.engine.services.ejb.deploy.DeployAdmin.generate(DeployAdmin.java:253)
    at com.sap.engine.services.ejb.EJBAdmin.deploy(EJBAdmin.java:2133)
    I used the same jar in another application server (Sun Open), mounted teh EJB and it ran perfect. Additionally I checked the class and it has the correct "implements javax.ejb.SessionBean" statement in the code.
    Do you have any idea about it?
    Thanks
    Regards
    Olivier
    Message was edited by: Olivier Franco

    Hi Amol:
    Thanks for your answer, Let me explain a little more what I'm doing:
    The third party software is a jar file that contains three classes:
    com.account.AccountLocateSessionBean (Remote Interface)
    com.account.AccountLocateSessionBeanHome (Home Interface)
    com.account.AccountLocateBean (EJB class)
    This 3 classes are EJB 2.0 complaint and were tested in other J2EE container (Sun Open). I want to deploy this EJB into SAP Was J2EE 6.40 server (SP14). In my last post I wrote what I did in order to create de ejb-jar.xml into NWDS. This file looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
                             "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
        <description>EJB JAR description</description>
        <display-name>EJB JAR</display-name>
        <enterprise-beans>
            <session>
                <ejb-name>AccountLocateBean</ejb-name>
                <home>com.account.AccountLocateSessionBeanHome</home>
                <remote>com.account.AccountLocateSessionBean</remote>
                <ejb-class>com.account.AccountLocateBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
            </session>
        </enterprise-beans>
    </ejb-jar>
    Then, when I build the ear file (This is a Enterprise application that contains my EJB Module) and try to deploy this ear file into SAP Was J2EE 6.40 server (SP14) I got the exception wrote in my last post.
    Thanks for your help
    Regards
    Olivier

  • How do i access a third party .class file

    Hi,
    I am new to both java and enterprise 8, and would greatly appreciate some help.
    I have a third party .class file and want to include it in a project so i can call it's methods etc. I can access it by creating an object as follows
    thirdPartyClass tpc= new thirdPartyClass();and then create a .class file of my own using javac at the command line without any probles, but if I use the same code in enterprise 8 it reports an error stating "cannot access MyProjectName.thirdPartyClass" could someone please tell me how to reference this file as so far I have not been able to find anything.
    Thanks for any help.

    Thanks for the suggestions it appears I was doing more or less the right things but miss reading the error message:
    Cannot access keyword.classes.thirdPartyClass
    bad class file C:\java\keyword\classes\thirdPartyClass
    class file contains wrong class: thirdPartyClass
    please remove or make sure it appears in the correct subdirectroy of the classpath.
    While looking I have found that the classes do not contian src folders of Javadoc so I will go see if the third party can supply a Jar file or similar.
    Thanks

Maybe you are looking for