Adding methods to a automatic generated class
Hello,
I am currently working on an project where a part of the code is automatic generated from XML Schema, using Castor's SourceGenerator. The classes generated from these generic java-sourcecodes represents an hierachical tree structure (a composite pattern, with a composite as super class, and nodes and leafes as sub-classes), which I am using with JTree. My problem is that I cannot make Castor override the toString()-method, without changing some vital properties of my generated java-codes.
One solution is to encapsulate the super-class and the two sub-classes in a identical class structure, mapping all the methods and adding a toString() method, but doing this by hand takes away the advantage of Castor. Somehow I think reflection could be a good solution, but I am not familiar with java-reflection and cannot say if it would solve my problem.
It sounds like byte code manipulation (e.g., BCEL) may be what you need. Which is too bad because it's nontrivial.
I don't think reflection would do what you want, but I'm not sure what you want.
Similar Messages
-
Syntax error for automatic generated class for object MAS_AUTH_CUST
Hi,
I am configuring the mobile sales scenario. I encountered a weird problem. Basically the automatically generated class ZDOECL_013_00H_MWSR can not be activated. If you activate it manually it will give you the below error. Looks like the entity structure is too big. So the generated code has a very big loop which causes the dump. I found the issue when try to run the function module CRM_AUTH_CUST_INSERTCDS as suggested in the configuration guide.
I have tried to regenerate the object. But it still give me the same error.
Internal error occured during runtime generation of Class ZDOECL_013_00H_MWSR (Dump ID: GEN_BRANCHOFFSET_LIMIT_REACHED)
Message no. OO053
Diagnosis
An internal error occurred when the system tried to generate the runtime objects of the class. A dump has been created with the given dump ID. It can be analyzed using transaction ST22.
Our Netweaver version as below. It should contain already the latest patch etc.
SAP_ABA 711 0006 SAPKA71106
SAP_BASIS 711 0006 SAPKB71106
PI_BASIS 711 0006 SAPK-71106INPIBASIS
ST-PI 2008_1_710 0004 SAPKITLRE4
SAP_BW 711 0006 SAPKW71106
CRMSPGWY 110 0004 SAPK-11004INCRMSPGWY
CRM version.
SAP_ABA 702 0006 SAPKA70206
SAP_BASIS 702 0006 SAPKB70206
PI_BASIS 702 0006 SAPK-70206INPIBASIS
ST-PI 2008_1_700 0002 SAPKITLRD2
SAP_BS_FND 702 0004 SAPK-70204INSAPBSFND
SAP_BW 702 0006 SAPKW70206
LCAPPS 2005_700 0009 SAPKIBHD09
SAP_AP 700 0022 SAPKNA7022
WEBCUIF 701 0003 SAPK-70103INWEBCUIF
BBPCRM 701 0003 SAPKU70103
WFMCORE 200 0016 SAPK-20016INWFMCORE
VIRSANH 530_700 0011 SAPK-53311INVIRSANH
Any advice is appreciated.
Thanks
Hansen ChenHi,
Gateway1.1 to SAP Netweaver mobile is not supported with EHP1 of SAP Netweaver Mobile 7.10.
Please check the release information note: 1539681
So, i suggest you to install SAP Netweaver Mobile 7.10 with Gateway addon.
Regards,
Siva. -
Possible to not have InDesign CC automatically generate class names based on 'Style Name'?
In the Export Tagging settings in InDesign CC, there is an option to use a custom tag as well as a custom class name. However, if the class is left blank then the Style Name is used in its place.
Is it possible to not have InDesign assign a class automatically?
Here is my scenario: I would like to not clutter up my HTML markup by having a class name of `body` for all my p tags, when I could simply use p without a class and style it in my CSS.
Thank you in advance.This is even worse than a Bug. It's a huge expense.
Even if you make your paragraph style 1 letter, let's say "B" for "Body", You still end up with <p class=B> instead of just <p>. Now multiply that "class=B" by all the lines in your code and your bloat is greater than 10% on a per file basis.
On Amazon a 3 MB file for example costs 45 cents to transmit to a customer. 10% more means an additional 4.5 cents cost per book. Say you sell 100,000 copies of a book, we're talking .045 x 100,000 = $4,500.00. And remember that MOBIs pretty much double the size of your basic EPUB. This is a serious problem, the correction of which cannot be delayed! -
Automatically generated (Sound) classes
Hi all,
Quick summary:
I'm trying to compile a SWC file with a lot of assets in it in an as easy possible way. "Easy" for a not so technical end user, not perse the way to acchieve that goal. Goal is to streamline a process to generate SWC files with as little possible tech for the person doing it.
So, sort of like manually doing:
* Import files into Flash
* For each library item select "Export for actionscript" and have Flash generate the basic class.
* Publish as SWC
but without the Flash IDE and the possibly labourous process.
Right now I'm trying to put an AIR project together that generates classes based on a file list. The classes can than be added to a Flash Builder library project to generate a SWC file from it (copy in finder, check classes in Project properties, done)
I can generate the classes for graphics like below. Such a class can then be instantiated from within the host application.
package
import flash.display.Bitmap;
import flash.display.MovieClip;
public class __0038_asset extends MovieClip
[Embed(source="assets/__0038_asset.png")]
private static const gfx:Class;
public function __0038_asset()
super();
addChild( new gfx() as Bitmap );
Allthough this adds another level to the display list (which looks kinda sloppy to me), it works.
However, for this to work for sound files I need to create a class implementing all possible methods and properties of the soundclass and handle the events and such. There is no way to extend Sound and then do something like you would/can with graphics.
This is what I got:
package
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;
public class _000_cover_hotsp_authormp3 extends Sound
[Embed(source="assets/000_cover_hotsp_author.mp3")]
private var snd:Class;
public function _000_cover_hotsp_authormp3(stream:URLRequest=null, context:SoundLoaderContext=null)
super(stream, context);
var mySound:Sound = new snd() as Sound;
But that aint gonna work ofcourse.
Does anyone know if there is a way to get to the format the Flash IDE generates the classes with?
Thanks in advance.
MannoWel, here's the answer. Must have read it once since it is in the moock book, but stubled across it on the interwebs at: http://blog.nightspade.com/2010/02/01/embedding-asset-at-compile-time-in-pure-as3-project/
For images use:
[Embed(source="assets/Frog&Stranger02_03-titelblad_height_1024px 2.jpg")]
public class a_A2BA79B5_CE46_F942_1AB2_CC26D8F7FCC8 extends Bitmap
public function a_A2BA79B5_CE46_F942_1AB2_CC26D8F7FCC8()
super();
and for sounds:
[Embed(source="assets/000_cover_hotsp_author.mp3")]
public class _000_cover_hotsp_authormp3 extends Sound
public function _000_cover_hotsp_authormp3()
Now, lets review some code to see if I can apply this elsewhere too -
JVM crash when adding method to class
Hello,
I am getting some kind of problem with the virtual machine. The JVM crashes when making a class (with new). It happened when I was adding some functionality to the class, I worked my way backwards and discovered it crashes when I add any new methods, if I comment them out again everything works, adding a method by any name causes to crash.
I went in debug to find out where it was happening, and it happens on this line:
public PerspectiveActionToolBarHeader createPerspectiveActionToolBarHeader() {
PerspectiveActionToolBarHeader ret = null;
ret = new PerspectiveActionToolBarHeader(this); // << here
return ret;
}The PerspectiveActionToolBarHeader is the class where adding methods causes it to fail. For example, it has the method
public Container getContainer() {
return this;
}and works, but if I add:
public void anything(){} it causes a crash on the new PerspectiveActionToolBarHeader(this);
When stepped into with the debugger it goes to the (source not found) ClassNotFoundException and eventually before the crash the (stack?) looks like this:
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
MaldiSoftwareOptionsUIEnsemble(PerspectiveUIEnsemble).createPerspectiveActionToolBarHeader() line: 72
and the debugger describes the class just before the crash:
Launcher$AppClassLoader (id=44)
arg0 "saiman.uiobjnew.PerspectiveToolBarButton" (id=51) << has just changed
and the log file (not sure how much to copy here!):
# A fatal error has been detected by the Java Runtime Environment:
# EXCEPTION_ILLEGAL_INSTRUCTION (0xc000001d) at pc=0x005c0001, pid=15504, tid=20112
# JRE version: 6.0_24-b07
# Java VM: Java HotSpot(TM) Client VM (19.1-b02 mixed mode windows-x86 )
# Problematic frame:
# C 0x005c0001
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
--------------- T H R E A D ---------------
Current thread (0x011ca000): JavaThread "main" [_thread_in_vm, id=20112, stack(0x01140000,0x01190000)]
siginfo: ExceptionCode=0xc000001d
Registers:
EAX=0x13e13248, EBX=0x6da0daa8, ECX=0x13e13250, EDX=0x13e131f8
ESP=0x0118f93c, EBP=0x0118f9a0, ESI=0x011ca9b0, EDI=0x011ca9ac
EIP=0x005c0001, EFLAGS=0x00010206
Register to memory mapping:
EAX=0x13e13248
{method}
- klass: {other class}
EBX=0x6da0daa8
0x6da0daa8 is pointing to unknown location
ECX=0x13e13250
{method}
- klass: {other class}
EDX=0x13e131f8
{constMethod}
- klass: {other class}
- method: 0x13e13248 {method} 'flipVisible' '(I)V' in 'saiman/uiobjnew/PerspectiveActionToolBarHeader'
- exceptions: 0x13bf11e8
ESP=0x0118f93c
0x0118f93c is pointing into the stack for thread: 0x011ca000
"main" prio=6 tid=0x011ca000 nid=0x4e90 runnable [0x0118f000]
java.lang.Thread.State: RUNNABLE
EBP=0x0118f9a0
0x0118f9a0 is pointing into the stack for thread: 0x011ca000
"main" prio=6 tid=0x011ca000 nid=0x4e90 runnable [0x0118f000]
java.lang.Thread.State: RUNNABLE
ESI=0x011ca9b0
0x011ca9b0 is pointing to unknown location
EDI=0x011ca9ac
0x011ca9ac is pointing to unknown location
Top of Stack: (sp=0x0118f93c)
0x0118f93c: 6d94272d 011ca370 13e17d40 011ca000
0x0118f94c: 011ca000 01a30950 011ca748 011ca9b4
0x0118f95c: 011cab3c 0118fb28 011c6748 011ca348
0x0118f96c: 011ca370 011ca73c 6da0daa8 011ca350
0x0118f97c: 011ca370 0118f9cc 011ca9a8 0118f9c8
0x0118f98c: 011ca788 011ca370 011ca9b0 011ca000
0x0118f99c: 13e17d40 0118f9cc 6d943009 00000910
0x0118f9ac: 011ca9ac 00000001 011ca000 011ca000
Instructions: (pc=0x005c0001)
0x005bfff1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff
0x005c0001: ff ff 7f 00 00 00 00 00 00 00 00 ff ff ff ff 00
Stack: [0x01140000,0x01190000], sp=0x0118f93c, free space=318k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x005c0001
V [jvm.dll+0x153009]
V [jvm.dll+0xdecdb]
V [jvm.dll+0xe1887]
V [jvm.dll+0xe1c46]
V [jvm.dll+0xec09a]
j saiman.uiobjnew.PerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+2
j saiman.mv.ModelViewPerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+1
j saiman.uiobjnew.PerspectiveUIEnsemble.addButtons()V+1
j saiman.uiobjnew.PerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+21
j saiman.mv.ModelViewPerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
j saiman.uiobjnew.SoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
j saiman.wmaldi.MaldiSoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
j saiman.newuiimpl.MassSpectrumMainFrameImpl.main([Ljava/lang/String;)V+173
v ~StubRoutines::call_stub
V [jvm.dll+0xf0ab9]
V [jvm.dll+0x1837d1]
V [jvm.dll+0xf0b3d]
V [jvm.dll+0xfa0d6]
V [jvm.dll+0x101cde]
C [javaw.exe+0x2155]
C [javaw.exe+0x8614]
C [kernel32.dll+0x51194]
C [ntdll.dll+0x5b3f5]
C [ntdll.dll+0x5b3c8]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j saiman.uiobjnew.PerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+2
j saiman.mv.ModelViewPerspectiveUIEnsemble.createPerspectiveActionToolBarHeader()Lsaiman/uiobjnew/PerspectiveActionToolBarHeader;+1
j saiman.uiobjnew.PerspectiveUIEnsemble.addButtons()V+1
j saiman.uiobjnew.PerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+21
j saiman.mv.ModelViewPerspectiveUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
j saiman.uiobjnew.SoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
j saiman.wmaldi.MaldiSoftwareOptionsUIEnsemble.<init>(Lsaiman/uiobjnew/MultiPerspectiveFrame;)V+2
j saiman.newuiimpl.MassSpectrumMainFrameImpl.main([Ljava/lang/String;)V+173
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x01b05400 JavaThread "AWT-Windows" daemon [_thread_in_native, id=19680, stack(0x18560000,0x185b0000)]
0x01b04800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=19516, stack(0x18140000,0x18190000)]
0x01b04000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=20064, stack(0x18040000,0x18090000)]
0x01b03c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=20276, stack(0x17ff0000,0x18040000)]
0x01aeb000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=16832, stack(0x17fa0000,0x17ff0000)]
0x01aea000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=16360, stack(0x17ef0000,0x17f40000)]
0x01ae8000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=20084, stack(0x17ea0000,0x17ef0000)]
0x01ade400 JavaThread "Attach Listener" daemon [_thread_blocked, id=19772, stack(0x17d90000,0x17de0000)]
0x01add400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20192, stack(0x17d40000,0x17d90000)]
0x01ab2800 JavaThread "Finalizer" daemon [_thread_blocked, id=17344, stack(0x17cf0000,0x17d40000)]
0x01aabc00 JavaThread "Reference Handler" daemon [_thread_blocked, id=19964, stack(0x17ca0000,0x17cf0000)]
=>0x011ca000 JavaThread "main" [_thread_in_vm, id=20112, stack(0x01140000,0x01190000)]
Other Threads:
0x01aa7c00 VMThread [stack: 0x011d0000,0x01220000] [id=19144]
0x01b17400 WatcherThread [stack: 0x180f0000,0x18140000] [id=12792]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 4928K, used 768K [0x03bf0000, 0x04140000, 0x09140000)
eden space 4416K, 5% used [0x03bf0000, 0x03c30380, 0x04040000)
from space 512K, 100% used [0x040c0000, 0x04140000, 0x04140000)
to space 512K, 0% used [0x04040000, 0x04040000, 0x040c0000)
tenured generation total 10944K, used 1858K [0x09140000, 0x09bf0000, 0x13bf0000)
the space 10944K, 16% used [0x09140000, 0x09310948, 0x09310a00, 0x09bf0000)
compacting perm gen total 12288K, used 9598K [0x13bf0000, 0x147f0000, 0x17bf0000)
the space 12288K, 78% used [0x13bf0000, 0x1454fb70, 0x1454fc00, 0x147f0000)
No shared spaces configured.
Edited by: hanvyj on 07-Jun-2011 02:39
Edited by: hanvyj on 07-Jun-2011 02:43I think I may have stumbled across the answer, It seems that the abstract class PerspectiveToolBar implements
the interface with the method public Container getContainer() but does not declare it, this should be fine because the method is abstract but it crashes. When I add the method public abstract Container getContainer(); to the abstract sub-class there is no error. I'm going to try make a small compilable example to see if I can reproduce it.
edit its actually only one of the two interface methods, and not getContainer(), but another one. If anyone is interested here is the interface:
public interface IMassSpectrometerPassableControlContainer
Container getContainer();
void reloadWidgetsOnVisible(boolean visible);
}and it works only if there is "public abstract void reloadWidgetsOnVisible(boolean visible);" in the abstract class PerspectiveToolBar implementing IMassSpectrometerPassableControlContainer.
I tried to reproduce it, but I can't get another class to repeat the behaviour, so I don't think I can post a bug report on it. Here is my attempt anyway:
import javax.swing.JToolBar;
* Class Test.java
* Date: 7 Jun 2011
* @author tofuser
public class Test extends Subclass
public static void main(String args[])
System.out.println("in main method");
Test t = new Test();
t.interfaceMethod();
@Override
public void interfaceMethod()
System.out.println("interface method");
abstract class Subclass extends JToolBar implements Interface
private static final long serialVersionUID = 1L;
//this line is where it breaks in my code, including it works
//public abstract void interfaceMethod();
interface Interface
public abstract void interfaceMethod();
}Edited by: hanvyj on 07-Jun-2011 03:56 -
Namespace issue with oracg generated classes
Hi,
I'm having problems generating classes with oracg from the Java Xdk from an XML schema. All classes are generated, but do not compile. In some sources (mostly in the type classes) "public void addSomething(null.Something theSomething)" is generated as the method declaration, and that doesn't compile. When I add a targetnamespace to the xsd file, the generated sources compile (the 'null.' is replaced with 'myPackage.', but when I generate an XML document, I contains a namespace reference (ns1) like this:
<ns1:Note xmlns:ns1 = "http://www.somewhere.org">
<ns1:Form>
<ns1:Reference>
<ns1:ReferenceNbr>1</ns1:ReferenceNbr>
<ns1:ReferenceType>1</ns1:ReferenceType>
</ns1:Reference>
</ns1:Form>
</ns1:Note>
What I want is this:
<Note>
<Form>
<Reference>
<ReferenceNbr>1<ReferenceNbr>
<ReferenceType>1<ReferenceType>
</Reference>
</Form>
</Note>
How can I get this result ?
Kind regards.Did you try adding the the XmlSeeAlso annotation to the webservice
@XmlSeeAlso({<package.name>.AccountIC.class})
This will add the schema for the data type (AccountIC) to the WSDL.
Hope this helps.
-Ajay -
How to extend/ replace generated classes from JAXB
Hello Experts,
In our application (Which uses Java Webdynpro as the UI and RFCs for the backend access- an R/3 System), there is a need to construct an XML file (from the data entered by the user) which will be later accepted by the backend system. Now to avoid manual creation of the XML document, what we did is that we created an XSD file based on the back end structure (This XSD contains definition for all the possible fields and structures in the back end).
Then we used the JAXB implementation to automatically create Java Objects from the XSD file. We populate this JAXB generated Java objects and then use the Serialization framework to serialize them into an XML file.
This all works well, provided that the structure of the back end system does not change, but unfortunately it can, customer can add additional attributes to the existing structures (They do not create new structures, just add new attributes to it so I do not need to create new Java Object classes at runtime, I need only to add attributes to them). If they do so, the XSD and corresponding Java Objects (which are shipped as part of the source code) do not remain valid anymore as the automatically generated Objects (which correspond to the structures in the back end) would not have the definition of the newly added attributes.
Can anyone please suggest how to overcome this limitation with JAXB.
The needed functionality is that somehow I should be able to add fields (corresponding to the customer added attributes) to the automatically created Java objects and thus pass the data in the additional attribute to the backend. (Please note that at runtime using an RFC, I can find out the current structure of the backend but the structure at the Webdynpro end (set of Java objects generated from the JAXB) is static and is a part of the code).
Any comments/suggestions could be of great help.
Thanks
Amit KapoorYou cannot do that. TheJAVA language does not allow a class to "extend" more than one upper class.
Typically, the solution is to modify your architecture a little bit. Just use the "has a" relationship instead of "is a". That means something like that:public class MyFraisMessage
extends MyOtherClass
private FraisMessage message;
etc...You write an extension "MyFraisMessage" of your upper class "MyOtherClass", which has the JAXB generated object as an attribute. This structure is often useful, when you think you would need multiple inheritance. -
Is there a way to auto generate classes?
I'm not sure. I'm working on a script that will take all the
counties of Oregon and when you click on one
county it returns the name of that county. It consists of on
main class and a seperate as file for each of the counties. It
looks like this:
// County.as
package
import flash.utils.*;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
public class County extends MovieClip // what extends means
is that in addition to all the below properties and methods you're
also
// adding the methods of movieclips
// this event listener had to be within its own function to
work
// this is a constructor
// this is a method
public function County()
addEventListener(MouseEvent.CLICK , selectedCounty); //
myFunction returns the name of the county that was clicked
// this is also a method
private function selectedCounty(event:MouseEvent):void
trace("County selected is " + this.Name());
// another method of course
// this function returns name of the county
public function Name()
return flash.utils.getQualifiedClassName(this); // works
with our without the "flash.util." part
and each of the 34 counties has its own as script like this
example:
// Morrow.as
package
public class Morrow extends County // what extends means is
that in addition to all the below properties and methods you're
also
// adding the methods of movieclips
// empty on purpose all it does is extend all the details of
County to the Morrow MovieClip
what I'd like is a way around having to make all 34 county
actionscripts -
Hi,
I'm trying to create a PDF fillable form with Acrobat X Pro.
Can Acrobat allow a function, so that it can automatically generate a 'number'/'code' which I could use as an 'identifier'?
eg. A hidden field named: 'DOC ID' and provide 100001 when added to response file as it's submitted and '100002' to another file when it another is submitted/added onto the response file etc...
I am aware that Response files, if submitted correctly, could automatically generate numbers like 001, 002 etc...
But I'd like to see if I could create a field, that 'numbers' the document for me automatically and uniquely.
Any help and/or suggestions would be appreciated.
WinnieHi,
to do this you need kind of interactivity in your form.
You can achieve this either by:
1) using JavaScript onchange-events on forename and surname items, or
2) use the AJAX Computations option of ApexLib, see: http://www.oracle-and-apex.com/ajax-computations-rich-client-feeling/
brgds,
Peter
Blog: http://www.oracle-and-apex.com -
How to use JAXB generated classes with SOAP
hello,
I have a library of JAXB generated classes for my web service. There is a Java class for each web method defined in my schema. For example, my getLocation method is mapped to GetLocation.class.
However my web service is SOAP based, so I am having to manually strip off the SOAP elements to be able to unmarshall the getLocation xml to a GetLocation class.
I am noticing a disconnect between JAXB and other Java SOAP and RPC libraries. Does anyone know how to create a JAXB class for SOAP Envelopes and Bodys? Does anyone have any ideas how to incorporate the existing Java web service libraries with JAXB?
Thanks in advance.Have you found a method to integrate SAAJ and JAXB? Or
is better to use SAAJ only ?If I had to choose I'd go with SAAJ. It seems to me that's theoretically possible to use JAXB classes with SAAJ but I imagine if it is possible it would be a big pain in the ass. -
Generated Class is not called by Inbound Proxy
Uploading data to Ztable of ECC by using inbound proxy.
The messages are tranfered to SAP ECC from SAP XI.
Monitoring in SXMB_MONI in SAP XI DEV can see Success flag
Monitoring in SXMB_MONI in SAP ECC can see inbound message stored in QUEUES only.
I configured the Application Integration Engine as per the help document.
In Reciever XI Adapter set the addressing type URL.
Coding is correct in the method of the generated class.
Let me know if any configurations yet to be done.
Let me know how to proceed furthur.
ThankYou in Advance.hi
Go to SMQR of the ECC and register and activate the queues again.
Also ensure that u are implementing the correct methods of the proxy
EXECUTE-SYNCHRONOUS / EXECUTE-ASYNCHRONOUS
rgds
Arun -
Calling Stored Procedure w/JPublisher generated classes
Hi,
We are trying to pass Oracle nested tables as input/output parameters to several of our stored procedures to support bulk binding operations in the database from our applications. We have some database defined types and stored procedures that use these as input/output parameters which have been tested and working at the database level. I managed to get JPublisher to create these classes and compile fine, but I am not sure exactly how to register these classes as parameters with the stored procedure Java call. Any assistance is appreciated.
Here is a sample of the db types/procedures:
TYPE USER_APP_TYPE IS OBJECT
User_ID VARCHAR2(50), -- input fields
App_ID VARCHAR2(50),
App_Type VARCHAR2(50),
App_Obj_ID VARCHAR2(50),
Status VARCHAR2(30), -- output fields
Desc_String VARCHAR2(255),
Comments VARCHAR2(255)
TYPE USER_APP_LIST IS TABLE OF USER_APP_TYPE;
CREATE OR REPLACE
PACKAGE BODY PKG_MOD_BULK
AS
PROCEDURE LOOKUPAPPBYUSER_BULK(
p_InOutRS IN OUT USER_APP_LIST)
IS
BEGIN
... do work - fill in output fields ...
END LOOKUPAPPBYUSER_BULK;
END PKG_MOD_BULK;So using JPublisher 3 classes were generated with constructors and getter/setter methods:
UserAppType.java
UserAppTypeRef.java
UserAppList.java
My consumer POC code looks like this:
public class BulkBindingDemo
@SuppressWarnings("CallToThreadDumpStack")
public static void main(String[] args)
Connection conn = null;
try
String UserName = "user";
String Password = "pass";
// Load JDBC driver
Class.forName("oracle.jdbc.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@mydatabse.com:1521:mysid", UserName, Password);
// Create instances of custom database UDT classes.
UserAppList myAppList = new UserAppLicList();
UserAppType[] myAppArr = new UserAppType[2];
// Populate UDTs
myAppArr[0] = new UserAppType("bob" ,"acct","fiscal","1FG452ABC",null,null,null,null,null,null,null);
myAppArr[1] = new UserAppType("joe","hr","benefits","89JTYG671",null,null,null,null,null,null,null);
myAppList.setArray(myAppArr);
// Not sure how to set parameter as input/output.
CallableStatement cs = conn.prepareCall("BEGIN MY_SCHEMA.PKG_MOD_BULK.LOOKUPAPPBYUSER_BULK(?); END;");
cs.setObject("p_InOutRs", myAppLicList);
cs.execute();
ResultSet rs = cs.getResultSet();
// Get results - null fields from above should be populated
if (rs.first())
myAppList = (UserAppList)rs.getObject("p_InOutRs");
myAppArr = myAppList.getArray();
System.out.println("status: " + myAppArr[0].getStatus());
System.out.println("desc str: " + myAppArr[0].getDescString());
System.out.println("comments: " + myAppArr[0].getComments());
// additional fields here..
//MyObject[] myObjectAry = (MyObject[])p_myObjectArray.getArray();
//cs.registerOutParameter(1,Types.CHAR);
catch (Exception e)
e.printStackTrace();
finally
if (conn != null)
try { conn.close(); }
catch (Exception e) {}
}So this code will compile and run up to the stored procedure call itself, but I'm not sure how to set the parameters for in/out with these generated classes. Any ideas?Anyone? Still haven't figured this one out...
-
Error of method not found in C# class in VS 2013 on win7
I am changing a C# code in a solution (it has many files and projets) from VS 2013 on win 7.
I added some properties in class1. It was built well.
But, it has run-time error:
Method not found : class1.set_p1(system.string)
The code logic is as follows:
public class class1
public string p1 {get; set;} // **have updated**
class1 is defined in a C# project that has been added in the solution.
public abstract class class2 : class1
class2 ins2;
ins2.p1 = myData.order.data_file; // myData is from an xml file after deserialize and serialize, data_file is a file path.
I have cleaned up the solution before building. I have also search the error online but none of them can solve my problems.
Any help would be appreciated.Check your dependencies in your projects. I understand the project was added to the solution but was it also added to the projects that will be 1. implementing/inheriting types from that project and 2. consuming types from that project
Check your name spaces to make sure that the type class1 is not also defined in another namespace in that or even a different project. In that case class1 might not have that property available because its pointing to the wrong type.
If that does not solve your problem it would be helpful to include.
the fully qualified namespaces of the types in your type hierarchy that are giving you the problem
the full calling code, the sample above is not correct in syntax.
the project dependencies for the code in question and where the types are located in each project
Mark as answer or vote as helpful if you find it useful | Igor -
Can I automatically generate a contact list from my emails?
I've been using Mail for years. But not Address Book.
I've got about 10,000 emails, and I'm wondering if there's a way to pull all the email addresses from Mail and automatically generate an Address Book out of it?
Or is there a utility somewhere?
Thanks in advance!Yes there is.
There is a collection of AppleScripts called Mail Scripts available at this link.
http://homepage.mac.com/aamann/Mail_Scripts.html
The script you want to use from the collection of scripts is called Add Addresses.
+*Add Addresses*+
+Select all messages you want to use for creating the mailing list (for creating a mailing list, you would choose all messages in a mailbox which contains all messages on a certain topic).+
+Run the script and you get a list with all addresses contained in the selected messages - mark all the addresses you want to add to the Address Book using the checkboxes.+
+From the popup menu, choose which group you want to update with the selected addresses or select "Create new Group..." and enter the name for the new group to be created.+
+The script checks whether an address is already present before adding it to the Address Book in order to avoid duplicate entries. If additional information is available for an entry already present in the Address Book (e.g., full name information for an entry which had prior been email-only), the entry will be updated.+ -
Jaxb. Problem in generating classes
I am using wsad 5.1.1 and java web services developers pack 1.5.
I am trying to generate classes from xml schema but i am getting following error. please help.
parsing a schema...
compiling a schema...
generated\impl\runtime\ContentHandlerAdaptor.java
generated\impl\runtime\GrammarInfo.java
generated\impl\runtime\SAXUnmarshallerHandler.java
generated\impl\runtime\GrammarInfoFacade.java
generated\impl\runtime\UnmarshallingEventHandlerAdaptor.java
generated\impl\runtime\SAXMarshaller.java
generated\impl\runtime\ValidatingUnmarshaller.java
generated\impl\runtime\AbstractUnmarshallingEventHandlerImpl.java
generated\impl\runtime\GrammarInfoImpl.java
generated\impl\runtime\Util.java
generated\impl\runtime\ValidationContext.java
generated\impl\runtime\UnmarshallerImpl.java
generated\impl\runtime\UnmarshallingEventHandler.java
generated\impl\runtime\NamespaceContext2.java
generated\impl\runtime\SAXUnmarshallerHandlerImpl.java
generated\impl\runtime\XMLSerializable.java
generated\impl\runtime\DefaultJAXBContextImpl.java
generated\impl\runtime\UnmarshallableObject.java
generated\impl\runtime\PrefixCallback.java
generated\impl\runtime\NamespaceContextImpl.java
generated\impl\runtime\ErrorHandlerAdaptor.java
generated\impl\runtime\ValidatableObject.java
generated\impl\runtime\Discarder.java
generated\impl\runtime\MSVValidator.java
generated\impl\runtime\UnmarshallingContext.java
generated\impl\runtime\ValidatorImpl.java
generated\impl\runtime\InterningUnmarshallerHandler.java
generated\impl\runtime\MarshallerImpl.java
generated\impl\runtime\XMLSerializer.java
generated\impl\CommentImpl.java
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
Caused by: java.lang.NullPointerException
at com.ibm.nio.cs.SBCS_Encoder.canEncode(SBCS_Encoder.java:199)
at com.sun.codemodel.JPackage$1.requireEscaping(JPackage.java:356)
at com.sun.codemodel.util.UnicodeEscapeWriter.write(UnicodeEscapeWriter.java:28)
at com.sun.codemodel.util.UnicodeEscapeWriter.write(UnicodeEscapeWriter.java:54)
at com.sun.codemodel.util.UnicodeEscapeWriter.write(UnicodeEscapeWriter.java:66)
at java.io.PrintWriter.newLine(PrintWriter.java(Compiled Code))
at java.io.PrintWriter.println(PrintWriter.java(Compiled Code))
at com.sun.codemodel.JFormatter.nl(JFormatter.java:159)
at com.sun.codemodel.JPackageMemberClass.declare(JPackageMemberClass.java:60)
at com.sun.codemodel.JPackage.build(JPackage.java:364)
at com.sun.codemodel.JCodeModel.build(JCodeModel.java:157)
at com.sun.tools.xjc.Driver.run(Driver.java:235)
at com.sun.tools.xjc.Driver._main(Driver.java:80)
at com.sun.tools.xjc.Driver.access$000(Driver.java:46)
at com.sun.tools.xjc.Driver$1.run(Driver.java:60)Use the Sun 1.4.2 JDK instead of the IBM WSAD 5.1.1 built-in JDK.
Maybe you are looking for
-
I have a portal application that has some forms applications inside, the applications are presented using an html portlet and the user is identified via SSO, the problem is since a server reboot when a user tries to access a forms application, the lo
-
In my BSP View am using two check box. I want to disable one check box when the other one gets checked and vice versa. Right now am doing with some logics and with server side events.I want to do this in the client side. In <b>Java script</b> how i c
-
Error when trying to debug in Visual Cafe
I get a class not found exception when I run the server in Visual Cafe. Are there any clear directives on how to run the server (JDK 1.2.2, WIN NT) in debug mode? This is my class that I'm running and below is the error I receive. Any help is greatly
-
There is no disc or tape in the machine. I have tried waiting up to 8 hours to no avail. I tried unpluging the machine for a few minutes, and plugging it back in. Same result, please wait, then try again. The machine says this every time I press set
-
My iMac only has one screw on bottom to access memory?
my iMac has only one screw on bottom to access memory?