No Class Found Error on invoking java class from PL/SQL
Hi There,
I have followed instructions on how to create a java proc in the DB to invoke it from PL/SQL.
I get a 'java.lang.NoClassDefFoundError' error because it cannot access 'org.apache.axis.description.TypeDesc' in this case. The instuctions say to add the supporting jars which contain the additional classes to the project's Additional Classpath's which I have done.
I deploy the java classes and create the java stored proc using JDev.
Can someone please tell me how to go about resolving this?
I can see 'org.apache.axis.description.TypeDesc' in the DB via JDev's Databse connection in the Java Classes tree?
Thanks,
Anthony
Hi There,
I have followed instructions on how to create a java proc in the DB to invoke it from PL/SQL.
I get a 'java.lang.NoClassDefFoundError' error because it cannot access 'org.apache.axis.description.TypeDesc' in this case. The instuctions say to add the supporting jars which contain the additional classes to the project's Additional Classpath's which I have done.
I deploy the java classes and create the java stored proc using JDev.
Can someone please tell me how to go about resolving this?
I can see 'org.apache.axis.description.TypeDesc' in the DB via JDev's Databse connection in the Java Classes tree?
Thanks,
Anthony
Similar Messages
-
Scheduled job throws Class Not Found error when executing Java class
Hi,
I have written a java class to carry out a file upload to an external site and put the class on our server.
I also wrote a script to call this java class, passing inthe relevant parameters.
If i call the script using the ./ syntax from SSH it runs file logged in as Root and Oracle.
I the setup a scheduled job to call this script but the job fails with the error...
STANDARD_ERROR="Exception in thread "main" java.lang.NoClassDefFoundError: HttpsFileUpload Caused by: java.lang.ClassNotFoundException: HttpsFileUpload at java.net.URLClassLoader$1.run(URLClassLoader.java:"I cannot understand why it is raising the error if it runs from SSH.
O/S = Red Hat Enterprise Linux ES, oracle version = 10.2.0.1.0
Any help or guidance would be appreciated
Thank you in advance
Graham.
Edited by: gpc on Feb 4, 2009 12:46 PMHi,
See this link for some tips if you haven't yet :
Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
I can think of two things. Your script may not be able to run as the nobody user (by default external jobs run as the nobody user). Or your script might require that some environment variable be set (by default environment variables are not set in external jobs).
Maybe you need to set the CLASSPATH variable in your script before calling java ?
Hope this helps,
Ravi. -
No Class found error in client java proxy
Hi guys,
I have configured a java proxy and I'm calling that proxy in a stand alone java program. I'm getting the below error when I execute the program.
If any one can provide any inputs on the issue it'be great..
Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/aii/utilxi/sld/XIEntityInSld
at com.sap.aii.proxy.xiruntime.core.XmlSystemAccess.getProperties(XmlSystemAccess.java:679)
at com.sap.aii.proxy.xiruntime.core.XmlSystemAccess.getProperty(XmlSystemAccess.java:709)
at com.sap.aii.proxy.xiruntime.core.XmlSystemAccess.initLogging(XmlSystemAccess.java:471)
at com.sap.aii.proxy.xiruntime.core.XmlProxy.send(XmlProxy.java:79)
at com.sap.aii.proxy.xiruntime.core.AbstractProxy$XmlProxyHelper.send(AbstractProxy.java:181)
at com.sap.aii.proxy.xiruntime.core.AbstractProxy.send$(AbstractProxy.java:142)
at com.unilever.aa.xproc.procComm.file.kalido.MIKalidoTestOutAs_PortType.mIKalidoTestOutAs(MIKalidoTestOutAs_PortType.java:18)
at com.bcone.FTP.TestFTPClient.main(TestFTPClient.java:60)Try following libs:
From XI:
aii_adapter_xi_svc.jar, aii_af_cci.jar, aii_af_cpa.jar, aii_af_mp.jar,
aii_af_ms_api.jar, aii_af_ms_spi.jar,
aii_af_service_message_security.jar
From the J2EE client JARs: (/usr/sap/<SID>/JC00/j2ee/j2eeclient/signed):
ejb20.jar, exception.jar, guidgenerator.jar, jARM.jar, jperflib.jar,
jta.jar, log_api.jar, logging.jar, sapj2eeclient.jar, sapni.jar,
sapxmltoolkit.jar
See also this guide:
SAP on DB2 for Linux, UNIX, and Windows
Regards
Stefan -
Error Invoking Java class from Stored proc
We are getting this error while calling a stored procedure that invokes a
static function of a java class from inside Oracle 8.1.7.
ORA-29516: Aurora assertion failure: Java thread deadlock detected
ORA-06512: at "APPS.SERVICECONSUMERINVOKE", line 0
ORA-06512: at line 40
In a Toad SQL Window, when I execute the stored procedure that invokes the
java function, it executes successfully on the first attempt. When I try to
execute it again on the same SQL Window, it gives the above error. The java
class is part of a package and indirectly makes a JMS request-reply call
via other helper classes.
The same package works fine from other web containers and
unlike the Oracle JVM Aurora, the JVMs don't detect a deadlock.
Why does the Aurora throw an error?Did you try issusing a commit and then trying again in Toad SQL Window?
The advice is to contact support:
ORA-29516: Aurora assertion failure: string
Cause: An internal error occurred in the Aurora module.
Action: Contact Oracle Worldwide Support. -
PI 7.1 Enhancement pack 8: still error when referencing java class in xslt
Hi
I am getting an error in PI 7.1 EP 8 Repository when I try to use an xslt in which I make a reference to a java class. The error is:
Transformer Configuration Exception occurred when loading XSLT XCBL_invoice_stylesheet.xsl; details: Could not compile stylesheet
I use this xslt:
<xsl:template match="/" xmlns:util="dk.dongenergy.pi.mapping.Utilities_datetime">
<html>
<B><xsl:text>Received: </xsl:text><xsl:value-of select="util:getCurrentDateTimeFormatted()"/>
I have imported the java archive successfully and it is working in XI 3.0 and it is working if I comment out the reference to the java class in the xslt.
the java class looks like this:
package dk.dongenergy.pi.mapping;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Utilities_datetime {
* public static String getCurrentDateTimeFormatted() {*
* Date now = new Date();*
* SimpleDateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss");*
* return formatter.format(now);*
We have applied enhancement pack 8 on PI 7.1 as suggewsted in this note, but that has not done the trick:
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_xi/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31333235363833%7d
Any suggestions?
BR
MikaelHi Raj
That gives me this error log:
<br/>
<br/>
javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:100) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy1104.execute(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rmi_p4.P4DynamicSkeleton.dispatch(P4DynamicSkeleton.java:234) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:355) at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67) at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41) at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977) at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57) at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55) at com.sap.engine.core.thread.execution.Executable.run(Executable.java:109) at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:314) Caused by: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: Bad version number in .class file ... 33 more Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:664) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at com.sap.aii.ib.server.mapping.execution.MappingLoader.findClass(MappingLoader.java:184) at java.lang.ClassLoader.loadClass(ClassLoader.java:350) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33) at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:63) at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:99) at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43) at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51) at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:77) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:249) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:273) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:470) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:438) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:395) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:397) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:239) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:54) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:139) at com.sap.aii.ibrep.server.mapping.exec.ExecuteIfMapCommand.execute(ExecuteIfMapCommand.java:33) at com.sap.aii.ib.server.mapping.exec.CommandManager.execute(CommandManager.java:43) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:40) at com.sap.aii.ibrep.server.mapping.MapServiceBean.execute(MapServiceBean.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:46) ... 32 more
Edited by: mikael lund on Oct 26, 2009 10:51 AM -
I have Flex running on Tomcat with LCDS. On tomcat there is a JAR that has classes I'd like to use/interact with from Flex. In the simple LCDS examples they demonstrate having a Product.java class and a matching Product.as class, but the java library I am trying to use has many more classes and would take a long time to copy into Actionscript.
What is the best way to interact with the Java classes (I don't have a web service to use like in the LCDS example).I only know we can use JNI to invoke native libraries
from Java and I have never used JNI to invoke Java
libraries from native applications (C/C++ programs).
I am going to look through the tutorial you
recommended.The last tutorial. I've only fiddled with it, as it was a bitch. If you don't need to use Suns JVM, I recomend using CNI & GCJ [ http://gcc.gnu.org/java/ ], as it is much neater.
Do you mean JNI is internally implemented by C++s
Runtime.exec method?Write a small Java application which invokes the lib you want, i.e. say you want to use Strings replaceAll method (simple example I know)
class Test {
pubilc static void main( String args[] ) {
System.out.println( args[0].replaceAll( args[1], args[2] ) ) ;
}Then use c++ program to run "/path/to/java Test tast a e" . -
Invoke Java library from C/C++
Hello everyone,
Are there any approaches to invoke Java libraries from C/C++?
Thanks in advance,
GeorgeI only know we can use JNI to invoke native libraries
from Java and I have never used JNI to invoke Java
libraries from native applications (C/C++ programs).
I am going to look through the tutorial you
recommended.The last tutorial. I've only fiddled with it, as it was a bitch. If you don't need to use Suns JVM, I recomend using CNI & GCJ [ http://gcc.gnu.org/java/ ], as it is much neater.
Do you mean JNI is internally implemented by C++s
Runtime.exec method?Write a small Java application which invokes the lib you want, i.e. say you want to use Strings replaceAll method (simple example I know)
class Test {
pubilc static void main( String args[] ) {
System.out.println( args[0].replaceAll( args[1], args[2] ) ) ;
}Then use c++ program to run "/path/to/java Test tast a e" . -
Operation not found error while calling AM methods from managed bean
Hi,
operation not found error while calling AM methods from managed bean.
written a method with two parameters in AM.
exposed the method in AM client interface
in the page bindings added the method in method action ..left empty in the value fields of the parameters.
calling the method from managed bean like below
String userNameVal = (String)userName.getValue();
String passwordVal = (String)password.getValue();
OperationBinding operationBinding =
ADFUtils.findOperation("verifyLogin");
operationBinding.getParamsMap().put("userName",userNameVal);
operationBinding.getParamsMap().put("password",passwordVal);
operationBinding.execute();
i am getting operation verifyLogin not found error.Please suggest me something to do.
Thanks
SatyaHi vlsn,
Can you try with the below code
// in your backing bean
OperationBinding operation = bindings.getOperationBinding("verifyLogin");
//Put your both parameters here
operation.getParamsMap().put("parameter_name1", parameterValue1);
operation.getParamsMap().put("parameter_name2", parameterValue2);
operation.execute();
if (operation.getResult() != null) {
Boolean result = (Boolean) operation.getResult();
and share the result.
regards,
Rajan -
Invoking java methods from C/C++ on the machine with different JREs
I implemented Windows NT Service instantiating JVM and invoking several java methods. Everything works but I have an issue with running the service on the machine where multiple different versions of JRE have been installed. The service is calling java methods that require JRE 1.3 or later so I wrote the code that is setting system PATH from within the service based on the configuration stored in the external file. The problem is that the service requires jvm.dll to be in the PATH prior lunching it since this library is instantiated through the implicit linking. When I put jvm.dll in the same path as the service binary I can lunch it but JNI_CreateJavaVM fails and returns -1. This happens even if JRE 1.3 is in the system PATH prior lunching the service.
Everything works if the system PATH contains references to JRE 1.3 and jvm.dll is removed from the service's directory.
I am looking for an advice on what is the proper way to deal with invoking java methods from the C/C++ executable in the environment with different versions of JRE.
Thanks, Kris.Here's a way I have done what you are asking about:
What you want to do is make all of your linking happen at runtime, rather than at compile time. This way, you can edit the PATH variable before the jvm.dll gets loaded.
Following is some code that I used to handle a dll of my own in this manner. You can decide if you want to write a "wrapper" dll, or if you find it simpler to approach the jvm.dll in this way.
// Define pointer type for DLL entry point.
typedef void JREPDLL_API (*EXECUTEREQUEST)(char*, Arguments&);
// Set up path, load dll, and pass everything off to it.
HINSTANCE javaServer = javaServer = LoadLibrary("jrepdll.dll");
if (javaServer != NULL) {
EXECUTEREQUEST executeRequest = (EXECUTEREQUEST)GetProcAddress(javaServer, "ExecuteRequest");
if (executeRequest != NULL) {
if (argc == 1)
// Execute the request.
executeRequest("-run", args);
else
// Execute the request.
executeRequest("-console", args);
Here's some code for how to edit the PATH:
// Edit the PATH environment variable so that we use our private java.
char *appendPt;
char *newPath;
char *path;
char tmp[_MAX_PATH];
// Get the current PATH variable setting.
path = getenv("PATH");
// Allocate space for an edited path setting.
if (path != NULL)
newPath = (char*)malloc((_MAX_PATH * 2) + strlen(path));
else
newPath = (char*)malloc((_MAX_PATH * 2));
// Get upper part of path to desired directories.
strcpy(tmp, filepath);
appendPt = strstr(tmp, "dbin\\jreplicator");
appendPt[0] = '\0';
sprintf(newPath, "PATH=%sjava\\jre1.2.2\\bin;%sjava\\jre1.2.2\\bin\\classic", tmp, tmp);
// Append the value of the existing PATH environment variable.
// If there is anything, append it.
if (path != NULL) {
strcat(newPath, ";");
strncat(newPath, path, (sizeof(newPath) - strlen(newPath) - 2));
// Set new PATH value.
_putenv(newPath);
free(newPath); -
How to invoke java application from ABAP
How to invoke java application from ABAP ? Suppose I needto execute a EJB wihic is running on my SAP J2EE Enigne from an ABAP Program .
Thanks,
ManishHi Manish,
did you get some further documents concerning "abap program calls ejb"?
If yes, could you please send me some informations.
Thank you for your help.
Kind regards, Patrick. -
How to reference multiple instances of the same Java object from PL/SQL?
Dear all,
I'm experimenting with calling Java from PL/SQL.
My simple attempts work, which is calling public static [java] methods through PL/SQL wrappers from SQL (and PL/SQL). (See my example code below).
However it is the limitation of the public static methods that puzzels me.
I would like to do the following:
- from PL/SQL (in essence it needs to become a forms app) create one or more objects in the java realm
- from PL/SQL alter properties of a java object
- from PL/SQL call methods on a java object
However I fail to see how I can create multiple instances of an object and reference one particular object in the java realm through public static methods.
My current solution is the singleton pattern: of said java object I have only 1 copy, so I do not need to know a reference to it.
I can just assume that there will only ever be 1 of said object.
But I should be able to make more then 1 instance of an object.
To make it more specific:
- suppose I have the object car in the java realm
- from PL/SQL I want to create a car in the java realm
- from PL/SQL I need to give it license plates
- I need to start the engine of a scpecific car
However if I want more then 1 car then I need to be able to refrence them. How is this done?
Somehow I need to be able to execute the following in PL/SQL:
DECLARE
vMyCar_Porsche CAR;
vMyCar_Fiat CAR;
BEGIN
vMyCar_Porsche = new CAR();
vMyCar_Fiat = new CAR();
vMyCar_Porsche.setLicensePlates('FAST');
vMyCar_Porsche.startEngine();
vMyCar_Fiat.killEngine();
END;
Thanks in advance.
Best Regards,
Ruben
My current example code is the following:
JAVA:
===
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED CODAROUL."RMG/BO/RMG_OBJECT" as package RMG.BO;
public class RMG_OBJECT {
private static RMG_OBJECT instance = new RMGOBJECT();
private String rmgObjectNaam;
private RMG_OBJECT(){
this.rmgObjectNaam = "NonDetermined";
public static String GET_RMGOBJECT_NAAM () {
String toestand = null;
if (_instance == null) {toestand = "DOES NOT EXIST";} else { toestand = "EXISTS";};
System.out.println("instance : " + toestand);
System.out.println("object name is : " + _instance.rmgObjectNaam);
return _instance.rmgObjectNaam;
public static Integer SET_RMGOBJECT_NAAM (String IN)
try
_instance.rmgObjectNaam = IN;
return 1;
catch (Exception e)//catch
System.out.println("Other Exception: " + e.toString());
e.printStackTrace();
return 5;
} //catch
PL/SQL Wrapper:
==========
CREATE OR REPLACE FUNCTION CODAROUL.SET_RMGOBJECT_NAAM(NAAM IN VARCHAR2) return NUMBER AS
LANGUAGE JAVA NAME 'RMG.BO.RMG_OBJECT.SET_RMGOBJECT_NAAM (java.lang.String) return java.lang.Integer';
Calling from SQL:
==========
CALL dbms_java.set_output(2000);
select CODAROUL.GET_RMGOBJECT_NAAM() from dual;
Edited by: RubenS_BE on Apr 6, 2012 5:35 AM
Edited by: 925945 on Apr 6, 2012 5:41 AMYou can do this by manually creating a new iterator binding in your binding tab.
So instead of dragging the VO directly to the page, go to the binding tab, add a new executable iterator binding, and point to that one from your ELs in the page itself. -
Invoking Web Service From PL SQL package
Below is the sample code to invoke web service from pl/sql package using UTL_HTTP:
Declare
http_req UTL_HTTP.req;
http_resp UTL_HTTP.resp;
Begin
http_req :=
UTL_HTTP.begin_request
'http://'
|| lv_hosturl
-- || '.net/soa-infra/services/finance_rt/Payments/paymentsprocess_client_ep',
--new url
|| '.net/soa-infra/services/finance_rt/PaymentsReq/paymentsprocess_client_ep?WSDL',
'POST',
'HTTP/1.1'
UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml');
-- since we are dealing with plain text in XML documents
UTL_HTTP.set_header (http_req,
'Content-Length',
LENGTH (lv_soap_request)
UTL_HTTP.set_header (http_req, 'SOAPAction', '');
-- required to specify this is a SOAP communication
UTL_HTTP.write_text (http_req, lv_soap_request);
http_resp := UTL_HTTP.get_response (http_req);
UTL_HTTP.read_text (http_resp, lv_soap_respond);
UTL_HTTP.end_response (http_resp);
resp := XMLTYPE.createxml (lv_soap_respond);
End;Hi,
there are a lot of option to make plsql web services .
First you can stay with jdev 10.1.3
Use the xmldb servlets
use jdev 11g tp4 to create plsql ws and upgrade to jdev 11g production
And I think in the next release of jdev it will be back , there are more options which disappeared like the adf bc sdo ws or jmx datacontrol etc.
thanks Edwin -
Calling java program from PL/SQL code
Dear,
How to develop and call a java program from PL/SQL code?
What about if this program will call other java programs?Perhaps the Java Developer's Guide would be a good place to start
http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/toc.htm
Justin -
How to invoke Java class from post.POST.jsp
Hi All,
I am trying to invoke a simple java method from post.POST.jsp
I am getting below exception while doing it.
org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 32 in the jsp file: /apps/mywebsite/components/customFormAction/post.POST.jsp
The method test() is undefined for the type DatasourceUtil
29:
30: ///
31: com.day.test.datasource.DatasourceUtil dsUtil = new com.day.test.datasource.DatasourceUtilImpl();
32: dsUtil.test();
33: //dsUtil.validateLogin(request.getParameter("username"), request.getParameter("password"));
34:
35: ////
It appears to resolve the class correctly. I could run the code, if I only comment dsUtil.test();. As soon as I uncomment, it gives above error.
In the Utill I have a simple void method which will print a simple text. My package structure is as follows.
any help will be great
Tx1. In the interface [1] not the implementation[2] have u defined the method test?
2. If it is implemented, Change the bundle version in bnd file and make a new build. Then from felix console verify the latest version reflected in the bundles.
If 2 works & you are going to make lot of frequent changes then give the version as snapshot till it get stable.
[1] com.day.test.datasource.DatasourceUtil
[2] com.day.test.datasource.DatasourceUtilImpl -
Error when using java class in php
dear all
when i am using my java class in php page
i am getting below error
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:e24PaymentPipe]]->performPaymentInitialization. Cause: java.lang.NullPointerException Responsible VM: 1.6.0_01@http://java.sun.com/" at: #-9 e24PaymentPipe.performPaymentInitialization(e24PaymentPipe.java:341) #-8 sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) #0 [internal function]: Java->__call('performPaymentI...', Array) #1 /home/comhtdocs/hdfcpay/HostedPaymentBuy.php(31): Java->performPaymentInitialization() #2 {main}] thrown in /home/comhtdocs/hdfcpay/HostedPaymentBuy.php on line 31
Edited by: arun240 on Jul 25, 2008 8:47 AMarun240 wrote:
dear all
when i am using my java class in php page
i am getting below error
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:e24PaymentPipe]]->performPaymentInitialization. Cause: java.lang.NullPointerException Responsible VM: 1.6.0_01@http://java.sun.com/" at: #-9 e24PaymentPipe.performPaymentInitialization(e24PaymentPipe.java:341) #-8 sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) #0 [internal function]: Java->__call('performPaymentI...', Array) #1 /home/comhtdocs/hdfcpay/HostedPaymentBuy.php(31): Java->performPaymentInitialization() #2 {main}] thrown in /home/comhtdocs/hdfcpay/HostedPaymentBuy.php on line 31
Edited by: arun240 on Jul 25, 2008 8:47 AMWell, it seems there's an object (perhaps a PaymentPipe?) pointing to null which you're trying to invoke a method (performPaymentInitialization()?) on. Needles to say: you can do that.
SomeObject so = null;
// ... some more code ...
so.someMethod(); // No can do! A NPE will be thrown!
Maybe you are looking for
-
started to run recovery disc assistant on a backup hard drve-stopped when it said it would erase all data-but now can't inialize the external drive nor repair it with disc utility. what to do?
-
The only time I can listen to music is through my Bluetooth. The external speakers don't work on my 4s. I have to start playing the song and in the lower right hand corner of iTunes it give me the option to switch between my Bluetooth or Dock Connect
-
RMCVNEUF....billing document not updating
The business recently made a change to the Item Categories that update LIS/SIS. They want us to load all historical documents with this Item Category to our SIS structures and DW. There was a change made to RMCVNEUF to allow for us to search all bill
-
New Macbook Pro without imovie, iphoto...
I just got a new macbook pro but i looked everywhere and cannot find the imovie, iphoto and all the other i's! where do i download it? here is it? thank in advance
-
How can I join a Vista workgroup with Leopard?
Hi there - I need help to join my leopard (bought today) to a Vista home workgroup. Thanks