OSGi bundle resolution and OBR in apache felix/sling

What is the proper way to resolve bundle dependencies in sling/felix?
http://stackoverflow.com/questions/10901539/osgi-bundle-resolution-and-obr-in-apache-felix -sling

CQDarren,
The problem may be because you are using joda-time instead of joda-convert.
Try using this dependency
<dependency>
     <groupId>org.joda</groupId>
     <artifactId>joda-convert</artifactId>
     <version>1.1</version>
</dependency>
Thanks,
Aditya

Similar Messages

  • WebLogic 12c and OSGi bundles ClassCastException error

    When I deploy an OSGi bundle to WebLogic 12c there are no errors. However, when I try and access my application I get the following error:
    java.lang.ClassCastException: com.sun.faces.taglib.jsf_core.ViewTag cannot be cast to javax.servlet.jsp.tagext.Tag
    I suspect that WebLogic 12c is loading different versions of the JSF than what I have in my OSGi bundle but I am unable to confirm (I tried to deploy the wls-cat tool but I continue to get 503 errors even after a server restart).
    My bundle currently uses JSF 1.1. After reading various forum posts, I have done the following but have not had any success:
    1. Followed the steps in Re: jsf 1.2 on weblogic 12c (i.e. deploying the jsf-1.2.war, modified my weblogic.xml accordingly in my war and then deployed, etc)
    2. Checked all of my manifest entries (which were correct) and even tried to set the required-bundles to my own JSF in the WEB-INF/lib directories
    Are there any instructions/settings for having OSGi bundles work within WebLogic 12c? Note that my OSGi bundle works correctly in WebLogic 11.
    Side question..I read that even though WebLogic 12c ships JSF 1.2 for backwards compatibility, it is deprecated for this release (as per http://docs.oracle.com/cd/E24329_01/web.1211/e21049/configurejsfandjtsl.htm#i163099). Does that mean that even if I get my bundle deployed/working that if there are other errors/issues in the future then I would not be supported? I am just trying to confirm so that I can make a decision about upgrading my JSF.
    Thanks :)

    gday -
    WLS 12c (12.1.1) doesn't recognize OSGi bundles -- if you have a library you wish to use with your web application, then it needs to conform the packaging requirements for the Java EE deployment model you are using.
    If you are getting conflicts with a WLS supplied library (JSF in this case it appears) then you need to specify a filtering classloader definition in a weblogic deployment descriptor so that the web/app classloader is instructed to ignore a specified set of packages/resources from the parent loaders and load them locally.
    By way of an example, assume you have a web application in which you are bundling JSF 1.2 and you want to use this in place of the JSF 2.1 API/impl that is provided by WLS 12.1.1. In that case, you'd create a WEB-INF/weblogic.xml file and provide the following settings within in.
    <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
            <container-descriptor>
                        <prefer-application-packages>
                            <package-name>javax.faces.*</package-name>
                            <package-name>com.sun.faces.*</package-name>
                            <package-name>com.bea.faces.*</package-name>
                        </prefer-application-packages>
                        <prefer-application-resources>
                            <resource-name>javax.faces.*</resource-name>
                            <resource-name>com.sun.faces.*</resource-name>
                            <resource-name>com.bea.faces.*</resource-name>
                            <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
                        </prefer-application-resources>
            </container-descriptor>
    </weblogic-web-app>Deploying that with your application, in which you have supplied the JSF 1.2 API and implementation jars in the standard WEB-INF/lib directory will direct WLS to use those locally supplied libraries instead of its JSF API/implementation.
    Hope that helps.
    -steve-

  • Are JUnit jar and spring OSGi bundle in OEPE compatible with each other?

    The OEPE 11g comes with org.junit4_4.3.1 and Spring OSGi Bundle (org.springframework.bundle.spring_2.5.6.v200808081800.jar). However, these two seem to be incompatible. For example, @RunWith(SpringJUnit4ClassRunner.class) in a test case gives error because org.junit.internal.runners.JUnit4ClassRunner is not in the junit.jar.

    Hello,
    There could be a compatibility issue.
    I mentioned in the other thread that downloading a more recent JUnit JAR and using it in your project might help us diagnose the issue further.
    Let us know the results of that test.
    Regards,
    Andrew

  • What is the best practise to provide a text file for a Java class in a OSGi bundle in CQ?

    This is probably a very basic question so please bear with me.
    What is the best way to provide a .txt file to be read by a Java class in a OSGi bundle in CQ 5.5?
    I have been able to read a file called "test.txt" that I put in a structure like this /src/resources/<any-sub-folder>/test.txt  from my java class  at /src/main/java/com/test/mytest/Test.java using the bundle's getResource and getEntry calls but I was not able to use the context.getDataFile. How is this getDataFile method call to be used?
    And what if I want to read the file located in another bundle, is it possible? or can I add the file to some repository and then access it - but I am not clear how to do this.
    And I would also like to know what is the best practise if I need to provide a large  data set in a flat file to be read by a Java class in CQ5.
    Please provide detailed steps or point me to a how to guide or other helpful resources as I am a novice.
    Thank you in advance for your time and help.
    VS

    As you can read in the OSGi Core specification (section 4.5.2), the getDataFile() method is to read/write a file in the bundle's private persistent area. It cannot be used to read files contained in the bundle. The issue Sham mentions refers to a version of Felix which is not used in CQ.
    The methods you mentioned (getResource and getEntry) are appropriate for reading files contained in a bundle.
    Reading a file from the repository is done using the JCR API. You can see a blueprint for how to do this by looking at the readFile method in http://svn.apache.org/repos/asf/jackrabbit/tags/2.4.0/jackrabbit-jcr-commons/src/main/java /org/apache/jackrabbit/commons/JcrUtils.java. Unfortunately, this method is not currently usable as it was declared incorrectly (should be a static method, but is an instance method).
    Regards,
    Justin

  • JWS not working after Java updates to JDK 1.6 update 24 (with apache felix)

    Hi,
    I'm currently working on some JWS application, which heavily relies on Apache Felix. It was working spotless until recent security update which comes along with Java 1.6u24. Now my application dies just when Apache Felix is starting to work.
    The exception being thrown is:
    SEVERE: Permission denied: http://felix.extensions:9/META-INF/services/javax.xml.parsers.SAXParserFactory
    java.lang.SecurityException: Permission denied: http://felix.extensions:9/META-INF/services/javax.xml.parsers.SAXParserFactory
         at com.sun.deploy.security.DeployURLClassPath$UrlLoader.findResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.findResource(Unknown Source)
         at java.net.URLClassLoader$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.findResource(Unknown Source)
         at java.lang.ClassLoader.getResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.access$001(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.getResource(Unknown Source)
         at java.lang.ClassLoader.getResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.access$001(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.getResource(Unknown Source)
         at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
         at javax.xml.parsers.SecuritySupport$4.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.xml.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
         at javax.xml.parsers.FactoryFinder.findJarServiceProvider(Unknown Source)
         at javax.xml.parsers.FactoryFinder.find(Unknown Source)
         at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)     
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    In javaws.policy, java.policy I have set up proper security rules to enable JWS to work out of sandbox by specifying:
    grant {
    permission java.security.AllPermission;
    grant codeBase "http://felix.extensions:9/" {
    permission java.security.AllPermission;
    Also, I'm using maven's webstart-maven-plugin to create a JWS jnlp file. It's being property signed with security certificate. My resulting jnlp file has this part of configuration embedded:
    <security>
    <all-permissions />
    </security>
    Do You have any ideas what might be the problem?
    Cheers

    I just submitted a bug, and got the following e-mail.
    Hope the java guys take a look ...
    Full View
    Your Report (Review ID: 1990127) - SecurityException from all-permissions app - should be ClassNotFoundException
    From:     
    "[email protected]" <[email protected]>
    Add to Contacts
    To:     [email protected]     
    Dear Java Developer,
    Thank you for your interest in improving the quality of Java Technology.
    Your report has been assigned an internal review ID of 1990127, which is NOT visible on the Sun Developer Network (SDN).
    Please be aware that the large volume of reports we receive sometimes prevents us from responding individually to each message.
    If the information is determined to be a new Bug or RFE, or a duplicate of a known Bug or RFE, you will receive a followup email containing a seven digit bug number. You may search for, view, or vote for this bug in the Bug Database at http://bugs.sun.com/.
    If you just reported an issue that could have a major impact on your project and require a timely response, please consider purchasing one of the support offerings described at http://developers.sun.com/services/.
    The Sun Developer Network (http://developers.sun.com) is a free service that Sun offers. To join, visit http://developers.sun.com/global/join_sdn.html.
    Thank you for using our bug submit page.
    Regards,
    Java Developer Bug Report Review Team
    Date Created: Wed Mar 02 15:43:52 MST 2011
    Type: bug
    Customer Name: Reuben Pasquini
    Customer Email: [email protected]
    SDN ID: catdogboy
    status: Waiting
    Category: javawebstart
    Subcategory: other
    Company: http://frickjack.com
    release: 6u24
    hardware: x86
    OSversion: windows_7
    priority: 4
    Synopsis: SecurityException from all-permissions app - should be ClassNotFoundException
    Description:
    FULL PRODUCT VERSION :
    java version "1.6.0_24"
    Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
    Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)
    ADDITIONAL OS VERSION INFORMATION :
    Microsoft Windows [Version 6.1.7600]
    EXTRA RELEVANT SYSTEM CONFIGURATION :
    This is a java bug - I have users on WIndows 7 and XP, and also reported on Apache felix mailing list
    A DESCRIPTION OF THE PROBLEM :
    The following class, when bundled, signed, and deployed with the .jnlp file below, throws a
    SecurityException
    in the new java release - even though the .jnlp specifes "all-permissions".
    Past releases would throw a ClassNotFoundException - which is great,
    and is what things like Oracle's thin-client ojdbc6.jar expect.
    The program bootstraps the Felix OSGi engine - which apparently sets up a URLClassLoader with a custom felix:// URL.
    The output of running the program with webstart follows
    below the .jnlp file.
    Note that this .jnlp file is setup to run off the file system, but the same result follows from web-launched apps, whatever.
    package littleware.demo;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.sql.Connection;
    import java.util.HashMap;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.SwingUtilities;
    import javax.swing.WindowConstants;
    import org.apache.felix.framework.Felix;
    public class JavaToy {
    private static final Logger log = Logger.getLogger( JavaToy.class.getName() );
    public static class AppRunner implements Runnable {
    public void run() {
    final StringWriter swriter = new StringWriter();
    final PrintWriter pwriter = new PrintWriter( swriter );
    pwriter.append( "Class path: " ).append(
    System.getProperty( "java.class.path" )
    ).append( "\n\n-------------------------\n" );
    final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if ( classLoader instanceof URLClassLoader ) {
    pwriter.append( "URLClassLoader:\n" );
    for ( URL url : ((URLClassLoader) classLoader).getURLs() ) {
    pwriter.append( url.toString() ).append( "\n" );
    pwriter.append( "\n--------------------------------\n" );
    try {
    Class.forName( "bogus.DoesNotExist" );
    pwriter.append( "No exception thrown on bogus class load\n" );
    } catch ( Exception ex ) {
    pwriter.append( "Caught exception loading bogus class: " ).append( ex.toString() ).append( "\n" );
    ex.printStackTrace(pwriter);
    pwriter.flush();
    final JFrame jframe = new JFrame( "Webstart test" );
    final JTextArea jtext = new JTextArea( swriter.toString(), 20, 40 );
    jframe.add( new JScrollPane( jtext ) );
    jframe.pack();
    jframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    jframe.setVisible(true);
    public static void main( String[] args ) {
    try {
    log.log( Level.INFO, "Launching felix!" );
    (new Felix(new HashMap<String, Object>())).start();
    Thread.sleep( 2000 );
    } catch (Exception ex) {
    log.log(Level.SEVERE, "Caught exception", ex);
    System.exit(0);
    SwingUtilities.invokeLater( new AppRunner() );
    REGRESSION. Last worked in version 6
    STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
    *. Download felix.jar from
    http://felix.apache.org
    *. Build the following code, sign Toy.jar and felix.jar with your key,
    launch with the following .jnlp or something similar ....
    package littleware.demo;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.sql.Connection;
    import java.util.HashMap;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.SwingUtilities;
    import javax.swing.WindowConstants;
    import org.apache.felix.framework.Felix;
    public class JavaToy {
    private static final Logger log = Logger.getLogger( JavaToy.class.getName() );
    public static class AppRunner implements Runnable {
    public void run() {
    final StringWriter swriter = new StringWriter();
    final PrintWriter pwriter = new PrintWriter( swriter );
    pwriter.append( "Class path: " ).append(
    System.getProperty( "java.class.path" )
    ).append( "\n\n-------------------------\n" );
    final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if ( classLoader instanceof URLClassLoader ) {
    pwriter.append( "URLClassLoader:\n" );
    for ( URL url : ((URLClassLoader) classLoader).getURLs() ) {
    pwriter.append( url.toString() ).append( "\n" );
    pwriter.append( "\n--------------------------------\n" );
    try {
    Class.forName( "bogus.DoesNotExist" );
    pwriter.append( "No exception thrown on bogus class load\n" );
    } catch ( Exception ex ) {
    pwriter.append( "Caught exception loading bogus class: " ).append( ex.toString() ).append( "\n" );
    ex.printStackTrace(pwriter);
    pwriter.flush();
    final JFrame jframe = new JFrame( "Webstart test" );
    final JTextArea jtext = new JTextArea( swriter.toString(), 20, 40 );
    jframe.add( new JScrollPane( jtext ) );
    jframe.pack();
    jframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    jframe.setVisible(true);
    public static void main( String[] args ) {
    try {
    log.log( Level.INFO, "Launching felix!" );
    (new Felix(new HashMap<String, Object>())).start();
    Thread.sleep( 2000 );
    } catch (Exception ex) {
    log.log(Level.SEVERE, "Caught exception", ex);
    System.exit(0);
    SwingUtilities.invokeLater( new AppRunner() );
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <jnlp codebase="file:/C:/Users/pasquini/Documents/Code/JavaToy/dist/" href="launch.jnlp" spec="1.0+">
    <information>
    <title>JavaToy</title>
    <vendor>pasquini</vendor>
    <homepage href=""/>
    <description>JavaToy</description>
    <description kind="short">JavaToy</description>
    </information>
    <update check="always"/>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="JavaToy.jar" main="true"/>
    <jar href="lib/felix-2.0.4.jar"/>
    </resources>
    <application-desc main-class="littleware.demo.JavaToy">
    </application-desc>
    </jnlp>
    EXPECTED VERSUS ACTUAL BEHAVIOR :
    EXPECTED -
    Class path: C:\Program Files\Java\jre6\lib\deploy.jar
    URLClassLoader:
    file:/C:/Users/pasquini/Documents/Code/JavaToy/dist/JavaToy.jar
    file:/C:/Users/pasquini/Documents/Code/JavaToy/dist/lib/felix-2.0.4.jar
    http://felix.extensions:9/
    Caught exception loading bogus class: java.lang.ClassNotFoundException: bogus.DoesNotExist
    java.lang.ClassNotFoundException: bogus.DoesNotExist
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at littleware.demo.JavaToy$AppRunner.run(JavaToy.java:39)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(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)
    ACTUAL -
    Class path: C:\\Program Files (x86)\\Java\\jre6\\lib\\deploy.jar
    URLClassLoader:
    file:/C:/Users/pasquini/Documents/Code/JavaToy/dist/JavaToy.jar
    file:/C:/Users/pasquini/Documents/Code/JavaToy/dist/lib/felix-2.0.4.jar
    http://felix.extensions:9/
    Caught exception loading bogus class: java.lang.SecurityException: Permission denied: http://felix.extensions:9/bogus/DoesNotExist.class
    java.lang.SecurityException: Permission denied: http://felix.extensions:9/bogus/DoesNotExist.class
    at com.sun.deploy.security.DeployURLClassPath$UrlLoader.getResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(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 com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at littleware.demo.JavaToy$AppRunner.run(JavaToy.java:39)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(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)
    REPRODUCIBILITY :
    This bug can be reproduced always.
    ---------- BEGIN SOURCE ----------
    package littleware.demo;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.sql.Connection;
    import java.util.HashMap;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.SwingUtilities;
    import javax.swing.WindowConstants;
    import org.apache.felix.framework.Felix;
    public class JavaToy {
    private static final Logger log = Logger.getLogger( JavaToy.class.getName() );
    public static class AppRunner implements Runnable {
    public void run() {
    final StringWriter swriter = new StringWriter();
    final PrintWriter pwriter = new PrintWriter( swriter );
    pwriter.append( "Class path: " ).append(
    System.getProperty( "java.class.path" )
    ).append( "\n\n-------------------------\n" );
    final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if ( classLoader instanceof URLClassLoader ) {
    pwriter.append( "URLClassLoader:\n" );
    for ( URL url : ((URLClassLoader) classLoader).getURLs() ) {
    pwriter.append( url.toString() ).append( "\n" );
    pwriter.append( "\n--------------------------------\n" );
    try {
    Class.forName( "bogus.DoesNotExist" );
    pwriter.append( "No exception thrown on bogus class load\n" );
    } catch ( Exception ex ) {
    pwriter.append( "Caught exception loading bogus class: " ).append( ex.toString() ).append( "\n" );
    ex.printStackTrace(pwriter);
    pwriter.flush();
    final JFrame jframe = new JFrame( "Webstart test" );
    final JTextArea jtext = new JTextArea( swriter.toString(), 20, 40 );
    jframe.add( new JScrollPane( jtext ) );
    jframe.pack();
    jframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    jframe.setVisible(true);
    public static void main( String[] args ) {
    try {
    log.log( Level.INFO, "Launching felix!" );
    (new Felix(new HashMap<String, Object>())).start();
    Thread.sleep( 2000 );
    } catch (Exception ex) {
    log.log(Level.SEVERE, "Caught exception", ex);
    System.exit(0);
    SwingUtilities.invokeLater( new AppRunner() );
    ---------- END SOURCE ----------
    CUSTOMER SUBMITTED WORKAROUND :
    I can work around the problem by installing the app locally, so web-start is not necessary. I ran into this problem with an app that connects to Oracle via ojdbc6.jar - ojdbc6.jar invokes "Class.forName" to check for optional i18n classes on the class path. The Oracle code correctly handles the correct ClassNotFoundException, but the new SecurityException is breaking my app.
    workaround:

  • Osgi workflowprocess gives classnotfound exception when osgi bundle is activated

    I did create an osgi service that extends workflowprocess interrface using eclipse. I install the bundle that contains this service and then deploy and activate the bundle in day cq. However, on activation I receive an error stating that my class is not found. Please note that both this service and the referenced service(twitterservice that I created) gets registered and the bundle is activated, however, its unable to find the class SendMessageProcessAction on the activation of the bundle. Hope someone could assist.
    POST /system/console/bundles/246 HTTP/1.1] com.day.twitter.workflow [com.day.twitter.service.impl.SendMessageProcessAction] Error during instantiation of the implementation object (java.lang.ClassNotFoundException: com.day.twitter.service.impl.SendMessageProcessAction not found by com.day.twitter.workflow [246]) java.lang.ClassNotFoundException: com.day.twitter.service.impl.SendMessageProcessAction not found by com.day.twitter.workflow [246]
        at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787 )
        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
    package com.day.twitter.service.impl;
    import javax.jcr.RepositoryException;
    import javax.jcr.Session;
    import org.apache.felix.scr.annotations.Component;
    import org.apache.felix.scr.annotations.Properties;
    import org.apache.felix.scr.annotations.Property;
    import org.apache.felix.scr.annotations.Reference;
    import org.apache.felix.scr.annotations.Service;
    import org.osgi.framework.Constants;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import com.day.cq.workflow.WorkflowException;
    import com.day.cq.workflow.WorkflowSession;
    import com.day.cq.workflow.exec.WorkItem;
    import com.day.cq.workflow.exec.WorkflowData;
    import com.day.cq.workflow.exec.WorkflowProcess;
    import com.day.cq.workflow.metadata.MetaDataMap;
    import com.day.twitter.service.SendMessageProcess;
    import com.day.twitter.service.TwitterService;
    @Component
    @Service
    @Properties({
        @Property(name = Constants.SERVICE_DESCRIPTION, value = " An example of Social Publish Implementation"),
        @Property(name = Constants.SERVICE_VENDOR, value = "RIM POC"),
        @Property(name = "process.label", value = "RIM POC Social Publish")
    public class SendMessageProcessAction implements WorkflowProcess{
        @Reference
        private TwitterService twitterService; 
        public TwitterService getTwitterService() {
            return twitterService;
        public void setTwitterService(TwitterService twitterService) {
            this.twitterService = twitterService;
         * @scr.reference
        private static final String TYPE_JCR_PATH = "JCR_PATH";
        private final Logger logger = LoggerFactory.getLogger(this.getClass()
                .getName());
        private final Logger logger1 = LoggerFactory.getLogger(SendMessageProcessAction.class);
        public void execute(WorkItem workItem, WorkflowSession workflowSession,MetaDataMap args)
        throws WorkflowException {
            final Session session = workflowSession.getSession();
            final WorkflowData data = workItem.getWorkflowData();
            logger.info("TEST VIBHOR!!");
            logger1.info("TEST VIBHOR BHATIA!!");
            String path = null;
            String type = data.getPayloadType();
            if (type.equals(TYPE_JCR_PATH) && data.getPayload() != null) {
                String payloadData = (String) data.getPayload();
                try {
                    if (session.itemExists(payloadData)) {
                        path = payloadData;
                } catch (RepositoryException e) {
                    // TODO Auto-generated catch block
                    logger.error("Exception - Check repository for Payload data path");
                    e.printStackTrace();
            logger.info("arguments");
            String msg = "CQ5 workflow event";
                // is there a message?
            String argument = args.get("PROCESS_ARGS", "default value");
            boolean equal = argument.equals("argument1");
            if(equal){
                String recipient = argument.toString();
                 sendDirectMessageOnTwitter(recipient, msg, path);
            } else {
                logger
                        .error("for sending a DM on Twitter (make sure Twitter allows you to DM that account): dm,(recipient id)");   
               //  return "Check config - error";
        private void sendDirectMessageOnTwitter(String recipient, String msg, String path) {
            getTwitterService().sendDirectMessage(recipient, msg + ", path: " + path);

    <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.0.1</version>
            <extensions>true</extensions>
            <configuration>
              <instructions>
                <Bundle-Name>cq-core bundle</Bundle-Name>
                <Export-Package>twitter4j.*</Export-Package>
                <Import-Package>
                      !twitter4j.internal.http.alternative,
                      !org.slf4j.impl,com.day.*,*
                 </Import-Package>
                 <Private-Package>com.day.twitter</Private-Package>  
              </instructions>
            </configuration>
    </plugin>
    Bnd-LastModified: 1334862237167
    Build-Jdk: 1.6.0_21
    Built-By: bvibor
    Bundle-ManifestVersion: 2
    Bundle-Name: cq-core bundle
    Bundle-SymbolicName: com.day.twitter.workflow
    Bundle-Version: 1.0.0
    Created-By: Apache Maven Bundle Plugin
    Export-Package: twitter4j.internal.util, twitter4j.internal.http; uses:="twitter4j, twitter4j.internal.logging, twitter4j.internal.util, twitter4j.http, twitter4j.conf, javax.xml.parsers, twitter4j.internal.org.json, org.w3c.dom, org.xml.sax", twitter4j; uses:="twitter4j.internal.org.json, twitter4j.internal.http, twitter4j.api, twitter4j.http, twitter4j.internal.async, twitter4j.conf, twitter4j.internal.logging", twitter4j.internal.org.json, twitter4j.api; uses:=twitter4j, twitter4j.http; uses:="twitter4j.internal.http, twitter4j, twitter4j.conf, javax.crypto.spec, javax.crypto, twitter4j.internal.logging", twitter4j.internal.async, twitter4j.conf; uses:="twitter4j.internal.http, twitter4j.http, twitter4j.internal.async, twitter4j", twitter4j.internal.logging; uses:="org.apache.commons.logging, org.apache.log4j, org.slf4j, twitter4j.conf", twitter4j.util; uses:="twitter4j.internal.http, twitter4j, twitter4j.internal.org.json, twitter4j.http"
    Ignore-Package: org.slf4j.impl, twitter4j.internal.http.alternative
    Import-Package: javax.crypto, javax.crypto.spec, javax.xml.parsers, org.apache.commons.logging, org.apache.log4j, org.osgi.framework; version="1.4", org.slf4j; version="1.5", org.w3c.dom, org.xml.sax, twitter4j, twitter4j.api, twitter4j.conf, twitter4j.http, twitter4j.internal.async, twitter4j.internal.http, twitter4j.internal.logging, twitter4j.internal.org.json, twitter4j.internal.util, twitter4j.util
    Manifest-Version: 1.0
    Service-Component: OSGI-INF/components.xml
    Tool: Bnd-0.0.357

  • BundleException: Unable to resolve package; (package=org.apache.felix.scr.annotations)

    Hi guys,
    My bundle is installed but not active:
    Got the following errors in my log:
    org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle (bundle ID=1246) : myservlet.bundle. Reason: org.osgi.framework.BundleException: Unresolved constraint in bundle myservlet.bundle [1246]: Unable to resolve 1246.0: missing requirement [1246.0] package; (package=org.apache.felix.scr.annotations). Will retry.
    org.apache.felix.scr.annotations is imported and included in the bnd file.
    In Felix console I get this:
    org.apache.felix.scr from org.apache.felix.scr (41)
    org.apache.felix.scr.annotations -- Cannot be resolved
    org.apache.felix.scr.annotations.sling -- Cannot be resolved
    org.apache.sling.api from org.apache.sling.api (92)
    org.apache.sling.api.resource from org.apache.sling.api (92)
    org.apache.sling.api.servlets from org.apache.sling.api (92)
    org.ietf.jgss from org.apache.felix.framework (0)
    org.osgi.framework from org.apache.felix.framework (0)
    org.slf4j from slf4j.api (11)
    org.w3c.dom from org.apache.felix.framework (0)
    org.xml.sax from org.apache.felix.framework (0)
    Just can't figure out what else  need to be done to have org.apache.felix.scr.annotations resolved?
    Thanks!!!

    You might be importing the wrong ComponentContext if you're using one in your activate method's signature.  CRXDE gives errors with no explanation in that case.  Ensure that you have:
    import org.osgi.service.component.ComponentContext;
    as there are a couple of other ComponentContext classes and the class from the osgi package may not be the default chosen by CRXDE when imports are auto-populated.

  • 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?

  • Cannot load css files into osgi bundle

    I want to create JavaFX application based on several osgi bundles. I use Felix framework for osgi container. I face the same issue as this post
    Exception logged when using custom css in JavaFX in Felix OSGI
    How I can set globally
    -Dbinary.css=false
    Into the start JavaFX method. I would like at a low level to configure this.

    This should not be any issue with PE7 as it is meant for opening any supported not corrupted image. Can you please re check this issue with you. Make sure you have copied the image successfully and completely from your phone to your machine.
    If again you are facing the issue please share the image your are trying to open.
    Cheers,
    Sam

  • Replication from an OSGI bundle - help

    I am an OSGI newb!
    I create a custom WorkflowProcess that is called from a WorkflowLauncher when a certain node gets created on the Author instance.  The WorkflowProcess needs to replicate the node structure onder this node to the publisher.  
    I am having problems using the Replicator from the WorkflowProcess in the OSGI bundle.  I am not about to instantiate an instance of  com.day.cq.replication.Replicator.  I have tried using the @Reference annotation, but at runtime the replicator is null.  I have seen suggestions of using the Sling on the front end but that is not what I am looking for. 
    So my questions are:
    1.) How do I get an instance of  com.day.cq.replication.Replicator from inside a WorkflowProcess (WorkflowSession)?
    2.) Can I use Sling in the bundle?
    3.) Is there an easier way to do this?
    4.) Can I programmatically connect to the Publish server from my WorkflowSession and create the nodes with jcr?
    Thanks.

    The code to manually trigger replicator would look somewhat like this:
    import javax.jcr.Session;
    import com.day.cq.replication.Replicator;
    import org.apache.sling.jcr.api.SlingRepository;
    @Reference
    private Replicator replicator;
    @Reference
    private SlingRepository repository;
    try{
         Session session = repository.loginAdministrative(null);
         replicator.replicate(session, ReplicationActionType.ACTIVATE, path);
    finally{
         if (session != null){
              session.logout();
              session = null;

  • [OAM] modification of embedded Apache Felix property?

    Is there a *supported* way to modify configuration of the Apache Felix instance embedded in OAM?
    Specifically, I would like to modify these properties as outlined in
    http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-configuration-properties.html
    org.osgi.framework.system.packages - Specifies a comma-delimited list of packages that should be exported via the System Bundle from the framework class loader. The framework will set this to a reasonable default. If the value is specified, it replaces any default value.
    org.osgi.framework.system.packages.extra - Specifies a comma-delimited list of packages that should be exported via the System Bundle from the framework class loader in addition to the packages in org.osgi.framework.system.packages. The default value is empty. If a value is specified, it is appended to the list of default or specified packages in org.osgi.framework.system.packages.
    Basic problem is that I am attempting to use javax.crypto classes from inside an OAM custom plugin, but this is giving me errors, I believe because the container does not export these packages.

    Is there a *supported* way to modify configuration of the Apache Felix instance embedded in OAM?
    Specifically, I would like to modify these properties as outlined in
    http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-configuration-properties.html
    org.osgi.framework.system.packages - Specifies a comma-delimited list of packages that should be exported via the System Bundle from the framework class loader. The framework will set this to a reasonable default. If the value is specified, it replaces any default value.
    org.osgi.framework.system.packages.extra - Specifies a comma-delimited list of packages that should be exported via the System Bundle from the framework class loader in addition to the packages in org.osgi.framework.system.packages. The default value is empty. If a value is specified, it is appended to the list of default or specified packages in org.osgi.framework.system.packages.
    Basic problem is that I am attempting to use javax.crypto classes from inside an OAM custom plugin, but this is giving me errors, I believe because the container does not export these packages.

  • Create OSGi Bundle for GSA JAPI

    Hi
    We will be using GSA for the search feature for the website built in CQ5.4. For integration we are using GSA JAPI (http://gsa-japi.sourceforge.net/gsa-japi.html), however I am getting error with the JAR that was  converted to the OSGi Bundle based on the instructions given in the knowledge base "How to Convert a jar File into an OSGi Bundle" (http://dev.day.com/content/kb/home/cq5/Development/ApacheFelix/ConvertAJarIntoOsgiBundle.h tml).
    Error is in the import statement itself. Currently I have taken the source code and created the OSGi bundle, but then this is tedious to maintain. Can you please suggest on how to convert the jar to the osgi bundle or any other alternative solution.
    Thanks,
    Chetanya

    Hi Chetanya,
    It sounds like you already have everything you need.  Regarding future maintenance of GSA JAPI, it looks like there hasn't been a new release in four years, so you might be safe there.  Also, you could consider submitting the manifest file you created back to the project - perhaps the maintainers would consider making an update?
    Thanks,
    Matt

  • OSGi bundle JNI load/unload problem

    Hi everybody!!
    One more thread about the topic. I still didn't find a solution. Can anybody help me?
    I have an OSGi bundle that access native methods from a JNI library (for a medical device). I could make my bundle work once, but the second time I tried to access the methods, the dll was still in use I couldn't get data from the methods.
    This is the class I used (I even tried with a custom libloader):
    public class Omron637ITjni {
         /*Native functions from the JNI dll*/
         public native int OmronInit();
         public native int OmronClose();
         public native int OmronFinish();
         public native int OmronOpen(int disp);
         public native int OmronRead(MeasurementData MData, int pos);
         public native void OmronNumRead(DataCount DCount);
         static{
              //Using LibLoader
              /*try {
              LibLoader.loadCommLib("omron637IT");
              catch ( Exception x ) {
              // do what is necessary
                   System.out.println(x);
              //Using System Commander
              try{
                   System.out.println("Charging Library Omron");
                   System.loadLibrary("omron637IT");
              }catch(UnsatisfiedLinkError unsatisfiedlinkerror)
    System.out.println("Error loading library: " + unsatisfiedlinkerror);
    As it seems not to work, I'm trying with Singleton pattern. This is my new class:
    public class Omron637ITjni_Singleton {
              * Native functions from the JNI dll
              public native int OmronInit();
              public native int OmronClose();
              public native int OmronFinish();
              public native int OmronOpen(int disp);
              public native int OmronRead(MeasurementData MData, int pos);
              public native void OmronNumRead(DataCount DCount);
              private static Omron637ITjni_Singleton singleton;
              * Instance accessor following singleton.
              public static Omron637ITjni_Singleton getInstance() {
                   if (singleton == null){
                        System.out.println("Create Object");
                        singleton = new Omron637ITjni_Singleton();
                   else{
                        System.out.println("Object already created; use instance");
                   return singleton;
              * Private constructor to ensure that a <tt>ResourceManager</tt>
              * cannot be constructed from outside this class.
              private Omron637ITjni_Singleton() {     
              static{
                   //Using LibLoader
                   /*try {
                   LibLoader.loadCommLib("omron637IT");
                   catch ( Exception x ) {
                   // do what is necessary
                        System.out.println(x);
                   try {
                        System.out.println("Charging Omron library from Singleton");
                        System.loadLibrary("omron637IT");
                        System.out.println("Library charged");
                   } catch (UnsatisfiedLinkError ule) {
                        System.out.println("Error loading library: " + ule);
    At this very moment, when executing
    Omron637ITjni_Singleton jni = Omron637ITjni_Singleton.getInstance();
    from the Activator, I get from the Knopflerfish console:
    [stdout] omron637ITBPM starting...
    [stdout] Service registered: Omron 637IT Blood Pressure Monitor
    [stdout] Charging Library Omron desde Singleton
    [stdout] Library chatged
    [stdout] Create object
    Then, I call a services provided by the bundle:
    framework call omron637IT.Omron637ITInterface getData
    which calls the following function:
    public void getData() {
              // TODO Auto-generated method stub
              //Omron637ITjni jni = new Omron637ITjni();
              //Singleton
              Omron637ITjni_Singleton jni = Omron637ITjni_Singleton.getInstance();
              try {
                   int res = jni.OmronInit();
                   int ok_open = jni.OmronOpen(res);
                   System.out.println("The attempt of connecting the Omron637IT device ended with code: " + ok_open + " [(0) normal (1) still in process (2) error]");
                   if (ok_open == 0){ //OK
                        DataCount NumData = new DataCount();
                        jni.OmronNumRead(NumData);
                        System.out.println("DATA");
                        System.out.println("----");
                        for (int pos = 0;pos<NumData.nData1;pos++){
                             MeasurementData Data = new MeasurementData();
                             int ok_read = jni.OmronRead(Data,pos);
                             int annyo = Data.cYear + 2000;
                             int i = pos + 1;
                             if (ok_read == 0)
                                  System.out.println("Num: " + i + "; Date-> " + Data.cDay + "/" + Data.cMonth + "/" + annyo + "; Time-> " + Data.cTime + ":" + Data.cMinute + ":" + Data.cSecond + "; Sys-> " + Data.nSys + "; Dia-> " + Data.cDia + "; Pls-> " + Data.cPls);
                        int stop = jni.OmronClose();
                        System.out.println("Close with code " + stop + " Right?");
                        int finish = jni.OmronFinish();
                        System.out.println("Finish with code " + finish + " Right?");
                        System.gc();
                        System.gc();
                   else
                        System.out.println("The process of opening the device ended with error");
              }catch (UnsatisfiedLinkError ule) {
                   System.out.println("BRUTAL ERROR: " + ule);
    [stdout] The objeto already exists
    [stdout] BRUTAL ERROR: java.lang.UnsatisfiedLinkError: OmronInit
    Result: null
    which indicates that this time I'm using the same instance of the singleton class created in the activation process, but that I cannot access the method. ANY HINT??
    I also provide you the JNI dll code (because I add the exporting of the JNI_OnLoad & OnUnload methods:
    .h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class omron637IT_Omron637ITjni */
    #ifndef Includedomron637IT_Omron637ITjni
    #define Includedomron637IT_Omron637ITjni
    #ifdef __cplusplus
    extern "C" {
    #endif
    * OnLoad & UnLoad
    JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM vm, void reserved);
    JNIEXPORT void JNICALL JNI_OnUnload(JavaVM vm, void reserved);      
    * Class: omron637IT_Omron637ITjni
    * Method: OmronInit
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronInit
    (JNIEnv *, jobject);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronOpen
    * Signature: (I)I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronOpen
    (JNIEnv *, jobject, jint);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronRead
    * Signature: (Lomron637IT/MeasurementData;I)I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronRead
    (JNIEnv *, jobject, jobject, jint);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronNumRead
    * Signature: (Lomron637IT/DataCount;)V
    JNIEXPORT void JNICALL Java_omron637IT_Omron637ITjni_OmronNumRead
    (JNIEnv *, jobject, jobject);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronClose
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronClose
    (JNIEnv *, jobject);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronFinish
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronFinish
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    and part of the code (.cpp):
    JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM vm, void reserved)
         return JNI_VERSION_1_4;
    JNIEXPORT void JNICALL JNI_OnUnload(JavaVM vm, void reserved)
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronInit
    (JNIEnv *env, jobject obj)
         iNumberOflist = DEVLISTMAX;
         iSpeed = USF_SPEED4800;
         iStopBit = USF_STOP2;
         iProduct = USF_BPM;
         ret = USF_Search(hDlg, iSpeed, iStopBit, iProduct, DevList, &iNumberOflist);
         return iNumberOflist;
    Can anybody tell me what I'm doing wrong???. This really drives me crazy
    BR & very thanks in advance for any input.

    This is a known bug. Check out http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4712793

  • Finding classes within OSGi bundles via the JNI?

    As an example, I have a class com.company.bundle.myJavaClass within the OSGi bundle com.company.bundle.MyClass.
    Within my C++ code, after starting the JNI and OSGi via the usual invocation (with com.company.bundle in the classpath), If I try the following within C++ code:
    jclass myclass = jniEnv->FindClass("com/company/bundle/MyClass/");the FindClass call returns null, because the JNI apparently could not find the bundle.
    However, if I set everything up such that once the JVM is loaded, OSGi creates an instance of MyClass which then calls the C++ library
    JNIEXPORT void JNICALL Java_com_company_bundle_MyClass_c_1SimpleCall (JNIEnv * jniEnv, jobject manager)
    jclass myclass = jniEnv->FindClass("com/company/bundle/MyClass");
    }myclass is successfully found and I can successfully invoke MyClass methods through the JNI. However, if I ever try to do this outside of the above JNICALL function, it will fail to find the class (regardless of whether or not the bundle is loaded or if an instance of class exists.) Keeping track of the jniEnv pointer returned by the JNICALL function doesn't help, either.
    How can I get my C++ code to always succesfully find MyClass?
    Any insight would be appreciated!
    Edited by: mmetzger on Aug 20, 2009 10:05 PM

    mmetzger wrote:
    Thanks, I appreciate the condescension. :)
    It turns out that the actual problem is that classes loaded by OSGi do not use the system class loader like "normal" Java classes do. So the JNI cannot load the class anymore than any other non-OSGi code could.
    [This page|http://blog.springsource.com/2009/01/19/exposing-the-boot-classpath-in-osgi/] Is a much better description of the issue than I could hope to write.
    Interesting but nothing in there nor in a brief google look suggested anything other than that a custom class loader was used.
    And one can certainly load classes in JNI via custom class loaders.
    If you attempt to load a class that is only available via custom class loader and do not use that loader then the class will fail to load.

  • Installation problem: I'm not finding ...\eclipse\configuration\org.eclipse.osgi\bundles\15\1\.cp\lib

    <p>I&#39;m following the PDF on &#39;Creating a Thick Client Application&#39; and I do not find a 15 folder in the ...\eclipse\configuration\org.eclipse.osgi\bundles\ folder.  What piece did I not install?  </p><p> </p><p>Thanks in advance. </p>

    You can find the JAR in question, ReportViewer.jar, in ..\eclipse\plugins\com.businessobjects.sdks.jrc.11.8.0_11.8.1.v671\lib as well.  Note that "11.8.1.v671" above denotes the version number, which increases with every update; you should always use the latest version.

Maybe you are looking for