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

Similar Messages

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

  • 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

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

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

  • 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

  • Load / unload numerous images in air application (memory leak?)

    Hi,
    after struggling for a few days with this, I realized I need help!
    I am trying to make an application load and display A LOT (hundreds) of images thumbnails at various position in a big area. The problem is that when I try to unload and reload images, I end up with an increasing memory, that does not get collected by the garbage collector.
    My first challenge was to load images from anywhere in the computer (I am quite new to flex), which I solved by using a File reference and a Loader using the url extracted from the file:
                   private function createImage():void {
                             var img_:String = "1905_a_mondrian.jpg";
                             var imageFile:File = new File();
                             imageFile.nativePath = imagesPath + "/" + img_;
                             var imageLoader:Loader = new Loader();
                             // useWeakReference permits the GC to collect the memory when the eventListener is dropped
                             imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
                             imageLoader.load(new URLRequest(imageFile.url));
                             imageFile = null;
    I make sure I remove the eventListener in the loaded method:
         e.target.content.removeEventListener(Event.COMPLETE, loaded);
    And then Populate an external component:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/halo"
              x="-100" y="-100"  width="200" height="200" >
         <!-- The trick is right above this line: offset the anchor point to center the component around -->
         <fx:Script>
              <![CDATA[
                   import mx.controls.Image;
                   [Bindable]
                   public var image:Image;
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <mx:Image id="img_" source="{image}" horizontalCenter="0" verticalCenter="0" autoLoad="true" />
         <!-- impair width and height results in problems for centering the ellipse (e.g. for rotation) -->
         <s:Ellipse height="4" width="4"  horizontalCenter="0" verticalCenter="0" >
              <s:fill>
                   <s:SolidColor color="0x00FF00"/>
              </s:fill>
         </s:Ellipse>
    </s:Group>
    I populate a Dictionary to keep a track of all the component created. Finally I nullify all that I can to hint the garbage collector.
    Now I have a function to empty the Dictionary (componentBag below) when we want to unload the images:
                   protected function button1_clickHandler(event:MouseEvent):void
                             for each ( var g : Group in componentBag )
                                       ((ImgPanel)(g.getChildAt(0))).img_.unloadAndStop(false);
                                       ((ImgPanel)(g.getChildAt(0))).image = null;
                                       delete componentBag[g.uid];
                                       g.removeElementAt(0);
                                       this.removeElement(g);
                                       g = null;
         triggerGC();
    PROBLEM: using profiler, the loading/unloading works once or twice and after the memory keeps increasing... And if I launch the application, wait for a while and do a load/unload, the garbage collection only recovers a few megabytes, far from what was allocated for displaying the images.
    What am I missing? Is there a problem with loading a lot of images? Has anyone done this?
    In attachment is the full test code, the ImgPanel goes inside a 'views' package

    Thanks to Anton_AL, I finally solved this problem by using an URLLoader AND a plain Loader:
    var loader: URLLoader = new URLLoader( );
    loader.dataFormat = URLLoaderDataFormat.BINARY;
    loader.addEventListener(Event.COMPLETE, onLoadingComplete );
    loader.load( new URLRequest(file.url) );
    private function onLoadingComplete( e: Event ):void
         var loader: Loader = new Loader( );
         loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onParsingComplete );
         loader.loadBytes( e.target.data );
    private function onParsingComplete( e: Event ):void
         var img: BitmapImage = new BitmapImage( );
         img.source = (e.target.content as Bitmap).bitmapData;
         _images.push( img );
    private function onImageLoaded( e:Event ):void
         var img: Image = e.target as Image;
         img.removeEventListener( Event.COMPLETE, onImageLoaded );
         _images.push( img );
    See Anton's thread here: http://forums.adobe.com/message/2358653#2358653

  • New HDD Load / Unload Cycle Count increasing extremely fast !

    Hi all
    I just upgrade my Pavilion dv5 HDD. The new model is Hitachi Travelstar 7K500 (HTS725050A9A364). However, I found my new HDD's Load / Unload Cycle Count increasing extremely fast!
    Until now the number of Load / Unload Cycle is 12,127. However, the new HDD only power on 137hours. (About 1 week of my use.)  The data below is my new HDD's SMART data (by EVEREST 5.50):
    ID   
    01    Raw Read Error Rate    62    100    100    0   
    02    Throughput Performance    40    100    100    0   
    03    Spinup Time    33    159    159    2  
    04    Start/Stop Count    0    100    100    14   
    05    Reallocated Sector Count    5    100    100    0  
    07    Seek Error Rate    67    100    100    0  
    08    Seek Time Performance    40    100    100    0  
    09    Power-On Time Count    0    100    100    137  
    0A    Spinup Retry Count    60    100    100    0   
    0C    Power Cycle Count    0    100    100    14  
    BF    Mechanical Shock    0    100    100    0   
    C0    Power-Off Retract Count    0    100    100    1 
    C1    Load/Unload Cycle Count    0    99    99    12127   
    C2    Temperature    0    152    152    19, 36  
    C4    Reallocation Event Count    0    100    100    0   
    C5    Current Pending Sector Count    0    100    100    0  
    C6    Offline Uncorrectable Sector Count    0    100    100    0  
    C7    Ultra ATA CRC Error Rate    0    200    200    0  
    DF    Load/Unload Retry Count    0    100    100    0   
    I'm pretty sure that the data is correct, because I can hear the HDD's Load / Unload sound very frequently. The C1 row increase about 2,000 per day.  However my previous Hitachi 5K320 has no problem. The running operating system are both Windows 7.
    I'm so worry about this. As you know, laptop HDD's L / UL Cycle is designed at 600,000. If my HDD continue increasing like this, it will reach this number in a very short time. Any one can help me?

    It's a feature of modern 2.5" harddisks , the disk parks the head when its been inactive for a while, to avoid damage , uses less power , and reduces the heat etc gives the harddisk a better looking spec sheet , its meant to park its head after being inactive for a long time around an hour with proper management from the bios/os of the head parking feature, because there is nothing to manage this feature in hp's bios or os the disk parks the head about every minute for no reason then after 1 second the head goes back on the disk thats 1 load/unload cycle , it also effects performance as the head has to find its place back on the disk , load times will decrease by alot , videos will stutter the first few secs, i have the same problem but not as bad after 130 hours i had a count of around 1,250 load/unloads , different brands of disk have different idle timers plus i use utorrent which stops the harddisk from idling so much, there are a couple of solutions, you can find a tool to update/mod the harddisk firmware to increase the idle timer ( i decided against this as you can permently brake the harddrive and void the warrenty) , contact hp and request a bios update with proper management or the harddisk head parking feature i.e tell the harddisk it is idle after an hour, the temperary solutions are download hd tune and run it all the time this stops the harddisk from parking its head as it doesn't let it go idle , or the solution i am using at the moment download a programme called HDD scan , everytime you turn on/off  you have to run the prog go to tasks/features/ide features set the advance power management from its default value to 254 then press set, no more unnessary load/unloads, downside is the disk runs a couple of 0c hotter mine still never goes above 40c even under full load thanks to a active cooling pad, also its less well protected against shock.

  • Load & Unload Movie Issue

    Hi Guys:
    Have 2 unable solve issues, would be much appreciated if anyone could help.
    // ISSUE 1 //
    I am experiencing an issue with Load & Unload Movie.  What happen is that I am trying to load an external SWF into a movie clip call movieContainer in my main website.  This external SWF file has timeline that perform a animation when it's loaded into the movieContainer.
    I can load and unload the movie with no problem...the issue is that after I unload the SWF and then at any point of the movie on the main website I click to load the SWF back to the stage.....the timeframe of the SWF file stay at where it get left off(when it's unloaded).  I am trying to make it play start all over again.
    I try the movieContainer.content.gotoAndPlay(1); but it doesn't do anything. Any idea how I could make this work?
    Here is my code:
    var content:Loader = new Loader();
    content.load(new URLRequest("externalSwf/content.swf"));
    loadMovieButton.addEventListener(MouseEvent.CLICK, loadMovieButtonClicked);
    function loadMovieButtonClicked(e:MouseEvent):void{
        movieContainer.addChild(content);
    // ISSUE 2 //
    In my external SWF file, I have create a loading loader at the 1st frame.  But it doesn't play all the time when I testing on the server.  It works just fine when I test locally with TEST MOVIE.  Not only it doesn't play all the time.....it suppose to play from 2nd frame of the movie after the loading is finished (I have a short animation play between frame 2 - frame 20)  Instead of playing from frame 2 to frame 20, the animation just jump straight to frame 20...which mean the user won't see the animation between frame 2 - frame 20.
    import flash.events.ProgressEvent;
    function update(e:ProgressEvent):void
    var percent:Number = Math.floor( (e.bytesLoaded*100)/e.bytesTotal );
    if(preloaderMC is MovieClip){
    preloaderMC.gotoAndStop(percent);
    //preload_txt.text = String(percent);
    if(percent == 100){
    gotoAndPlay(2);
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, update);
    // Extra test for IE
    var percent:Number = Math.floor( (this.loaderInfo.bytesLoaded*100)/this.loaderInfo.bytesTotal );
    if(percent == 100){
    nextFrame();
    stop();
    Many Thanks!

    Thanks for the reply, the code I use to load the external SWF is:
    The button is within a movieClip: commercialScrollBar_mc
    The button instance name is: stackPancakeBar
    The external SWF get to load into a movieClip container call: projectDetailsContainer_mc
    var ldr:Loader = new Loader();
    ldr.load(new URLRequest("projectsCommercial/stackPancakeBar.swf"));
    commercialScrollBar_mc.stackPancakeBar.addEventListener(MouseEvent.CLICK, stackPancakeBarClicked);
    function stackPancakeBarClicked(e:MouseEvent):void{
        MovieClip(ldr.content).gotoAndPlay(1);
        projectDetailsContainer_mc.addChild(ldr);
    I was thinking does it has anything to do with the UNLOAD script I have on the external SWF file? Below are the code for removing the child.
    back_btn.addEventListener(MouseEvent.CLICK, removeProjectDetails);
    function removeProjectDetails(e:MouseEvent):void{
        this.parent.parent.removeChild(this.parent);
    Thanks Heaps, by the way, do you have any idea why the loading sequence doesn't get to play every time?  Or perhape the file size is too small?

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

  • Is there way to use the 11gR1 JRF as an osgi bundle in 11gR2?

    We've got a number of developers who want to use JDev 11gR2 for performance reasons, but we have to write software for 11gR1 Fusion Middleware. Is there a way to load the 11gR1 JRF and related dependencies as an osgi bundle? Or some other mechanism to accomplish the same? (Can I please have my cake and eat it too?)

    No, I don't really have any documentation on it or anything. I just know that nothing like that exists :)
    John

  • Diff. times are taken to complete load unload archive and unarchive

    Hi All,
    I am facing a problem with loading  unloading archiving and unarchiving repository.
    Problem is Everyday it is taking different to complete the process. Is the time deneds on the data and images availavle in the repository?
    If large amount of data is there then it will take more time to complete all these process or large amount of user are log in it will take more time to unload?
    Please Suggest
    Thanks

    Hi Shalini,
    The repository Archieving and Unarchieving operations involves the data base.
    I mean Repository  tables and fields and the data of the repository are in the underlying database and You can backup an MDM repository using the MDM archiving mechanism.That will save the repository scema .a2a file for furthere refrence.This schema contains the tables and fields inside the tables and all these things are storesd on the DBMS level.So suppose next time when you unarchieve the repository and made some changes like
    1.You have added some new Tables and Fields.
    2.You have added new Data.
    And all this is getting stored at the database leve at the end.
    In this case the amount of data of your repository in terms of Tables and Fields or Data at the DBMS Level.So next time when you  take archieve of your Repository It will take some extra time as compare to the previous one.And same thing will happen in case of Unarchieving because this time some new tables and their fields  and some new data(images,pdfs etc) they all will be unarchieved as a Part of Repository so it will take a bit extra time to Unarchieve.
    Same thing will happen in case of Loading and Unloading as the tables ,fields and amount of data increases the time to load and unload will also increases.
    At the time of loading the repository You can go to your MDM Server and check that repository in status it will show checking image ID's ,processing tables,processing sound tables,loading search indexes etc.
    Making a few minor adjustment with MDM and/or the DBMS server can enhance search and update performance by 10% to 20%.
    SQL Serveru2019s performance increases by about 10% when the main data file (.mdf) and the transaction log file (.ldf) are located on separate spindles. Remember that this means using different drives, not just
    different drive letters.
    Reward if Helpfull.
    Regards,
    Vinay Yadav

  • Load/ Unload external .swf

    ----------------------------------------
    vita | web | design | illustration
    "main" here
    I try to have external .swf on this "main" part of my flash
    design automatically using load actionscript.
    I have 3 different sets of actionscripts for load/unload.
    But, the problem is when I click vita or other menu on the
    top after loading "main" external .swf, they are overlapped.
    How can I unload the external .swf from the automatically
    loaded .swf?
    (As I know, there are mostly buttons to click on loading
    external .swf. But for my design, I want it loads automatically.)
    Thanks in advance for suggestions. Please let me know if my
    description/question is not clear to answer.

    Are you using AS2 or AS3. The approach is completely
    different for both.

  • How to Load/Unload external SWF

    Hey all, I'm in a desperate struggle to meet a deadline for college coursework. I am unable to UNLOAD an external SWF file that I have put inside another SWF file. The problem that is occurring is, although it loads successfully, when I attempt to navigate to another page after viewing the external SWF, I expect it to close as it goes on to another page however, it remains in place. If i then go back on to the page that it is loading from, it will start to keep adding more and more SWF's. The print screens should explain it easier... Below i'll post the code that I'm using currently. The external SWF I am trying to load/unload is an interactive hangman game (whether it being interactive has an effect I do not know), but any and all help with this would be seriously appreciated!
    The code currently being used is:
    var _swfLoader:Loader;
    var _swfContent:MovieClip;
    loadSWF("Real Hangman.swf");
    function loadSWF(path:String):void {
       var _req:URLRequest = new URLRequest();
       _req.url = path;
       _swfLoader = new Loader();
       setupListeners(_swfLoader.contentLoaderInfo);
       _swfLoader.load(_req);
    function setupListeners(dispatcher:IEventDispatcher):void {
       dispatcher.addEventListener(Event.COMPLETE, addSWF);
       dispatcher.addEventListener(ProgressEvent.PROGRESS, preloadSWF);
    function preloadSWF(event:ProgressEvent):void {
       var _perc:int = (event.bytesLoaded / event.bytesTotal) * 100;
       // swfPreloader.percentTF.text = _perc + "%";
    function addSWF(event:Event):void {
       event.target.removeEventListener(Event.COMPLETE, addSWF);
       event.target.removeEventListener(ProgressEvent.PROGRESS, preloadSWF);
       _swfContent = event.target.content;
       _swfContent.addEventListener("close", unloadSWF);
       addChild(_swfContent);
    function unloadSWF(event:Event):void {
       _swfLoader.unloadAndStop();
    removeChild(_swfContent);
       _swfContent = null;
    This printscreen is showing what it looks like in the Flash view (plain background and external SWF loads when this SWF is published)
    What it looks like when loaded as published swf
    Picture of the external SWF working inside the other SWF
    Picture of it not being able to unload when i navigate to another page!
    Finally, a picture of it doubling up when i proceed to go on the 'game' page again, it just keeps loading the SWF's rather than unloading them!

    for example, file1 consits of two buttons, and also considered as main page. As i click on these two buttons , it will lead me go to open the external file2.swf, and file3.swf respectively. (file2.swf and file3.swf could have other navigation buttons, however, i am just simplify here).
    the code you provided is working fine. but i want to totally remove/unlink the orginal file (file1.swf) when i click on either buttons which could lead me to other page (file1.swf or file2.swf).
    Besides that, in file2.swf and file3.swf could have another "back" button to turn it back to the main page (file1.swf). When the user click on that back button, the file2.swf will unloaded...and file1.swf will be called back again...
    can it  be done?
    so sorry if my poor explanation makes you confuse..
    thank you.

  • Coherence 3.5  as OSGi bundle

    Hi,
    We are starting out on an OSGi project which will use Coherence 3.5 as a data grid for storing and manipulating application data. I see that Coherence (as a separate product) is getting released as a Jar and not as an OSGi bundle. When I looked on the web, I see that Coherence (3.4) is getting packaged along with other Oracle products (CEP 10.3) as OSGi bundle (http://blogs.oracle.com/CEP/2008/10/oracle_complex_event_processin_1.html) and Oracle Fusion Middleware 11g.
    Let us know if we can expect to see Coherence getting released as an OSGi bundle in the near future.
    Till that time, Is there any guidance/recommendation on:
    1) Running Coherence in OSGi environment
    2) Accessing Coherence from an OSGi client application
    Thanks,
    Prakash

    1. Generally, it's easiest if there is membership in only one Coherence cluster per OSGi container. In other words, one member of one cluster per container.
    2. (From Stephen Felts, note that this was pre-3.5) Coherence currently uses the context classloader of the thread to find the default configuration file (coherence-cache-config.xml) and the JMX configuration (reports/report-group.xml). This is generally not the correct thing when running in OSGi. Applications will need to reset the context classloader before getting the class.
    ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
    ClassLoader newLoader = com.tangosol.net.CacheFactory.class.getClassLoader();
    Thread.currentThread().setContextClassLoader(newLoader);
    CacheFactory.getCache(cacheName);  //Start coherence cache instance
    Thread.currentThread().setContextClassLoader(oldLoader);"
    {code}
    3. (From Hal Hildebrand) There are issues that can come up specifically with respect to serialization with complex dependencies across bundles. Basically, OSGi allows classes to be hidden through the modules, so you have to be really careful as to the class loader you use for the cache.  Here's a simple scenario showing the issue: Let's say that we're using the class loader from Bundle A.  Bundle A imports the interface FOO from Bundle B.  Bundle A uses an implementation of FOO, FooImpl, from Bundle C.  However, Bundle C either doesn't import FooImpl (i.e. it's a private class) or Bundle A doesn't import the package from Bundle C. So, if you serialize FooImpl into the cache, what happen in the above scenario is that the cache will not be able to deserialize FooImpl using Bundle A's class loader.
    4. There are various issues around the use of static fields in Coherence. These are very "non OSGI like". It's generally an issue when you are trying to create a Coherence bundle and decide what APIs to expose. Some of the "builder" work that went into 3.5 was designed to help rectify this and make Coherence easier to use in OSGi.
    5. (From Jeff Trent, in lieu of having a Coherence bundle as part of the Coherence distribution) Bundlizing Coherence jar(s) is a prerequisite for using Coherence w/ OSGi.  For this, you can essentially lift the bundles out of (e.g.) CEP.  There are tools like BND (http://www.aqute.biz/Code/Bnd) integrated into Maven that really make this quite simple to do.
    The summary I have so far is that using Coherence in OSGi is easy for easy stuff today, but there are a number of things that we're developing to make the more complex use cases simple in the future.
    Peace,
    Cameron Purdy | Oracle Coherence
    http://coherence.oracle.com/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for