OSGI bundle creation using third party jar files

Hi,
I have a requirement to integrate our CQ5.5 based application with a third party. As part of this, I have to use some jar files. After lot of digging, I realised that the way to use external jar files is to create an OSGI bundle wrapping these jar files.
So, I tried to do the same, but when I see the service details in system/console, I see errors. Can someone please suggest what could have gone wrong?
I have to use 3 jar files. So, I placed them in lib folder as shown in the screenshot below.
Ibuilt the bundle using .bnd file. It generated a jar file in install folder and I am able to to see its details in system/console/bundles. When I try to view details of the OSGI bundle that is installed, I see errors as follows:

Here is my bnd file with all directives:
Export-Package: *
Import-Package: *
Private-Package: *
# Include-Resource:
Bundle-Name: External Jar OSGI
Bundle-Description: This OSGI bundle contains external jar file
Bundle-SymbolicName: com.self.learning.externaljarosgi
Bundle-Version: 1.0.0-SNAPSHOT
Bundle-Activator: com.self.learning.osgi.oauth.Activator
And here is what is shown in systems/console/bundle:
Imported Packagesjavax.crypto from org.apache.felix.framework (0)
javax.crypto.spec from org.apache.felix.framework (0)
javax.servlet from cqse-httpservice (21)
javax.servlet.http from cqse-httpservice (21)
net.oauth -- Cannot be resolved
net.oauth.client -- Cannot be resolved
net.oauth.client.httpclient3 -- Cannot be resolved
net.oauth.client.httpclient4 -- Cannot be resolved
net.oauth.server -- Cannot be resolved
net.oauth.signature -- Cannot be resolved
org.apache.commons.codec.binary from org.apache.commons.codec (46)
org.apache.commons.httpclient from com.day.commons.osgi.wrapper.commons-httpclient (77)
org.apache.commons.httpclient.methods from com.day.commons.osgi.wrapper.commons-httpclient (77)
org.apache.http -- Cannot be resolved
org.apache.http.client -- Cannot be resolved
org.apache.http.client.methods -- Cannot be resolved
org.apache.http.entity -- Cannot be resolved
org.apache.http.impl.client -- Cannot be resolved
org.apache.http.params -- Cannot be resolved
org.apache.http.util -- Cannot be resolved
org.osgi.framework from org.apache.felix.framework (0)
org.slf4j from slf4j.api (11)
Regarding Export-Package, I know the function, class and its package I need to use. Would it be fine if I just export that package instead of using '*'? In such case, if this has dependency on some function in one of the 4 jar files I need to use, how does it get resolved? Do I need to Export those packages as well?

Similar Messages

  • Plz suggest me How to use Third party jar files in ODI

    Hi all,
    I need to know how to use the third party jar files or our own customised jar file in ODI.
    regards
    palash

    Hi all,
    I am unable to implement..................
    I have one question, if I add any type 4 coneection supported jar file in my ODI_CLASSPATH can I use them in writing procedure to connect Databases
    I am trying to connect Oracle database by putting Ojdbc14.jar in the class path of ODI_CLASSPATH so that in my procedure I can use it .............but failed I dont know how to solve this problem.
    another thing Open Tools are delivered as a Java package (.zip or .jar) containing several files:
    A compiled Java .class file
    Other resources, such as icon files is it so ..............Then I can use full java apllication by preparing required bunch of classes and by set them appropriately in open tool
    need ur suggestion....
    regards
    palash

  • Question about using third party jar files in Java Web Start Environment

    Hi everybody, I got a very strange problem and still can't figer out how to solve it. Can anyone help to overcome this problem?? Thanks in advance.
    Question: I wrote a simple java swing application to connect to Oracle database. I packed whole my classes and a third party jar file(classes12.jar) to a new jar file named "IRMASSvrMgntGUI.jar" and then use command 'jarsigner' to signed IRMASSvrMgntGUI.jar. There is no problem when I execute 'java -jar IRMASSvrMgntGUI.jar' in the command line. But when I execute this application via Web Start Environment, an "java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    " error occured with the following detail log shown in Jave Web Start Console:
    =============================================================
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
         at DBConnection.getNewConnection(DBConnection.java:25)
         at IRMASSvrMgntGUI.actionPerformed(IRMASSvrMgntGUI.java:524)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    ==========================================================================
    contents of the manifest file I used to create this jar file are as follows
    ===================================
    Manifest-Version: 1.0
    Main-Class: IRMASSvrMgntGUI
    Class-Path: classes12.jar
    Created-By: 0.9a (itoh)
    ===================================
    and file structures in "IRMASSvrMgntGUI.jar" is
    ====================================
    META-INF/
    classes12.jar
    DBAuthenticateDialog.class
    DBConnection.class
    IRMASSvrMgntGUI.class
    ====================================

    If you directly include classes12.jar in IRMASSvrMgntGUI.jar, the classloader won't be able to find the classes inside classes12.jar. You should sign classes12.jar separately and include that in jnlp along with your application specific jar. When you're launching your app using "java -jar somefile.jar" then the classpath settings in manifest file are used, but that's not the case when you start using JWS since in this case the classpath is based only on the " <jar href=..." entries in jnlp.

  • Using Third-Party jar file in database; Where to put license file?

    Hi!
    I have a third-party product that has a .jar file that references some .so files. I have successfully loaded the .jar file and the .so files are being called successfully, but when the program gets to the part where it reads the third-party license file, it is failing (ORA-3113 and an hs_err_pid<12345>.log and udump file are created. I know the issue is the location of the license file because I am getting the same exact error when I run it outside of the database. (I have been able to run it successfully outside of the database.)
    The instructions for the third-party product say to put the license file in the application's runtime directory.
    What I can't figure out is this: What is the application's runtime directory when I am running the code in the database?
    I thought it would be user.dir which is set to $ORACLE_HOME, but putting the license file there didn't work. I have tried lots of other places under $ORACLE_HOME.
    Any ideas?
    Thanks,
    Laurel

    Hi Laurel:
    Whether or not you can read the license file, sure you will have problem then when trying to load your .so file.
    Java JNI call are not allowed inside OJVM for security reasons, see Kuassi's answer to a similar question:
    Access Berkeley DB from Java Stored Procedure
    Best regards, Marcelo.

  • Unable to access classes in third party jar files packaged with my ejb.jar

    I have packaged some third party jar files in my xxx_ejb.jar file.  The third party jar file contains classes that are accessed by some custom classes which are in turn accessed by my bean classes.  I get the following error when my custom classes attempt to use any of the classes in one of the third party jar files:
    java.lang.NoClassDefFoundError: com/Ostermiller/util/CSVParser
    Shouldn't I be able to access classes in jar files that are packaged with my xxx_ejb.jar file?  I see the xxx_ejb.jar file as a resource of the application classloader that contains it but I don't see the third party jar files.

    As per the Java EE specification, additional JAR files should be packaged on the EAR level. Only WAR files' WEB-INF/lib folder is scanned for JAR files to be added to the classloader.

  • How to include third party .jar files into my jar file

    Hi,
    how do i include a open source third party jar file into an executable jar?
    i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?
    currently i'm getting the following error from when executing my BlogBox.jar
    C:\MyJava\BlogBox>java -jar BlogBox.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at blogbox.BlogBox.<init>(BlogBox.java:27)
    at blogbox.BlogBox.main(BlogBox.java:103)
    Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks
    [edited msg] do i need to add the classpath at execution or something of the apache commons net library?
    Message was edited by:
    gekkokid

    When you use an executable jar the normal class path
    is ignored, but you can put a classpath inside the
    jar. The usual trick is to place the library jar
    files in a directory inside the application directory
    and direct the manifest file to it. The manifest file
    live in the jar inside the META-INF directory and
    it's called manifest.mf
    The two heavilly used entries are Main-class: and
    Class-path: lines. Class-path just has a
    comma-separated list of library paths.
    The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar
    and it works,
    thank you everyone :)

  • Problems with the ActiveX bridge for Java beans when using third-party .jar

    I encountered the following problem when using the ActiveX bridge for a java bean:
    I am using JDK 1.4.2_09 and MS Visual Basic 6.0 (SP6). I wrote a java bean called ProcessViewer (my class ProcessViewer inherits from JComponent and implements the interfaces Serializable and AdjustmentListener) which I would like to use within a VB 6.0 application. I used the ActiveX bridge (packager.exe) to generate a DLL (ProcessViewer.dll) and registered it successfully. The java bean GUI-control works fine within my VB 6.0 application unless my java bean (ProcessViewer.jar) uses any third-party .jar files.
    But when I tried to add a reference to some third-party class (com.sap.xxx.xxx....) I got some problems. I could solve the problem with packager.exe by setting the correct CLASSPATH. But at runtime my VB 6.0 application does not work. It crashes or it reports an error like this: "The control ... could not be loaded from axbridge.dll" (although I deployed my .jar file correctly to the directory C:\Programme\Java\j2re1.4.2_09\axbridge\bin and lib). Setting the CLASSPATH environment variable before calling my VB 6.0 application (exe) did not solve the problem.
    How can I teach my VB 6.0 application (containing the Java bean ActiveX control) where to find the third-party .jar file? Copying the third-party .jar file to the JRE lib-folder or to the axbridge\lib folder did not solve the problem either.
    I studied the documentation about the ActiveX bridge given at:
    http://java.sun.com/j2se/1.4.2/docs/guide/beans/axbridge/developerguide/index.html
    but I am missing informations on how the third-party .jar files can be found during runtime of the ActiveX container (e. g. a VB 6.0 application).

    See how to solve your problem with JNI:
    http://codeproject.com/cpp/OOJNIUse.asp
    More examples (for SWING) in tools setup:
    http://www.simtel.net/product.php[id]95126[SiteID]simtel.net
    http://www.simtel.net/product.php[id]94368[SiteID]simtel.net
    http://www.simtel.net/product.php[id]93174[SiteID]simtel.net

  • Using third party jars with Oracle Business Rules

    Hi
    I am working on Oracle AS 10g release 2.
    We are using Oracle Business Rules in integration with Oracle BPEL.
    While using third party jars however, Oracle Business Rules end is facing errors.
    Error during unmarshallingProvider com.sun.xml.bind.ContextFactory_1_0_1 not found
    oracle.classloader.util.AnnotatedClassNotFoundException:
    Missing class: com.sun.xml.bind.ContextFactory_1_0_1
    Dependent class: javax.xml.bind.ContextFinder
    Loader: oracle.xml:10.1.0_2
    Code-Source: /D:/oracleasr3/lib/xml.jar
    Configuration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in D:\oracleasr3\j2ee\home\oc4j.jar
    Can anybody help in figuring out where Jaxb jars(3rd party jars) are to be kept so that OAS access it?
    We tried using the applib folder to load the jars but we are getting class loading errors.
    When new instances are created, class loading is not happening.
    Pls help.
    Thanks
    Kavya

    Are you using Application Server Release 3 or Release 2? There are different versions listed in your mail.
    I think you probably want to add this as a shared library via EM and then import the shared library to your application with the application's xml config files.

  • Where should the third party JAR files be placed ?

    Hi,
    We have a requirement to perform encryption / decryption of supplier bids. In this case we require to use third party provider JAR files with OA framework code. Where should the JAR files generally be placed in such a scenario ?
    Thanks and Regards,
    Sandhya

    Checkout this post.
    How to inclue a third party .jar file in OA fwk classpath Class not found

  • How to use 3rd party jar files for xml transform

    Hi all,
    Am using OAS9.0.4 and I deployed my .ear successfully.
    In my application am using 4 jar files for xml transformation. (xerces.jar, xalan.jar, xml-apis.jar,xercesImpl.jar)
    OAS has its own xmlparserv2.jar file. Its using this jar file for transforming xml data and not even looking for above mentioned 4 jar files.
    In opmn.xml, I provided these 4 jar files in to class path. Then also it didn't effect my output.
    I also tried as put these 4 jar files into j2ee\home\applib directory, but o result.
    Can anybody tell me where should I keep these 4 jar files in OAS and OAS should use these 4 jar files instead of its own xmlparserv2.jar for transforming data.
    Thanks in Anticipation,
    Regards,
    RK

    Add the Xbootclasspath variable in the java-options field. It will somewhat look like the following in your opmn.xml file
    <process-type id="<OC4J Instance Name>" module-id="OC4J">
    <module-data>
    <category id="start-parameters">
    <data id="java-options value="........... -Xbootclasspath^/a:<location of your jar files>" />
    Ensure to use th ^/a (append) signature
    Regards,
    Chirag

  • Running a plain java class in command prompt which uses third party jars

    i have to run a simple java class. its actually a process which is running in the background. Now to run this java file i have created a batch file. my problem is that this java file uses around 100 jar files. when i try to run this java file (actually .class file) it gives me no class defination found error for this java(class) file. What can be the problem. My java home is set....how to solve this problem

    i have to run a simple java class
    my problem is that this java file uses around 100 jar filesThese two statements are contradictory.
    it gives me no class defination found error for this java(class) file. What can be the problemThe class is not on the classpath.
    how to solve this problemEnsure all classes are on the classpath.
    I bet if your searched this forum (or even read the java tutorial) you'd find something .

  • Using 3rd party jar file in WCEM3.0

    Hi,
    I want to get data from an external database into WCEM. Is it possible to use MySQL connector jar for achieving this?
    I used the MySQL connector jar but my guess is, it does not get deployed to the server. It is just visible in my local development.
    When I try to connect to the database I get an error saying "could not find a suitable JDBC driver".
    I need some guidance.
    Regards,

    Hi Steffen,
    As per your suggestion I was able to ping the database manually, but when I try to access it from my code which runs on the server I am getting the exception that I have stated below.
    But if I want to connect to the database dynamically, what then? I am using the MySQL connector jar file for this purpose but on deploying the code to the server I get the error as "Could not find a suitable driver".
    I think the jar file is not getting deployed to the server. Are there any steps that I would have to follow to deploy it?

  • Where to put third-party jar files

    ok i've made some classes that i use to filter file types for when the user needs to open a file, but i've just been putting the classes used for filtering in the project i'm working on and i was wondering where i would put a jar file that contains those classes so that i could include them in programs. for example like you include java.awt.

    Create a Jar from those classes and place it in the lib/ext folder of your JRE.

  • Where do i need to put third party jar files in localmachine?

    Hi
    I am writing jsp where i am importing the classes from third party libraries. When i am running this jsp, it is getting error as "cannot access class ...". Where do i need to put these third party libraries in my local machine in order to run the jsp locally.
    Thanks

    The easiest way is to put them in WEB-INF/lib.
    --olaf                                                                                                                                                                                                       

  • Where to put Third Party Jars in an .ear file

    Where to put Third Party Jar files in an .ear file so that they can be packaged along with the entire application and thus bypass the trouble of putting the third party .jars inside the application server lib directory and set the class path.

    Just put them in the root of your EAR. You can specify them in the classpath of your EJB JAR's manifest.

Maybe you are looking for

  • af:table doesn't populate; throws NoSuchElementException

    Hi JDev Team, I'm using JDeveloper 11.1.1.2. I have a page with a <af:table> component that no longer works after migrating from 11.1.1.0 The table is populated by a "executeWithParms" method of a data control. The executeWithParms is called by a bac

  • Muse fundamental isn't available

    When I click place on the file tab , muse fundamental isn't available.  I searched my entire computer.  Is this a separate download?

  • Cannot use keyboard shortcut to adjust volume in iTunes

    Before version 10.2, I could use the Command Up/Down combo to adjust the volume in iTunes. As of 10.2.1, I can use Command Up, but when I use Command Down, it does not control the slider, it moves my library selection from Music to Movies, Podcasts,

  • LCCS Screenshare-How to view the shared screen?

    Hi all,                     Im new to LCCS,doing lccs screen sharing application using Flash Builder 4.I have used session.streamManager.maxP2PStreamPublish = 20;    session.streamManager.streamMulticast = true to publish my screen,How can i view the

  • Recharger cradle for Droid 2

    Does the recharger cradle in the accessories pack accommodate a Droid 2 with extended battery?  If so, what are the differences between the standard droid 2 recharger cradle ($19.97) and the XT cradle 29.97 -- what does one get for the extra $10?  Th