Java Shared Classes Article
Java applications face a problem today: The only containment vessel available to them is the Java virtual machine (JVM) process itself. Multiple JVMs are required to isolate Java applications from each other, and this has two major negative impacts: start up time and memory. This article discusses the concepts behind shared classes in JVMs, how they work, and how this technology could potentially be exploited by users.
http://www-106.ibm.com/developerworks/java/library/j-shared/?ca=dgr-jw03j-shared
And I would guess that the alias powelljgr exists solely to promote "articles".
Similar Messages
-
Code Sample: Easy RFC Lookup From XSLT Mappings Using a Java Helper Class
Hi everyone,
This is just a shameless plug for my article: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14">Easy RFC Lookup From XSLT Mappings Using a Java Helper Class</a>. I hope you're interested in reading it, and I welcome your comments in this thread.
Kind regards,
ThorstenHi Stefan. Thanks for your post. I have already done that. It still does not work. As a base for my java helper class I have usesd Thorstens code.
The problem is quite confusing. I will try to ouline both issues here.
First of all, when try to test from within the Operation Mapping, I always get a java error saying it cannot find the communication channel (it is there and working because I have tested it with the RFCLookup in graphical mapping). I have found a way to work around this, and that is to uncheck the "Use SAP XMLToolkit" checkbox --> switch to test tab, enter my ReceiverService in the parameter tab (header parameter) --> switch back to Definition tab, check the "Use SAP XMLToolkit" checkbox --> switch to Test tab and run the test. Then the XSLT and call to java helper class will work. Of course this is not really something you want to do all the time. Maybe there is a bug.
Secondly, it never works when I try to do it "live". I am using a file adapter to pick up one file, convert it and a file adapter to drop the converted file. I get the following error code in SXMB_MONI.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- Request Message Mapping -->
<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">TRANSFORMER_CONF_EX</SAP:Code>
<SAP:P1>ATJ_Accounting2XML_Accounting.xsl</SAP:P1>
<SAP:P2>http://rd.accounting.logica.com</SAP:P2>
<SAP:P3>fd552c30-bad9-11dd-9761-c21dac1b818c</SAP:P3>
<SAP:P4>-1</SAP:P4>
<SAP:AdditionalText />
<SAP:Stack>TransformerConfigurationException triggered while loading XSLT mapping ATJ_Accounting2XML_Accounting.xsl; http://rd.accounting.logica.comfd552c30-bad9-11dd-9761-c21dac1b818c-1</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Using an XSLT without a call to a java helper class, works just fine.
I am totally at a loss here. Any more input would be much appreciated.
/Patrik -
Java Class not apearing in Java Algorithm Class Search
Hi,
I installed oracle CC&B 2.3.1, with SDK 2.2.0.12. I am trying to create new java class by copying an exiting one and modifying it to be used with algorithm (Adhoc Char Value Validation).
Steps are as follows:
1-Created file by copying the exiting file AdhocNumericValidationAlgComp_Impl.java and only changing the name of the class:
public class AK_AdhocNumericValidationAlgComp_Impl
extends AK_AdhocNumericValidationAlgComp_Gen
File location :
C:\spl\CCB23DEV\java\source\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Impl.java
2-Run Artificat generator successfully , which generated the files:
C:\spl\CCB23DEV\java\sourcegen\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp.java
C:\spl\CCB23DEV\java\sourcegen\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Gen.java
C:\spl\CCB23DEV\java\target\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp.class
C:\spl\CCB23DEV\java\target\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Gen.class
C:\spl\CCB23DEV\java\target\cm\com\splwg\base\domain\common\characteristicType\AK_AdhocNumericValidationAlgComp_Impl.class
Still the class is not appearing in "Java Algorithm Class Search" when trying to add a new algorithm type referencing this java class.
I tried restarting the Tomcat application server, still not appearing.
Where did I go wrong about it?
ThanksTomcat was down when I deployed the changes. It seems tomcat cannot find implemented interface AdhocCharacteristicValueValidationAlgorithmSpot
The full error shows how tomcat is looking for the interface:
Full error:
- 2011-07-07 12:34:28,681 [main] ERROR (support.context.ContextFactory) Cannot find algorithm spot: 'com.splwg.base.domain.common.characteristicType.AdhocCharacteristicValueValidationAlgorithmSpot' for Cobol extension
com.splwg.shared.common.LoggedException: Cannot find algorithm spot: 'com.splwg.base.domain.common.characteristicType.AdhocCharacteristicValueValidationAlgorithmSpot' for Cobol extension
at com.splwg.shared.common.LoggedException.raised(LoggedException.java:65)
at com.splwg.base.support.context.ContextFactory.extendAlgorithmSpots(ContextFactory.java:291)
at com.splwg.base.support.context.ContextFactory.loadManagedObjectForApplication(ContextFactory.java:203)
at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:106)
at com.splwg.base.support.context.ContextFactory.buildContext(ContextFactory.java:90)
at com.splwg.base.support.context.ContextFactory.createDefaultContext(ContextFactory.java:498)
at com.splwg.base.web.startup.SPLWebStartup.initializeApplicationContext(SPLWebStartup.java:178)
at com.splwg.base.web.startup.SPLWebStartup.contextInitialized(SPLWebStartup.java:63)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
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:592)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
- 2011-07-07 12:34:28,713 [main] INFO (web.startup.SPLWebStartup) Shutting Down the JMX Connectors...
- 2011-07-07 12:34:28,713 [main] INFO (web.startup.SPLWebStartup) JMX Connectors shutdown successfully
- 2011-07-07 12:34:28,713 [main] INFO (web.startup.SPLWebStartup) Shutting Down the Application Context...
- 2011-07-07 12:34:28,728 [main] INFO (web.startup.SPLWebStartup) Application Context shutdown successfully
Any advise ?
Thanks -
EJB Class loader and regular Java files class loader.
Hi,
Is the EJB's class loader the same as a "regular" java files class loader OR weblogic
has 2 class loaders, one for each???
Thanks,
les.les <[email protected]> wrote:
Hi,
Is the EJB's class loader the same as a "regular" java files class loader OR weblogic
has 2 class loaders, one for each???Yes. Exact classloading architecture depends on which WebLogic version you use. If you
use 6.x+, you may want to read this article:
http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
Thanks,
les.--
Dimitri -
Client consuming multiple webservices that have shared classes
My Java client application is accessing two webservices (ServiceA and ServiceB). Both of these webservices us a shared class (CoolRect). I use wscompile to generate stub files for these webservices. When I try to use CoolRect, it gives an "ambiguous" error. Basically I must declare my CoolRect like:
ServiceA.CoolRect rectA;
ServiceB.CoolRect rectB;
The problem is that I cannot assign one to the other:
rectA = serviceA.getCoolRect();
rectB = rectA;
This generates an "incompatible types" error. These are identical classes from common source base used by the webservices. Is there some way to get wscompile to generate stubs so this isn't a problem? All solutions appreciated. ThanksHi Javier...
Thanks for helping out, though I didn't see any change after applying the configs you suggested.
The changed config contains the following:
access-list local_redistribute_out standard permit 172.31.255.0 255.255.255.0
route-map local_redistribute_out permit 10
match ip address local_redistribute_out
router ospf 1000
router-id 192.168.210.1
network 10.21.0.0 255.255.0.0 area 1
network 192.168.210.0 255.255.255.252 area 0
area 1
log-adj-changes
redistribute static subnets route-map local_redistribute_out
crypto dynamic-map VPN_SOFTWARE_CLIENT 10 set transform-set ESP-AES-256-SHA
crypto dynamic-map VPN_SOFTWARE_CLIENT 10 set security-association lifetime seconds 288000
crypto dynamic-map VPN_SOFTWARE_CLIENT 10 set reverse-route
crypto map EXTERNAL_MAP 1 ipsec-isakmp dynamic VPN_SOFTWARE_CLIENT
I can confirm the following:
ASA# ping 10.21.9.42
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.21.9.42, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
After doing the capture, the show capture capin indicated 0 packets captured, 0 packets shown.
My pertinent local routing table entries contain:
$ netstat -rn |grep utun0
default utun0 UCSI 2 0 utun0
10.21/16 172.31.255.7 UGSc 0 13 utun0
172.31.255.7 172.31.255.7 UH 3 0 utun0
172.31.255.255 utun0 UHW3Ii 0 56 utun0 12
192.168.210 172.31.255.7 UGSc 1 11 utun0
216.185.64.6 utun0 UHW3Ii 0 586 utun0 140
I hope you see something in here that can help.
Thanks.
Ken. -
XSLT mapping with Java helper classes
Hi,
I'm trying to implement a XSLT mapping to convert my request to a specific soap request message format for this I'm calling some methods from a java helper class. I have imported the jar file into the archives. When I tried to test the interface it keeps complaing there is some exception but doesn't give me the exact error. Has any one called any java helper classes with in XSLT mapping, if so I would appreciate if you could help me with this. Here is the code from xsl.
<wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" xmlns:UserToken="java:com.company.test.mapping.UserTokenMap">
<wsse:UsernameToken>
<wsse:Username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getUsername()"/>
</wsse:Username>
<wsse:Password wsse:Type="wsse:PasswordDigest" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getPasswordDigest()"/>
</wsse:Password>
<wsse:Nonce xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getNonce()"/>
</wsse:Nonce>
<wsu:Created xsi:type="soapenc:string" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getCreateDate()"/>
</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
Thanks,
JoeHi,
I'm getting following exception when I refer to the java class with in my XSLT mapping. Any one encountered the same problem.
com.sap.engine.services.ejb.exceptions.BaseRemoteException:
Exception in method transform.
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:218)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native
Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.lang.UnsupportedClassVersionError:
com/earthlink/xi/mapping/UserTokenMap (Unsupported
major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native
Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33)
at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:69)
at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98)
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:76)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272)
at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463)
at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431)
at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394)
at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398)
at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240)
at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150)
at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81)
at com.sap.aii.ibrep.server.mapping.ibrun.RepSequenceMapping.execute(RepSequenceMapping.java:54)
at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80)
at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:167)
... 10 more
; nested exception is:
java.lang.UnsupportedClassVersionError:
com/earthlink/xi/mapping/UserTokenMap (Unsupported
major.minor version 49.0) -
Is there a Java utility class to help with data management in a desktop UI?
Is there a Java utility class to help with data management in a desktop UI?
I am writing a UI to configure a network device that will be connected to the serial port of the computer while it is being configured. There is no web server or database for my application. The UI has a large number of fields (50+) spread across 16 tabs. I will write the UI in Java FX. It should run inside the browser when launched, and issue commands to the network device through the serial port. A UI has several input fields spread across tabs and one single Submit button. If a field is edited, and the submit button clicked, it issues a command and sends the new datum to the device, retrieves current value and any errors. so if input field has bad data, it is indicated for example, the field has a red border.
Is there a standard design pattern or Java utility class to accomplish the frequently encountered, 'generic' parts of this scenario? lazy loading, submitting only what fields changed, displaying what fields have errors etc. (I dont want to reinvent the wheel if it is already there). Otherwise I can write such a class and share it back here if it is useful.
someone recommended JGoodies Bindings for Swing - will this work well and in FX?Many thanks for the reply.
In the servlet create an Arraylist and in th efor
loop put the insances of the csqabean in this
ArrayList. Exit the for loop and then add the
ArrayList as an attribute to the session.I am making the use of Vector and did the same thing as u mentioned.I am using scriplets...
>
In the jsp retrieve the array list from the session
and in a for loop step through the ArrayList
retrieving each CourseSectionQABean and displaying.
You can do this in a scriptlet but should also check
out the jstl tags.I am able to remove this problem.Thanks again for the suggestion.
AS -
How can i execute Spaces API in java main class?
Hi
I am able to execute Spaces API through portal application. However if i try to execute it in java main class, its throwing an exception
"SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)"
oracle.wsm.common.sdk.WSMException: WSM-00145 : Keystore location or path can not be null or empty; it must be configured through JPS configuration or policy configuration override.
How can i set this path, so that i can execute Spaces API from java main class.
Need this main class to configure in cron job, to schedule a task.
Regards
RajHi Daniel
Currently i have implemented create functionality in my portal application using Spaces API, which is working fine. Now the requirement is, i need to implement a "Cron Job" to schedule a task, which will execute to create space(for example once in a week). Cron job will execute only the main method. So I have created java main class, in which I have used Spaces API to perform create space operation. Then it was giving exception.
Later I understood the reason, as I am executing the Space API with a simple JSE client, its failing since a simple java program has no idea of default-keystore.jks, jps-config.xml, Security Policy. Hence i have included those details in main class. Now I am getting new error,
SEVERE: WSM-06303 The method "registerListener" was not called with required permission "oracle.wsm.policyaccess"
For your reference i have attached the code below, please help. How can i use Spaces API in java main method(i mean public static void main(String[] args) by giving all required information.
public static void main(String[] args) throws InstantiationException,
GroupSpaceWSException,
SpacesException {
Class2 class2 = new Class2();
GroupSpaceWSContext context = new GroupSpaceWSContext();
FactoryFinder.init(null);
context.setEndPoint("http://10.161.226.30/webcenter/SpacesWebService");
context.setSamlIssuerName("www.oracle.com");
context.setRecipientKeyAlias("orakey");
Properties systemProps = System.getProperties();
systemProps.put("java.security.policy","oracle/wss11_saml_or_username_token_with_message_protection_client_policy");
systemProps.put("javax.net.ssl.trustStore","C:\\Oracle\\Middleware11.1.7\\wlserver_10.3\\server\\lib\\cacerts.jks");
systemProps.put("oracle.security.jps.config","C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
systemProps.put("javax.net.ssl.keyStore",C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\consumer.jks");
systemProps.put("javax.net.ssl.keyStorePassword", "Test12");
System.setProperties(systemProps);
GroupSpaceWSClient groupSpaceWSClient;
try {
groupSpaceWSClient = new GroupSpaceWSClient(context);
System.out.println("URL: " +
groupSpaceWSClient.getWebCenterSpacesURL());
//delete the Space
List<String> groupSpaces = groupSpaceWSClient.getGroupSpaces(null);
System.out.println("GroupSpaces:: " + groupSpaces.size());
} catch (Exception e) {
Regards
Raj -
Error: could not be converted to [class java.lang.Class].
I am newbie to JDeveloper (10.1.2) on winxp and i was trying to setup the example from the following url http://radio.weblogs.com/0129487/2003/09/19.html
It is a how to on "Executing Toplink Queries using JavaBean DataControl "
Any help would be greatly appreciated.
Near the bottom on step "In StrutsPageFlow diagram, select allEmpsDA Data Action, right mouse and chooe Run" i get a the following runtime errors:
Validation Error
You must correct the following error(s) before proceeding:
JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.toplink.exceptions.ConversionException, msg= Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees
JBO-29000: Unexpected exception caught: oracle.toplink.exceptions.ConversionException, msg= Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.Employees
Exception Description: The object [mypackage.Employees], of class [class java.lang.String], could not be converted to [class java.lang.Class]. Please ensure that the class [class java.lang.Class] is on the CLASSPATH. You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager Internal Exception: java.lang.ClassNotFoundException: mypackage.EmployeesThis error is happening on a read.
Here is the mapping descriptor:
<database-mapping>
<attribute-name>SuppItemCollection</attribute-name>
<read-only>false</read-only>
<reference-class>package.SuppItem</reference-class>
<is-private-owned>false</is-private-owned>
<uses-batch-reading>false</uses-batch-reading>
<indirection-policy>
<mapping-indirection-policy>
<type>oracle.toplink.internal.indirection.NoIndirectionPolicy</type>
</mapping-indirection-policy>
</indirection-policy>
<container-policy>
<mapping-container-policy>
<container-class>java.util.Vector</container-class>
<type>oracle.toplink.internal.queryframework.ListContainerPolicy</type>
</mapping-container-policy>
</container-policy>
<source-key-fields>
<field>SUPP.REQ_NUM</field>
</source-key-fields>
<target-foreign-key-fields>
<field>SUPP_ITEM.REQ_NUM</field>
</target-foreign-key-fields>
<type>oracle.toplink.mappings.OneToManyMapping</type>
</database-mapping>
Object model has a Supp class that has a collection of SuppItem(s). I was allowing the Mapping Workbench to create the Java Source. I'm not to fond of that, but I thought it would be easiest to get things going.
The datamodel is similiar to the class model.
Thanks for the help,
Mike -
XSLT Mapping : RFC Lookup using java helper class
Hi All,
I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
Can anybody help me with step by step approach for the same?
My basic questions are not answered in the blog as:
1) where to add the jar file of the java class used in xslt mapping.
I have added zip file of XSLT mapping in imported archived and using that in mapping.
Thanks in advace.
Regards,
RohanHi,
Can u please have look at this in detail , u can easily point out yourself the problem...
http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
Please observe the line,
xmlns:javamap="java:com.company.group.MappingClass
in XSLT mapping..
The packagename of class and class name and XSLT namespace should be matching...
Babu
Edited by: hlbabu123 on Sep 29, 2010 6:04 PM -
Java Error in RFC Lookup in XSLT Mapping usinf Java helper class
Hi All,
I am doing RFC Lookup in XSLT Mapping using Java Helper class.
The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
Following is the code I have written in XSLT for the lookup:
<xsl:template name="Lookup_1">
<xsl:param name="STDPN"/>
<rfc:RFC_READ_TABLE>
<QUERY_TABLE>KNA1</QUERY_TABLE>
<OPTIONS><item><TEXT>
<xsl:value-of select="$STDPN"/>
</TEXT></item>
</OPTIONS>
<FIELDS>
<item>
<FIELDNAME>KUNNR</FIELDNAME>
</item>
</FIELDS>
</rfc:RFC_READ_TABLE>
</xsl:variable>
<xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
<xsl:element name="STDPN">
<xsl:value-of select="$response//DATA/item/WA"/>
</xsl:element>
</xsl:template>
<xsl:template name="Lookup_2">
<xsl:param name="BELNR"/>
<xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
<xsl:variable name="request1">
<rfc:RFC_READ_TABLE>
<QUERY_TABLE>ZTABLE</QUERY_TABLE>
<OPTIONS><item><TEXT>
<xsl:value-of select="$Query"/>
</TEXT></item>
</OPTIONS>
<FIELDS>
<item>
<FIELDNAME>KUNAG</FIELDNAME>
</item>
</FIELDS>
</rfc:RFC_READ_TABLE>
</xsl:variable>
<xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
<xsl:element name="BELNR">
<xsl:value-of select="$response1//DATA/item/WA"/>
</xsl:element>
</xsl:template>
My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
Thanks and Regards,
AtulHi Atul,
I had the same problem like you had.
The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
Source source = new DOMSource(request.item(0));
So I've created a workaround for this problem.
In the call of the template I've put the request as a parameter object at the template call:
<xsl:with-param name="req">
<rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<APPLICATION>Z001</APPLICATION>
<FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
<MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
<PLANT>FSD0</PLANT>
<VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
<BOMITEM_DATA/>
</rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
</xsl:with-param>
With this change the request will be provided as a String object and not as a NodeList object.
Afterwards the RfcLookup.java has to be changed to the following:
package com.franke.mappings;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.sap.aii.mapping.lookup.Channel;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.lookup.RfcAccessor;
import com.sap.aii.mapping.lookup.LookupService;
import com.sap.aii.mapping.lookup.XmlPayload;
* @author Thorsten Nordholm Søbirk, AppliCon A/S
* Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
* The class is generic in that it can be used to call any remote-enabled
* function module in R/3. Generation of the XML request document and parsing of
* the XML response is left to the stylesheet, where this can be done in a very
* natural manner.
* TD:
* Changed the class that request is sent as String, because of IndexOutOfBound-exception
* When sending multiple requests in one XSLT mapping.
public class RfcLookup {
* Execute RFC lookup.
* @param request RFC request - TD: changed to String
* @param service name of service
* @param channelName name of communication channel
* @param inputParam mapping parameters
* @return Node containing RFC response
public static Node execute( String request,
String service,
String channelName,
Map inputParam)
AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
Node responseNode = null;
try {
// Get channel and accessor
Channel channel = LookupService.getChannel(service, channelName);
RfcAccessor accessor = LookupService.getRfcAccessor(channel);
// Serialise request NodeList - TD: Not needed anymore as request is String
/*TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source source = new DOMSource(request.item(0));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamResult streamResult = new StreamResult(baos);
transformer.transform(source, streamResult);*/
// TD: Add xml header and remove linefeeds for the request string
request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", "");
// TD: Get byte Array from request String to send afterwards
byte[] requestBytes = request.getBytes();
// TD: Not used anymore as request is String
//byte[] requestBytes = baos.toByteArray();
trace.addDebugMessage("RFC Request: " + new String(requestBytes));
// Create input stream representing the function module request message
InputStream inputStream = new ByteArrayInputStream(requestBytes);
// Create XmlPayload
XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
// Execute lookup
XmlPayload responsePayload = accessor.call(requestPayload);
InputStream responseStream = responsePayload.getContent();
TeeInputStream tee = new TeeInputStream(responseStream);
// Create DOM tree for response
DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = docBuilder.parse(tee);
trace.addDebugMessage("RFC Response: " + tee.getStringContent());
responseNode = document.getFirstChild();
} catch (Throwable t) {
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
trace.addWarning(sw.toString());
return responseNode;
* Helper class which collects stream input while reading.
static class TeeInputStream extends InputStream {
private ByteArrayOutputStream baos;
private InputStream wrappedInputStream;
TeeInputStream(InputStream inputStream) {
baos = new ByteArrayOutputStream();
wrappedInputStream = inputStream;
* @return stream content as String
String getStringContent() {
return baos.toString();
/* (non-Javadoc)
* @see java.io.InputStream#read()
public int read() throws IOException {
int r = wrappedInputStream.read();
baos.write(r);
return r;
Then you need to compile and upload this class and it should work.
I hope that this helps you.
Best regards
Till -
Developer 10g error Java.Lang class not found
Hi
My application is live on static IP but when i try to access it from some systems i get the error after downloading Jinitiator
Java.lang class not found exception:Oracle forms engine main
is this problem of browser or something else? how can i solve
RegardsHi
My application is live on static IP but when i try
to access it from some systems i get the error after
downloading Jinitiator
ava.lang class not found exception:Oracle forms
engine main
is this problem of browser or something else? how can
i solve
RegardsSee the JInitiator "Proxies" configuration tab from the control panel, try checking the "Use Browser Settings" checkbox, that does the trick sometimes.
Tony -
Java.lang.class not found
Hi,
I configured scenario FILE TO JDBC, the sender channel is successful but in the receiving I am getting the error that java.lang.class not found.
In the receiver communication channel, I gave "com.microsoft.jdbc.sqlserverdriver".
what database connection parameters need to be given??
Thanks,
Satish.Whats your database ?
As Suresh said, did you deploy your JDBC driver ?
How to ?
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how to install and configure external drivers for jdbc and jms adapters.pdf
After configuring your communication channel, did you check the Adapter Monitor
XI SP > 09
http://<host>:5<sysnum>00/rwb -> Component Monitoring -> All Display -> Adapter Engine -> Adapter Monitor
XI SP <= 09
http://<host>:5<sysnum>00/AdapterFramework
Oracle Driver & Connection:
JDBC Driver: oracle.jdbc.driver.OracleDriver
Connection: jdbc:oracle:thin:@<hostname>:<port_umber>:<database_name>
SQL Server Driver & Connection:
JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
Connection = jdbc:microsoft:sqlserver://hostname:1433;DatabaseName=<DBName>
regards
Shravan -
Java.lang.Class- getFields() results in JVM crash when called through JNI
From a C++ application, I use Invocation APIs to create a JVM and call some Java methods using JNI
I get a crash in jvm.dll with EXCEPTION_ACCESS_VIOLATION
when I try to call "getFields" method of java.lang.Class in order to get the Fields of the java class
This method call, should return a java/lang/reflect/Fields[] on success
I am able to get the method ID of this method by using pEnv->GetMethodID(..)
However, when I call this method using CallObjectMethod(..), HotSpt JVM crashes with access violation with the dump given below.
Any clues on how to debug and find the problem?
Or has anyone tried getting the fields of a Java class from C++ by calling reflection APIs uing JNI?
Thanks in advance!
Sample code
jclass testerClass = pEnv->FindClass("com/test/Tester");
jmethodID cid = pEnv->GetMethodID(testerClass,"<init>","()V");
if(NULL == cid)
pEnv->ExceptionDescribe();
jobject testerObject = pEnv->NewObjectV(testerClass, mid);
jmethodID mid = pEnv->GetMethodID(testerClass, "getClass",
"()Ljava/lang/Class;");
jobject clsObj = (jobject)pEnv->CallObjectMethod(testerObject, mid);
pEnv->ExceptionDescribe();
jclass jCls = pEnv->GetObjectClass(clsObj);
jmethodID midGetFields = pEnv->GetMethodID(jCls, "getFields",
"()[Ljava/lang/reflect/Field;");
jobjectArray jobjArray = (jobjectArray)pEnv->CallObjectMethod(testerObject, midGetFields);
pEnv->ExceptionDescribe();
Crash dump
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x809E69F
Function=JVM_FindSignal+0x11505
Library=D:\Java\j2re1.4.2_03\bin\client\jvm.dll
Current Java thread:
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.privateGetPublicFields(Unknown Source)
at java.lang.Class.getFields(Unknown Source)
Dynamic libraries:
0x00400000 - 0x00419000 E:\SC\SC12.1\SCApplications\SNMP\Bin\JNITester.exe
0x77F50000 - 0x77FF7000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000 C:\WINDOWS\system32\kernel32.dll
0x10000000 - 0x10023000 E:\SC\SC12.1\SCApplications\SNMP\Bin\JniUtils.dll
0x00320000 - 0x00332000 E:\SnmpIpmNativeTestDriver\MTFStubHelper.dll
0x00340000 - 0x0035B000 E:\SnmpIpmNativeTestDriver\MTFXMLFileAPI.dll
0x12000000 - 0x122B1000 e:\sc\sc12.1\bin\xerces-c_2_2_0D.dll
0x77DD0000 - 0x77E5D000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000 C:\WINDOWS\system32\RPCRT4.dll
0x10200000 - 0x1026C000 e:\sc\sc12.1\bin\MSVCRTD.dll
0x102A0000 - 0x102B7000 e:\sc\sc12.1\bin\MSVCIRTD.dll
0x5F800000 - 0x5F8E9000 e:\sc\sc12.1\bin\MFC42uD.DLL
0x77C70000 - 0x77CB0000 C:\WINDOWS\system32\GDI32.dll
0x77D40000 - 0x77DCC000 C:\WINDOWS\system32\USER32.dll
0x5F700000 - 0x5F746000 e:\sc\sc12.1\bin\MFCD42uD.DLL
0x5F500000 - 0x5F5C6000 e:\sc\sc12.1\bin\MFCO42uD.DLL
0x10480000 - 0x104FE000 e:\sc\sc12.1\bin\MSVCP60D.dll
0x15020000 - 0x15042000 e:\sc\sc12.1\bin\SCTraceLib.dll
0x6D510000 - 0x6D58D000 C:\WINDOWS\System32\dbghelp.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\msvcrt.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x00360000 - 0x0037D000 e:\sc\sc12.1\bin\SCFileManager.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
0x00420000 - 0x00580000 e:\sc\sc12.1\bin\BctCoreCL.dll
0x5D920000 - 0x5D929000 C:\WINDOWS\System32\RPCNS4.dll
0x71B20000 - 0x71B31000 C:\WINDOWS\system32\MPR.dll
0x71C20000 - 0x71C6E000 C:\WINDOWS\System32\NETAPI32.dll
0x71AB0000 - 0x71AC5000 C:\WINDOWS\System32\WS2_32.dll
0x71AA0000 - 0x71AA8000 C:\WINDOWS\System32\WS2HELP.dll
0x15000000 - 0x15012000 e:\sc\sc12.1\bin\CTEventLog.dll
0x773D0000 - 0x77BC2000 C:\WINDOWS\system32\SHELL32.dll
0x70A70000 - 0x70AD4000 C:\WINDOWS\system32\SHLWAPI.dll
0x771B0000 - 0x772D1000 C:\WINDOWS\system32\ole32.dll
0x77120000 - 0x771AB000 C:\WINDOWS\system32\OLEAUT32.dll
0x1F7A0000 - 0x1F7D6000 C:\WINDOWS\System32\ODBC32.dll
0x77340000 - 0x773CB000 C:\WINDOWS\system32\COMCTL32.dll
0x763B0000 - 0x763F5000 C:\WINDOWS\system32\comdlg32.dll
0x08000000 - 0x08138000 D:\Java\j2re1.4.2_03\bin\client\jvm.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x5FD00000 - 0x5FD0D000 C:\WINDOWS\System32\MFC42LOC.DLL
0x71950000 - 0x71A34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
0x1F840000 - 0x1F857000 C:\WINDOWS\System32\odbcint.dll
0x5DAC0000 - 0x5DAC7000 C:\WINDOWS\System32\rdpsnd.dll
0x00FE0000 - 0x00FE7000 D:\Java\j2re1.4.2_03\bin\hpi.dll
0x01000000 - 0x0100E000 D:\Java\j2re1.4.2_03\bin\verify.dll
0x01010000 - 0x01029000 D:\Java\j2re1.4.2_03\bin\java.dll
0x01030000 - 0x0103D000 D:\Java\j2re1.4.2_03\bin\zip.dll
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
Heap at VM Abort:
Heap
def new generation total 576K, used 132K [0x15050000, 0x150f0000, 0x15530000)
eden space 512K, 25% used [0x15050000, 0x15071250, 0x150d0000)
from space 64K, 0% used [0x150d0000, 0x150d0000, 0x150e0000)
to space 64K, 0% used [0x150e0000, 0x150e0000, 0x150f0000)
tenured generation total 1408K, used 0K [0x15530000, 0x15690000, 0x19050000)
the space 1408K, 0% used [0x15530000, 0x15530000, 0x15530200, 0x15690000)
compacting perm gen total 4096K, used 964K [0x19050000, 0x19450000, 0x1d050000)
the space 4096K, 23% used [0x19050000, 0x191410e0, 0x19141200, 0x19450000)
Local Time = Wed Aug 25 21:06:44 2004
Elapsed Time = 0
# HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)You are right, I tried getting the java.lang.Class reference for the com.test.Tester by calling getClass() on com.test.Tester
And using this jclass reference for java.lang.Class, I tried getting the method ID of getFields and eventually the Field[]
Thanks for the help
I have some more questions.
Assumption - Using JNI, I got the fields array of com.test.Tester and I am iterating through the fields
1.Assuming that the Tester class had an Integer field say m_nIntVal, then once I get the jobject equivalent of this Field in C++.
Now I need to get the type of the field (I call the method java.lang.reflect.getType() from JNI)
This gives me a jclass reference to it's type i.e java.lang.Integer
2.I need to get the name of this type i.e I want to get the name of the type in a string as "java.lang.Integer"
For this, on the jclass reference of java.lang.Integer got in Step 1, I call getClass() from JNI (to get the java.lang.Class) and then getName()
Now, for calling getClass(), I need a temporary object reference corresponding to the jclass of java.lang.Integer, The problem is that Integer does not have a default constructor, so my call to create the jobject fails.
But, since I do not know that I am constructing an Integer (remember that is what I am trying to find out - getType), I cant pass any values to constructor
Now, how do I go about creating a jobject of Integer, without knowing that I am constructing that, as this does not have a default constructor without parameters
Also, I tried using AllocObject to get the jobject and then tried to get the method ID of getClass(). Even this failed
3. If the com.test.Tester class had a primitive "int" field, say m_nPrimitiveInt
for which java provides a Class representation, I am able to get the jclass reference to the type of m_nPrimitiveInt
Now, how do I get the name of the type as "int" in a string?
Forllowing a similar procedure like in Step 2 fails when I try to pass the jclass reference to the type of m_nPrimitiveInt to the GetMethodID
with the error FATAL ERROR in native method: JNI received a class argument that is not a class
Can you tell me what is the way out?
Thanks in advance,
Also, can I mail you with some doubts that I have? If its ok, please contact me at [email protected] -
RFC lookup with java proxy class, how do I use "fromXml()"?
Hi,
I'm trying to do an RFC lookup in XI using java proxy classes (SAP Enterprise Connector).
The XMLPayload comes from a java proxy class which has been converted to xml using a method called
.fromXml() for this. I just don't know how to use and I can't find any documentation for it.
Would very much appreciate if someone could provide me with an example of how to use this class
Best Regards
Olof Trönnberghttp://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStreamer.html#fromXML(com.thoughtworks.xstream.io.HierarchicalStreamDriver,%20java.io.Reader)
Maybe you are looking for
-
On my old ibook I downloaded and easily used e-fax messenger to send and receive faxes. I upgraded to a MacBook pro with Tiger 10.4.6 and now when I go to send a fax, OS 10 shuts down and said it shut down unexpectedly and do I want to report it to A
-
Hi Gurus, In ALV grid display, I have 'display' and 'print' icon in the application tool bar. When I select a particular record and click display buttton, it will display the detailed description of the particular row.but, when i select the print bu
-
Windows 8.1 Broken Windows/Metro apps when WIM deployed via MDT
Windows 8.1 u1 Broken Windows/Metro apps when WIM deployed via MDT Windows 8.1 Enterprise - update 1, x64bit with latest updates installed. I am having a similar problem to thread (Sysprep and Windows 8.1 -- missing Metro apps after reboot?). Althou
-
When will camera raw update compatibility for Sony RX100 III be available?
Camera raw compatibility is now available for Sony RX100 III for all Adobe Applications. Why is it not included in latest Apple update? Any ideas when new camera raw compatibility for this camera will be available? Why is Apple so slow on this?
-
WebDynproJ BuildError:Role "Context": A minimum of 1 object(s) is required
[wdgen] WARNING: Metadata of component SearchHelpConsumer is not valid! ComponentUsage "//WebDynpro/Component:com.gmodelo.meta.common.searchhelp.searchhelpconsumer.SearchHelpConsumer/ComponentUsage:GenericSearchHelpComp", Role "UsedComponent": A mini