I am trying to deploy a Oracle CEP application on an embedded.
Device configuration:
Processor : ARMv6-compatible processor rev 7 (v6l)
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
PRETTY_NAME="Debian GNU/Linux wheezy/sid"
Linux version 3.1.9+ (shift@shift) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #2 Mon Apr 16 04:53:15 EST 2012
Setup:
The page Oracle Java Embedded Suite Downloads clearly expects us to use JES. However, I first need to compile the code for which I have a standard JDK installed on my windows machine. An application built in such a setup will of course throw an exception complaining of the version difference. So, I used the version of the CEP as per this page, but JDK mentioned below that would enable me to build it in the same environment as the deployment environment.
Java version: jdk-7u60-linux-arm-vfp-sflt
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) Client VM (build 24.60-b09, mixed mode)
Oracle Embedded CEP version: ofm_oep_embedded_11_1_1_7_1_linux/ocep_11.1
Code:
Using JDeveloper, I created a sample OEP Hello World application it comes with in a windows environment. The folder structure is as below:
├───META-INF
│ │ MANIFEST.MF
│ ├───spring
│ │ helloworld-context.xml
│ └───wlevs
│ processor.xml
└───src
└───com
└───bea
└───wlevs
├───adapter
│ └───example
│ └───helloworld
│ HelloWorldAdapter.java
├───event
│ └───example
│ └───helloworld
│ HelloWorldEvent.java
└───example
└───helloworld
HelloWorldBean.java
Contents of MANIFEST.MF is as below:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HelloWorld in app.proj
Bundle-SymbolicName: app.proj.HelloWorld
Bundle-Version: 1.0.0
Bundle-Localization: bundle
Bundle-Vendor: %project.vendor
Bundle-ClassPath: .
Code Compilation:
I moved these files to the linux environment described above and compiled the code using the command:
javac -cp /home/pi/ofm_oep_embedded_11_1_1_7_1_linux/ocep_11.1/modules/com.bea.wlevs.ede.api_12.1.3.0_0.jar /home/pi/myproj/src/com/bea/wlevs/adapter/example/helloworld/*.java /home/pi/myproj/src/com/bea/wlevs/event/example/helloworld/*.java /home/pi/myproj/src/com/bea/wlevs/example/helloworld/*.java
Build:
I built the jar using the command:
jar -cvmf META-INF/MANIFEST.MF myproj.jar com META-INF
Deployment:
java -jar -Dweblogic.deploy.UploadLargeFile=true -Xms128m -Xmx256m -XX:PermSize=128m -XX:MaxPermSize=256m /home/pi/ofm_oep_embedded_11_1_1_7_1_linux/ocep_11.1/bin/wlevsdeploy.jar -url http://127.0.0.1:9002/wlevsdeployer -user wlevs -password wlevs -install /home/pi/output/classes/myproj.jar
Issue:
I get the following exception when I deploy the application:
<26-Mar-2015 18:12:20 o'clock UTC> <Warning> <org.springframework.osgi.extensions.annotation.ServiceReferenceDependencyBeanFactoryPostProcessor> <BEA-000000> <Could not load class [com.bea.wlevs.spring.CacheBeanFactoryPostProcessor]
<26-Mar-2015 18:12:20 o'clock UTC> <Warning> <org.springframework.osgi.extensions.annotation.ServiceReferenceDependencyBeanFactoryPostProcessor> <BEA-000000> <Could not load class [com.bea.wlevs.spring.support.ServiceDependencyBeanFactoryPostProcessor]
..................................................
..................................................
..................................................
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloworldAdapter': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class] for property 'class'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter]: problem with class file or dependent class.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
..................................................
..................................................
..................................................
Caused By: java.lang.NoClassDefFoundError: com/bea/wlevs/ede/api/RunnableBean
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:580)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:550)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:481)
..................................................
..................................................
..................................................
Other trials:
The exception clearly indicates that the problem is with the class not available in the classpath. The class com.bea.wlevs.ede.api.RunnableBean is available in wlevsadmin.jar.
1) I tried adding a reference of wlevsadmin.jar in MANIFEST.MF (Eg: Bundle-ClassPath: ., lib/wlevsadmin.jar and then compile the classes). It still threw the same exception.
2) When I add the following entries in MANIFEST.MF:
Import-Package: com.bea.wlevs.configuration;version="12.1.3",
com.bea.wlevs.ede.api;version="12.1.3",
com.bea.wlevs.ede.impl;version="12.1.3",
com.bea.wlevs.ede.spi;version="12.1.3",
com.bea.wlevs.ede;version="12.1.3",
com.bea.wlevs.management.spi;version="12.1.3",
com.bea.wlevs.spring.support;version="12.1.3",
com.bea.wlevs.spring;version="12.1.3",
com.bea.wlevs.util;version="12.1.3",
org.apache.commons.logging;version="1.1.1",
org.springframework.beans.factory.config;version="3.1.1",
org.springframework.beans.factory;version="3.1.1",
org.springframework.beans;version="3.1.1",
org.springframework.core.annotation;version="3.1.1",
org.springframework.osgi.context;version="1.2.0",
org.springframework.osgi.extensions.annotation;version="1.2.0",
org.springframework.osgi.service;version="1.2.0",
org.springframework.util;version="3.1.1"
I get the following exception: org.osgi.framework.BundleException: The bundle "app.proj.HelloWorld_1.0.0 [196]" could not be resolved. Reason: Missing Constraint: Import-Package: com.bea.wlevs.configuration; version="12.1.3"
3) I tried adding an entry to export wlevsadmin.jar into CLASSPATH in ~/.bashrc which did not work. (*Of course I executed exec bash after updating this file). This threw the same exception.
4) I tried placing wlevsadmin.jar in modules, bins and libs folders of installations directories and also in the server's. I get the same exception or a different one in the case of modules/ext.
Oracle provides the best products. So, I know there is something fundamental that I might have missed. Please help me with this.