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

Similar Messages

  • Coherence 3.6 OSGI bundle

    Is Coherence (version 3.6) OSGI bundle available? If not please point me to the link that documents coherence dependency information which i require while bundelizing coherence jar using a scaffolding tool. Thanks in advance.

    Hi Yashas,
    There is no OSGi bundle for Coherence available to download from OTN but you can use external tools like Eclipse IDE (creating plugins) or pax construct to convert coherence.jar to an OSGi bundle.

  • JMS for Osgi-Bundle Communication

    Hey,
    I want to use jms for commuication between OSGi-Bundles. I have implementet the bundles so far, but I get the following error message:
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at jmsQueueStubBundlePackage.Activator.start(Activator.java:60)
         at org.knopflerfish.framework.BundleImpl$1.run(BundleImpl.java:281)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:255)
         at org.knopflerfish.framework.Framework.startBundle(Framework.java:453)
         at org.knopflerfish.framework.Main.handleArgs(Main.java:305)
         at org.knopflerfish.framework.Main.main(Main.java:190)
    Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
         ... 11 more
    Has anybody an idea, how I can fix this
    Chris

    Hello there,
    Many thanks for the reply,
    Well just clarify i may be wrong, i said i need 100 queues is because
    we have hunderds of brokers office where we can place orders
    our requirement is as below.
    a) One client can place multiple orders with MULTIPLE brokers simultaneously. i.e choose different brokers and do a long and short
    at the same time
    b) Now based on the brokers chosen by the client orders must be
    routed to multiple broker's office
    c) same way trade updates / trade confirmation's need to be sent
    to the client , please note that MULTIPLE brokers will be sending
    the orders to the SINGLE client
    d) Now i need a reliable channel to do this, both of the actions (point
    b and c ) is async . Unless i create a seperate queue for each of
    the brokers how is it possible to reliably (i mean specific broker / client) to communicate with each other
    e) It is a complex scenario , please do let me know if you can get the point , if not please do mention i will try to simplify my questions
    Would greatly appreciate if someone can help to scrutinize on the architecture , more importantly if JMS is appropriate here.
    Many thanks,

  • 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

  • How do you create an installer/bundle for PPro with extension, a plugin (export-controller) and some

    Hi
    As my topic says
    How do you create an installer/bundle for PPro with extension, a plugin (export-controller) and some custom presets?
    Assume you have Flash Builder 4.5, CS Extension builder 2.0, Xcode 4.5.1 running under MacOS 10.8.

    I understand why you need updated running headers in your book. To a sighted reader these serve as a guide to where you are and help you find things quickly.  In addition, if you are exporting your data to XML or HTML from the tagged PDF it would also be important to have these in the proper location. 
    But for accessibility purposes, it doesn't have to be there because the screen reader reads everything in linear order, line by line.  No one is looking at the page.  A user listening to the screen reader read the page is going to hear this heading, just before the actual word itself. So they will hear the first word on the page twice.  It's not the end of the world if it's there, but such headings are not necessary for accessibility unless they are not repetitive and contain information that is not otherwise available.
    So I would say, fine if you need them or want them there, it's just one word. 
    I think you should try exporting your book to PDF (or even just a chapter of the book) and look at the tags panel in Acrobat to see if you are getting the result you want.  I can't tell you exactly what you should do to get those results, you are using a plug-in I don't have. 
    I can tell you I didn't have to add the headers to any article at all, they just automatically export if the other articles in the file are added and you don't select the header style option "not for export as XML."
    You may not experience the same results with your plug-in, but I think it will probably work the same way. 
    Give it a try and best of luck.

  • Create Message Bundle classes for EO objects in Jdeveloper

    How to create Message Bundle classes(extending JboResourceBundle) for an EO object using Jdeveloper. The ADFToyStoreDemo contains these bundle classes for the EO. However, when I complete create a new EO, I don't get a default Message Bundle class.

    Don't you get these when you add validation rules to the entity or default values / control hints, etc?

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

  • 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

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

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

  • Error when creating a bundle or policy

    Hi
    We are running ZCM 10.3 on SLES10 and when we try to create a bundle or policy we get an error after pressing the finish button.
    The wizard cannot continue for the following reason(s):
    Unable to complete your request for the following reason: com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: org.hibernate.exception.ConstraintViolationExcepti on: could not insert collection: [com.novell.zenworks.datamodel.objects.assignableco ntent.AssignableContentObject.ContentServers#9b5f6 6c5a47022d1c5b51b098392d30a]
    It has worked before and we have 120 bundles in the system, and we have been running 10.3 for a while now without problems.
    I've atteched the log on the error.
    Sorry for the big logfile-dump but I wasn't sure on what I could delete so I copied it all.
    Any ideas or should I log a SR?
    Best regards
    /Jonas

    Did you ever solve this issue? We are experiencing the same errors, but with ZCM 11. Server configurstion is Windows Server 2008R2, database is MS SQL 2005.
    Every time we try to create or change a (Windows) bundle or policy there's an error message in ZCC. The error is:
    com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: org.hibernate.exception.ConstraintViolationExcepti on: could not insert collection: [com.novell.zenworks.datamodel.objects.assignableco ntent.AssignableContentObject.ContentServers
    ...followed by a different GUID(?) every time.
    We've placed a SR but haven't had any suggestions from Novell yet - we're soon going from calm to panic as we are planning to move from test to production in two weeks...
    Cheers,
    Peter

  • Can't find bundle for base name... and selectOne tags

    I have a problem. I have a little application with internationalization working very well. But when i introduce a selectOneMenu tag i get the following error:
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Can't find bundle for base name MessageBundle, locale en
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.pages.default_jsp._jspService(default_jsp.java:121)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.apache.jasper.runtime.PageContextImpl
    When I take off the selctOneMenu tag and every thing work well again.
    the code of the page is the following:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:loadBundle basename="localizations.MessageBundle" var="bundle"/>
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <f:view>
    <%@ include file="/pages/includes/header.jsp" %>
    <h:selectOneMenu>
         <f:selectItems value="#{pruebaBean.condiments}"/>
    </h:selectOneMenu>
    </f:view>
    </body>     
    </html>
    The pruebaBean code is the following:
    public class PruebaBean {
         private Map condiments = null;
         public Map getCondiments() {
         if(condiments == null) {
         condiments = new HashMap();
         condiments.put("Cheese", new Integer(1)); // key,value
         condiments.put("Pickle", new Integer(2));
         condiments.put("Mustard", new Integer(3));
         condiments.put("Lettuce", new Integer(4));
         condiments.put("Onions", new Integer(5));
         return condiments;
         public PruebaBean() {
         public void setCondiments(Map condiments) {
              this.condiments = condiments;
    The MessageBundle work well, the problem i think is something with the selectOneMenu.
    Help me please.

    a) You can't use map for that purpose.
    b) You have to create SelectItem objects
    c) If you return an array of selectItem on this method condiments, it will go ok.

  • Can't Find Bundle for Base name

    Please help! I've tried just about everything!!!
    Error:
    Exception in thread "main" java.util.MissingResourceException: Can't
    find bundle for base name Messages2/Messages2, locale
    java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1508)
    java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1262)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:789)
    com.hypefiend.javagamebook.games.rps.RPSClient.main(RPSClient.java:55)
    Java Result: 1
    package com.hypefiend.javagamebook.games.rps;
    import com.hypefiend.javagamebook.client.*;
    import com.hypefiend.javagamebook.common.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.util.*;
    import java.net.*;
    import java.io.*;
    import org.apache.log4j.*;
    public class RPSClient extends GameClient {
        /** log4j logger */
        protected static Logger log = Logger.getLogger("RPSClient");
        /** reference to ConsoleEventReader that reads events from user input */
        protected RPSConsoleEventReader consoleReader;
         * main.
        public static void main(String args[] ) {
         // setup log4j
         BasicConfigurator.configure();
         if (args.length < 2) {
             System.out.println("usage: java com.hypefiend.javagamebook.games.rps.RPSClient <host> <player_name>\n");
             System.exit(0);
          String language;
            String country;
            if (args.length != 2) {
                language = new String("en");
                country = new String("US");
            } else {
                language = new String(args[0]);
                country = new String(args[1]);
            Locale alocale;
            ResourceBundle mesg;
            alocale = new Locale(language, country);
            mesg= ResourceBundle.getBundle("src/com/hypefiend/javagamebook/games/rps/Messages2/Messages2",
                                               alocale);
        // fire up the client
         RPSClient gc = new RPSClient();
         gc.init(args);
         gc.start();
         * call GameClient.init()
         * and start our ConsoleEventReader
        public void init(String args[]) {
         super.init(args);
         consoleReader = new RPSConsoleEventReader(this, inQueue, outQueue);
         consoleReader.start();
         * shutdown the client
        protected void shutdown() {
         consoleReader.shutdown();
         super.shutdown();
         * handle incoming GameEvents from the EventQueue
        protected void processIncomingEvents() {
         GameEvent inEvent;
         while (inQueue.size() > 0) {
             try {
              inEvent = inQueue.deQueue();
              switch (inEvent.getType()) {
              case GameEventDefault.S_LOGIN_ACK_OK:
                  break;
              case GameEventDefault.SB_LOGIN:
                  stdOut( java.util.ResourceBundle.getBundle("src/com/hypefiend/javagamebook/games/rps/Messages2/Messages2").getString("login:_") + inEvent.getMessage());
                  break;
              case GameEventDefault.SB_LOGOUT:
                  stdOut( java.util.ResourceBundle.getBundle("src/com/hypefiend/javagamebook/games/rps/Messages2/Messages2").getString("logout:_") + inEvent.getMessage());
                  break;
              case GameEventDefault.SB_CHAT_MSG:
                  stdOut( inEvent.getPlayerId() + ": " + inEvent.getMessage());
                  break;
              case GameEventDefault.S_DISCONNECT:
                  stdErr( java.util.ResourceBundle.getBundle("src/com/hypefiend/javagamebook/games/rps/Messages2/Messages2").getString("disconnected_from_server:_") + inEvent.getMessage());
                  shutdown();
                  break;
              case GameEventDefault.S_JOIN_GAME_ACK_OK:
                  stdOut( inEvent.getMessage());
                  inGame = true;
                  break;
              case GameEventDefault.S_JOIN_GAME_ACK_FAIL:
                  stdOut( inEvent.getMessage());
                  inGame = false;
                  break;
              case GameEventDefault.SB_PLAYER_QUIT:
                  stdOut( inEvent.getMessage());
                  inGame = false;
                  break;             
              default:
                  stdOut( inEvent.getMessage());
                  break;
             catch (InterruptedException ie) {}
         * return our GameName
        public String getGameName() {
         return "RPS";
         * factory method to create GameEvents
        public GameEvent createGameEvent() {
         return new GameEventDefault();
         * factory method to create login GameEvents
        public GameEvent createLoginEvent() {
         return new GameEventDefault(GameEventDefault.C_LOGIN);
         * factory method to create disconnect GameEvents
        public GameEvent createDisconnectEvent(String reason) {
         return new GameEventDefault(GameEventDefault.S_DISCONNECT, reason);
    }Edited by: ahulet2007 on Nov 2, 2007 8:49 AM

    You continue to use slash instead of dot.
    You did not follow any of my suggestions and still awarded me dukes,
    so I feel I have to make a last attempt.
    Here is what I have:
    D:\try>dir /s
    Volume in drive D is New Volume
    Volume Serial Number is 3ECC-CB52
    Directory of D:\try
    11/05/2007  12:18 PM    <DIR>          .
    11/05/2007  12:18 PM    <DIR>          ..
    11/05/2007  12:19 PM    <DIR>          a
                   0 File(s)              0 bytes
    Directory of D:\try\a
    11/05/2007  12:19 PM    <DIR>          .
    11/05/2007  12:19 PM    <DIR>          ..
    11/05/2007  12:19 PM    <DIR>          b
    11/05/2007  12:17 PM               808 MyClass.class
                   1 File(s)            808 bytes
    Directory of D:\try\a\b
    11/05/2007  12:19 PM    <DIR>          .
    11/05/2007  12:19 PM    <DIR>          ..
    11/02/2007  01:56 PM                11 Messages.properties
                   1 File(s)             11 bytes
         Total Files Listed:
                   2 File(s)            819 bytes
                   8 Dir(s)  70,889,848,832 bytes free
    D:\try>java a.MyClass
    value
    D:\try>Here is the code for MyClass:
    package a;
    import java.util.*;
    public class MyClass
      public static void main( String[] args ) throws Exception
        ResourceBundle rb = ResourceBundle.getBundle( "a.b.Messages" );
        System.out.println( rb.getString( "key") );
    }Here is the contents of Messages.properties:
    key = value

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

Maybe you are looking for