Adapter module - problem with XML
Hi all
I have written an adapter module for the sender jdbc adapter(it shouldn't matter which adapter) that converts the content into xml by addressing each byte of the message content.
I am able to make the xml but when the message reaches the integration server it throws up a mapping exception. When I look at the payload in SXI_MONITOR it says -
Invalid at the top level of the document. Error processing resource 'file:/// ........
But when I right click on the payload and do "view source" and then save the text document and then refresh the payload in the payload window it shows me the xml document.
Would you have any idea as to why the IS doesn't recognise the message to be an xml message?
Thanks a lot
Salil
Hi Bhavesh
Yup it's a perfectly valid xml. I tried saving it as a file to my desktop and it opened fine in my browser. As I mentioned earlier even when I do a "view source" of the payload and then save that and subsequently refresh the payload it shows up fine too.
Actually here is the payload. i am wondering if all it needs is a carriage return after the <?xml tag.
<?xml version="1.0" encoding="utf-8"?> <ns0:out_sale_mt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><TransHeaders><ID>1782219</ID><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Receipt>0910990000002</Receipt><Logged>2007-08-02T18:52:53</Logged><TransType>C</TransType><TransStatus>C</TransStatus><TheUser>cantlong</TheUser><Customer>100001006</Customer><CustType>C</CustType><SecondCustomer></SecondCustomer><SecondCustCard></SecondCustCard><LinesNo>2</LinesNo><PaymentsNo>1</PaymentsNo><TotalBeforeTax>2.8400</TotalBeforeTax><TotalAfterTax>3.1900</TotalAfterTax><ScannedNo>0</ScannedNo><ScanTime>0</ScanTime><PayTime>0</PayTime><IdleTime>0</IdleTime><Reason>0</Reason><Rounding>0.0000</Rounding><TH_FieldText1></TH_FieldText1><TH_FieldText2></TH_FieldText2><TH_FieldText3></TH_FieldText3><System1>0</System1><System2>0.0000</System2><System3></System3><FolioID>0</FolioID><UserAcc>1</UserAcc><Salesperson></Salesperson><TransLines xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Line>1</Line><LineType>N</LineType><UPC>9400559001014</UPC><IsVoided>0</IsVoided><Quantity>1.0000</Quantity><Price>3.1900</Price><DiscountID>0</DiscountID><TaxNo>1</TaxNo><SubBeforeTax>2.8356</SubBeforeTax><SubAfterTax>3.1900</SubAfterTax><Reason>0</Reason><Note/><TL_FieldText1/><TL_FieldText2/><TL_FieldText3/><SerialNumber/><TransStatus>C</TransStatus><Cost>2.4000</Cost><PriceSet>3.1900</PriceSet><TaxNo1>1</TaxNo1><TaxNo2>0</TaxNo2><TaxNo3>0</TaxNo3><TaxAmount1>0.3544</TaxAmount1><TaxAmount2>0.0000</TaxAmount2><TaxAmount3>0.0000</TaxAmount3><CostProtect xsi:nil="true"/><Location>0</Location><ESMPack>0</ESMPack></TransLines><TransPayments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Line>1</Line><MediaID>9</MediaID><MediaName>SPLIT</MediaName><Value>3.1900</Value><Fee>0.0000</Fee><Change>0.0000</Change><MediaNumber/><TP_FieldText1/><Rate>0.000000000</Rate><FCValue>0.0000</FCValue></TransPayments><PostCapture xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://www.rd1.com/pos/sales"><Id>168165</Id><Type/><TransStatus>C</TransStatus><TransNo>2</TransNo><Branch>91</Branch><Station>99</Station><Line>0</Line><IsVoided>0</IsVoided><Logged>2007-08-02T18:52:54</Logged><TheUser>cantlong</TheUser><Status>0</Status><UPC/><Note1/><Note2/><LineBucket>1</LineBucket><Bucket>&lt;capture&gt;&lt;splits&gt;&lt;split&gt;&lt;code&gt;100001006&lt;/code&gt;&lt;percent&gt;50&lt;/percent&gt;&lt;/split&gt;&lt;split&gt;&lt;code&gt;100001030&lt;/code&gt;&lt;percent&gt;50&lt;/percent&gt;&lt;/split&gt;&lt;/splits&gt;&lt;/capture&gt;</Bucket></PostCapture></TransHeaders></ns0:out_sale_mt>
Similar Messages
-
hi everybody,
I've a big problem with XML on Linux, in details I see my program stopping on Linux at the instruction
XMLReader xr = XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
and it's strange because on Windows it runs and there aren't problems about permissions on files, does anyone knows what to do?
thanks in advance!
StefanoWhat happens on that line? I'm assuming you get some kind of error or exception.
Make sure the JAR file for Crimson is in your classpath. -
Problem with XML in APEX ORA-06502
i, I have a problem with XML generation, I developed an application in APEX, and in a html page I have this process:
declare
l_XML varchar2(32767);
begin
select xmlElement
"iva",
xmlElement("numeroRuc",J.RUC),
xmlElement("razonSocial", J.RAZON_SOCIAL),
xmlElement("idRepre", J.ID_REPRE),
xmlElement("rucContador", J.RUC_CONTADOR),
xmlElement("anio", J.ANIO),
xmlElement("mes", J.MES),
xmlElement
"compras",
select xmlAgg
xmlElement
"detalleCompra",
--xmlAttributes(K.ID_COMPRA as "COMPRA"),
xmlForest
K.COD_SUSTENTO as "codSustento",
K.TPLD_PROV as "tpldProv",
K.ID_PROV as "idProv",
K.TIPO_COMPROBANTE as "tipoComprobante",
to_char(K.FECHA_REGISTRO, 'DD/MM/YYYY') as "fechaRegistro",
K.ESTABLECIMIENTO as "establecimiento",
K.PUNTO_EMISION as "puntoEmision",
K.SECUENCIAL as "secuencial",
to_char(K.FECHA_EMISION, 'DD/MM/YYYY') as "fechaEmision",
K.AUTORIZACION as "autorizacion",
to_char(K.BASE_NO_GRA_IVA, 9999999999.99) as "baseNoGraIva",
to_char(K.BASE_IMPONIBLE, 9999999999.99) as "baseImponible",
to_char(K.BASE_IMP_GRAV, 9999999999.99) as "baseImpGrav",
to_char(K.MONTO_ICE, 9999999999.99) as "montoIce",
to_char(K.MONTO_IVA, 9999999999.99) as "montoIva",
to_char(K.VALOR_RET_BIENES, 9999999999.99) as "valorRetBienes",
to_char(K.VALOR_RET_SERVICIOS, 9999999999.99) as "valorRetServicios",
to_char(K.VALOR_RET_SERV_100, 9999999999.99) as "valorRetServ100"
xmlElement
"air",
select xmlAgg
xmlElement
"detalleAir",
xmlForest
P.COD_RET_AIR as "codRetAir",
to_char(P.BASE_IMP_AIR, 9999999999.99) as "baseImpAir",
to_char(P.PORCENTAJE_AIR, 999.99) as "porcentajeAir",
to_char(P.VAL_RET_AIR, 9999999999.99) as "valRetAir"
from ANEXO_COMPRAS P
where P.ID_COMPRA = K.ID_COMPRA
AND P.ID_INFORMANTE_XML = K.ID_INFORMANTE_XML
xmlElement("estabRetencion1", K.ESTAB_RETENCION_1),
xmlElement("ptoEmiRetencion1", K.PTO_EMI_RETENCION_1),
xmlElement("secRetencion1", K.SEC_RETENCION_1),
xmlElement("autRetencion1", K.AUT_RETENCION_1),
xmlElement("fechaEmiRet1", to_char(K.FECHA_EMI_RET_1,'DD/MM/YYYY')),
xmlElement("docModificado", K.DOC_MODIFICADO),
xmlElement("estabModificado", K.ESTAB_MODIFICADO),
xmlElement("ptoEmiModificado", K.PTO_EMI_MODIFICADO),
xmlElement("secModificado", K.SEC_MODIFICADO),
xmlElement("autModificado", K.AUT_MODIFICADO)
from SRI_COMPRAS K
WHERE K.ID IS NOT NULL
AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
AND K.ID BETWEEN 1 AND 25
).getClobVal()
into l_XML
from ANEXO_INFORMANTE J
where J.ID_INFORMANTE =:P3_MES
and J.RUC =:P3_ID_RUC
and J.ANIO =:P3_ANIO
and J.MES =:P3_MES;
--HTML
sys.owa_util.mime_header('text/xml',FALSE);
sys.htp.p('Content-Length: ' || length(l_XML));
sys.owa_util.http_header_close;
sys.htp.print(l_XML);
end;
Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
declare
l_XML CLOB;
begin
--Oculta XML
sys.htp.init;
wwv_flow.g_page_text_generated := true;
wwv_flow.g_unrecoverable_error := true;
--select XML
select xmlElement
from SRI_COMPRAS K
WHERE K.ID IS NOT NULL
AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
).getClobVal()
into l_XML
from ANEXO_INFORMANTE J
where J.ID_INFORMANTE =:P3_MES
and J.RUC =:P3_ID_RUC
and J.ANIO =:P3_ANIO
and J.MES =:P3_MES;
--HTML
sys.owa_util.mime_header('text/xml',FALSE);
sys.htp.p('Content-Length: ' || length(l_XML));
sys.owa_util.http_header_close;
sys.htp.print(l_XML);
end;
The error generated is ORA-06502: PL/SQL: numeric or value error+_
Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+JohannaCevallos07 wrote:
Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
The error generated is ORA-06502: PL/SQL: numeric or value error+_
Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+The likeliest explanation for this is that length of the XML exceeds 32K, which is the maximum size that <tt>htp.p</tt> can output. A CLOB can store much more than this, so it's necessary to buffer the output as shown in +{message:id=4497571}+
Help us to help you. When you have a problem include as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
And always post code wrapped in <tt>\...\</tt> tags, as described in the FAQ.
Thanks -
I am facing a new problem with xml schema, plz help me
Hi @,
I am facing a problem with xml schema validation. Below is my code.
public void initialize(String cfgFileName) {
try {
try {
DOMParserWrapper parser = (DOMParserWrapper)Class.forName("dom.wrappers.DOMParser").newInstance();
parser.setFeature( "http://apache.org/xml/features/dom/defer-node-expansion",true );
parser.setFeature( "http://xml.org/sax/features/validation",true);
parser.setFeature( "http://xml.org/sax/features/namespaces",true );
parser.setFeature( "http://apache.org/xml/features/validation/schema",true );
parser.setFeature( "http://apache.org/xml/features/validation/schema-full-checking",true );
Document document = parser.parse(cfgFileName);
System.out.println("Vijay .. code .. damar\n");
}catch (org.xml.sax.SAXParseException spe) {
} catch (org.xml.sax.SAXNotRecognizedException ex ){
} catch (org.xml.sax.SAXNotSupportedException ex ){
} catch (org.xml.sax.SAXException se) {
if (se.getException() != null)
se.getException().printStackTrace(System.err);
else
se.printStackTrace(System.err);
}catch (Exception e) {
System.out.println("Caught unknown exception : \n");
e.printStackTrace(System.err);
System.out.println("Vijay .. code .. success\n");
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
//docBuilder.setErrorHandler(myErrorHandler);
cfg = docBuilder.parse(new File(cfgFileName));
cfg .getDocumentElement ().normalize ();
} catch (Exception e) {
e.printStackTrace();
In the above code I am parsing the xml file and i am doing schema validation. Schema validation is proper and it is validating correctly. Only problem is that, It is validating and showing error correctly correctly but it is not catching that error.
For clear understanding I am printing one statement before parsing and after parsing.
SYSTEM.OUT.PRINTLN("Vijay .. code .. damar\n") this is before parsing
SYSTEM.OUT.PRINTLN("Vijay .. code .. success\n") this is after parsing
Here what is happening means, It is validating correctly and showing error :
[Error] nw_layout-new.xml:800:97: Datatype error: Value 'y' does not match regular expression facet 'yes|no'..
Vijay .. code .. damar
Vijay .. code .. success
Here it is showing error and still continueing not catching.
Plz give solution for this.
Thanks
vijay KHello dipthebe,
Check out the articles below go through troubleshooting steps for your iPhone when the screen is unresponsive. You may want to try and restore your iPhone as a new device and then test out what happens when you miss a call to see if the issue is still present afterwards.
iPhone, iPad, iPod touch: Troubleshooting touchscreen response
http://support.apple.com/kb/ts1827
Use iTunes to restore your iOS device to factory settings
http://support.apple.com/kb/HT1414
Regards,
-Norm G. -
Problem with XML SQL JDBC adapter
Hello All.
I have quite strange problem with my PI.
Whole scenario is SOAP -> JDBC, asynchronous. Everything works fine on DEV server. After transporting objects (using CTS) to QA env I'm getting this error:
JDBC Message processing failed, due to Error processing request in sax parser:
No 'action' attribute found in XML document
(attribute "action" missing or wrong XML structure)
But document seems to be correct. I've compared it to DEV server documents - they are identical. What could be wrong??
Document looks like this:
<ns2:BIPMessage xmlns:ns2="http://mynamespace.com/xi/sn"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<synchSlLok>
<STATEMENTNAME>
<SYNCH_SL_LOK ACTION="INSERT">
<TABLE>SYNCH_SL_LOK</TABLE>
<ACCESS>
<ID_TRANS>22050</ID_TRANS>
<ID_LOK>1234</ID_LOK>
<ID_CBK>1000050911</ID_CBK>
<NR_LOK>1234</NR_LOK>
<OPIS_LOK>12312312312312</OPIS_LOK>
<TYP>D</TYP>
<OPERACJA>U</OPERACJA>
</ACCESS>
</SYNCH_SL_LOK>
</STATEMENTNAME>
</synchSlLok>
</ns2:BIPMessage>
TIA
Best Regads
MaciejHi,
i was also facing the same error few days back in a JDBC -RFC-JDBC Synchronous scenario. In that scenario, i was using 2 modules in JDBC sender module tab. It was working fine. later i change polling interval and then i started getting same error. it happened coz of sequence of Module got changed somehow.
So please check in Receiver JDBC adapter and SOAP sender adapter CC if anything is changed. If this scenario is working in DEV as it is then it should work after transport.
Else have a look here
Re: attribute "action" missing or wrong XML structure
JDBC - No 'action' attribute found in XML document - error
Regards
Aashish Sinha
Edited by: Aashish Sinha on Mar 15, 2011 10:42 AM -
Adapter Module: Validate an XML with an XSD
Hello all,
I'm developing a PI adapter module (Exchange Infrastructure 3.0) for the Mail Adapter. In this module I need to get each XML attachment and then validate with an XSD schema, for this I'm using the SAX parser.
I successfully retrieved all XML attachments but when I'm trying to use the method setProperty of the SAXParser instance I'm getting an exception, bellow the code snippet.
private static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
private static final String SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource";
private static final String XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
public boolean isValid(byte[] src, AuditMessageKey amk1){
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = null;
spf.setNamespaceAware(true);
spf.setValidating(true);
String[] schemas = new String[MAX_SCHEMAS];
schemas[0] = getClass().getResource(SCHEMA1).getFile();
schemas[1] = getClass().getResource(SCHEMA2).getFile();
schemas[2] = getClass().getResource(SCHEMA3).getFile();
try {
sp = spf.newSAXParser();
catch (Exception e){
Audit.addAuditLogEntry(amk1, AuditLogStatus.ERROR, "MultipleAttachments: Error creating parser.");
return false;
// HERE IS THE STEP THROWING THE EXCEPTION
try {
sp.setProperty(SCHEMA_LANGUAGE, XML_SCHEMA);
catch (Exception e){
Audit.addAuditLogEntry(amk1, AuditLogStatus.ERROR, "MultipleAttachments: Error setting schema.");
return false;
Did Anyone have faced this issue? How can I solve this?
Best regards,
DavidHi David,
we developed a xsd validation with java mapping.
SAP has it's own parser. At the time we developed there was a bad bug in this parser. The parser throwed a fatal error although the xml was valid!
SAP corrected the error. But this is over 1,5 years ago. I recommend a OSS .
Regards Mario -
Problem with XML loading and xmlns
I'm having a problem with loading an XML file that was created by Filemaker. Filemaker will output an XML file using one of two different grammars. One outputs in a mostly standard form that I can use with one glitch. Flash CS4 AS3 seems to have a problem with the xmlns in one of the nodes.
Specifically:
<FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult">
If I remove the xmlns="http://www.filemaker.com/fmpdsoresult" the file loads properly and I can access the various fields with no problem. However, when I leave the xmlns=... in, it will trace out the XML properly but I can't access the fields using the code listed below. This is driving me crazy!
With the xmlns part in the XML file I get the following error when it tries to load the thumbnail files:
TypeError: Error #1010: A term is undefined and has no properties.
I need to have it so that the user can enter/edit data and simply output the XML file from Filemaker and then Flash will load up the unaltered XML file and show the info requested by the user. That is to say I could have the user open the XML file in a word processing application and have them delete the xmlns..., but that is rather cumbersome and not very user friendly.
I've tried every xml.ignore function I could find but it doesn't help. Hopefully someone out there can help
Thanks,
-Mark-
Partial XML:
XML From Filemaker Export:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This grammar has been deprecated - use FMPXMLRESULT instead -->
<FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult">
<ERRORCODE>0</ERRORCODE>
<DATABASE>Sport.fp7</DATABASE>
<LAYOUT></LAYOUT>
<ROW MODID="1" RECORDID="1">
<FirstName>Mark</FirstName>
<LastName>Fowle</LastName>
<Sport>Sailing</Sport>
<Medal>None</Medal>
<CourseOfStudy>Design</CourseOfStudy>
<Year>1976-1978</Year>
<HomeState>California</HomeState>
<ImageName>93</ImageName>
</ROW>
</FMPDSORESULT>
AS3 Code:
import fl.containers.UILoader;
var aPhoto:Array=new Array(ldPhoto_0,ldPhoto_1,ldPhoto_2,ldPhoto_3,ldPhoto_4,ldPhoto_5);
var toSet:int=10;//time out set time
var toTime:int=toSet;
var photoPerPage:int=6;
var fromPos:int=photoPerPage;
var imgNum:Number;
//var subjectURL:URLRequest=new URLRequest("testData_FM8.xml");
var subjectURL:URLRequest=new URLRequest("Sports.xml");
var xmlLoader:URLLoader=new URLLoader(subjectURL);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
var subjectXML:XML = new XML();
subjectXML.ignoreWhitespace=true;
subjectXML.ignoreComments=true;
subjectXML.ignoreProcessingInstructions=true;
function xmlLoaded(evt:Event):void {
subjectXML=XML(xmlLoader.data);
if (root.loaderInfo.bytesTotal==root.loaderInfo.bytesLoaded) {
removeEventListener(Event.ENTER_FRAME, xmlLoaded);
trace("XML Data File Loaded");
trace(subjectXML);
} else {
trace("File not Found");
imgNum=2;//subjectXML.ROW.length;
trace(subjectXML);
loadThumb(0);
function loadThumb(startPos:int):void {
var count:Number=aPhoto.length;
trace(subjectXML.DATABASE);
for (var i=0; i<count; i++) {
try{
aPhoto[i].source="images/"+subjectXML.ROW[startPos+i].ImageName+"_main.jpg";
}catch (e:Error){
trace(e);
aPhoto[i].mouseChildren=false;
aPhoto[i].addEventListener(MouseEvent.MOUSE_DOWN, onThumbClick);
trace("Current mem: " + System.totalMemory);
ldAttract.visible=false;
function unloadThumb():void {
var count:Number=aPhoto.length;
for (var i=0; i<count; i++) {
aPhoto[i].unload();
aPhoto[i].removeEventListener(MouseEvent.MOUSE_DOWN, onThumbClick);
trace("Current mem: " + System.totalMemory);
function onThumbClick(evt:MouseEvent) {
var i:Number;
//trace("Thumbnail Clicked " + evt.target.name);
i=findPos(evt.target.name);
ldLrgPhoto.source="images/"+subjectXML.ROW[i+fromPos].LOCAL_OBJECT_ID+"_main.jpg";
ldLrgPhoto.visible=true;
btnPrev.visible=false;
btnNext.visible=false;
gotoAndStop("showPhoto");
function findPos(thumb:String):Number {
var pos:Number;
var count:Number=aPhoto.length;
for (var i:Number=0; i<count; i++) {
if (thumb==aPhoto[i].name) {
pos=i;
return pos;Hi,
I was trying to use xml namespaces, so in my application I receive an XML file from the server. The file has a namespace, so when I parse the file I need to specify the namespace:
I got the following piece of xml:
<ls:exchange xmlns:ls=".../tsw" xmlns:tm="http://kxa">
<ls:projects>
<tm:annotation id="" date="" action="getprojects" status="responseok"/>
<ls:project id="" name="proj" description="..." owner="asss" release="2" />
<ls:projectV id="" version="" creationdate="" modificationdate=""/ >
</ls:project>
</ls:projects>
</ls:exchange>
and the following code
<mx:VBox label="WELCOME" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Tree id="tree" dataProvider="{srv.lastResult.project}" labelField="@name" width="300" height="100%" itemOpen="itemOpenEvt(event);" />
</mx:VBox>
So i want to display the content of the xml (project nodes”) in a tree view, but i don’t know how to includes the namespace"ls:" in the data provider “srv.lastResult.project”. can u help me it’s urgent.
sincerly
Celine -
Creating J2EE adapter module problem
Hi All,
when i am creating a J2EE customer-specific adapter module in SAP Netweaver Developer Studio, then in the java class when i write these statements:
<u>import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;</u>
public class CustomerMeter implements SessionBean, <u>Module</u>{
it is showing error on the above underlined things that it cannot resolve these things.
can anybody suggest where to locate these librarys in Project - Properties - Java Build Path - Libraries path from the main menu.
Thanks,
Rajeev GuptaHi Amit,
On changing the ejb-jar.xml as you said:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>CustomerMeter</ejb-name>
<ejb-class>pkgCustomerMeter.CustomerMeter</ejb-class>
<home>com.sap.aii.af.mp.module.ModuleHome</home>
<remote>com.sap.aii.af.mp.module.ModuleRemote</remote>
<local-home>com.sap.aii.af.mp.module.ModuleLocalHome</local-home>
<local>com.sap.aii.af.mp.module.ModuleLocal</local>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
But now on saving this xml, it is giving the following error:
<b>The content of element type "session" must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,ejb-class,session-type,transaction-type,env-entry,ejb-ref,ejb-local-ref,security-role-ref,security-identity?,resource-ref,resource-env-ref)".</b>
Could you please tell how to correct this error.
Thanks and Regards,
Rajeev Gupta -
Mail Adapter Module Problem!
Hi All
I m facing a problem in implementing a custom mail adapter module.
The scenario is to set the content type based on the file type. eg: if the file being sent is a pdf then content type should be "application/pdf".
I hope the scenario is clear, please feel free to ask for clarifications.
awaiting your replies.
Regards
KapilHi All
I am able to fetch the file name now and set the content type based on the file name. But I m not able to change the name of attachment of mail. For reference, I m pasting the code here, please suggest how to do the latter part
try {
// CS_GETCHADAT START
cid = moduleContext.getChannelID();
Channel channel = new Channel(cid);
// Example to access a channel configuration parameter in a module: String someParameter = channel.getValueAsString("YourAttributeName");
// CS_GETCHADAT END
fileName = msgg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
Payload attachment = msgg.getAttachment("MainDocument");
StringTokenizer st = new StringTokenizer(fileName, ".");
while(st.hasMoreTokens()){
extension = st.nextToken();
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: filename " + fileName);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: extension " + extension);
// create new payload
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: attchmntName " + attachment.getName().toString());
//provide attributes and content for the new payload
attachment.setName("Attachment :" + fileName);
// msgg.setMessageProperty("http://sap.com/xi/XI/System/File","content-description",fileName);
attachment.setContentType("application/" + extension );
inputModuleData.setPrincipalData(msgg); -
Hi All,
Thanks in advance for ur warm replies.
I am exporting personalizations which i did but iam facing problems with this.
Please help me on this issue.
Steps i follwed.
Step1: exec jdr_utils.listcustomizations('/oracle/apps/ego/item/eu/webui/EGOITEMATTRIBUTEPGL');
It displays me the customizations which i did as follows
/oracle/apps/ego/item/eu/webui/customizations/responsibility/24091/EGOITEMATTRIBUTEPGL
Pl/sql procedure completed successfully.
Step2: Iam now at command prompt on java_top and i run the following command
java oracle.jrad.tools.xml.exporter.XMLExporter
/oracle/apps/ego/item/eu/webui/customizations/responsibility/24091/EGOITEMATTRIBUTEPGL
-username apps -password <mypwd> \
-dbconnection "(description=(address_list=(address=(protocol=tcp)(host=<host>)(port=<myport>)))(connect_data=(sid=<mysid>)))" \
-rootdir "/oracle/apps/ego/item/eu/webui/EGOITEMATTRIBUTEPGL'"
* I don't know exactly what is root directory here. which path i need to provide here.*
Error: No such file or directory.
Thanks and Regards
ZaheerZaheer,
<output_dir> - (Required) Output directory where the exported xml file structure is to be stored. You may set this to any directory, however, we recommend that you export your packages or XML files to $APPL_TOP/personalizations.
If you run the export tool for the package
/oracle/apps/ak/dem/webui/customizations/site/0/REQORDERSTATUSPAGE and specify -rootdir
$APPL_TOP/personalizations, the xml file is saved as
$APPL_TOP/personalizations/oracle/apps/ak/dem/webui/customizations/site/0/REQORDERSTATUS PAGE.xml.
In your case define rootdir as rootdir "/oracle/apps/ego/item/eu/webui ".
Thanks
--Anil -
Jbuilder compiler problem with xml DOM - please help.
my problem is that I am using jbuilder 4 professional to compile/run my code.
However I want to use the XML DOM but jbuilder does not appear to support the necessary packages for use with XML.
How can I get round this.
Can I compile instead from the command line - I am using JDK1.4 which supports the java xml packages necessary. Or is there a way of adding the necessary files to my project?
thanks, BAdd the required jar files to your project properties->classpath in JBuilder
The only problem is that. I have been using JBuilder without any problems. -
Problem with XML Parser For Java V2
Get message:
<Line 5, Column 40>: XSD-2021: (Error) Element not completed: 'doesNotWork'
Parser Exception: Element not completed: 'doesNotWork'
Element 'doesNotWork' is defined the same as 'works' except 'doesNotWork' uses a ref="" rather than defining element inline.
This appears to be a bug in the parser.
XML:
<?xml version ="1.0"?>
<example>
<works anAttribute="something"/>
<doesNotWork anAttribute="something"/>
</example>
Schema:
<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema xmlns:xsd = "http://www.w3.org/2000/10/XMLSchema">
<xsd:element name = "example">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="works">
<xsd:complexType>
<xsd:attribute name = "anAttribute" use = "required" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element ref = "doesNotWork"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name = "doesNotWork">
<xsd:complexType>
<xsd:attribute name = "anAttribute" use = "required" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>Hi all,
I am getting the same error. Is the schema parser being actively suppported. From replies to problems, it does not seem like it is. Also I am still having problems with 'required', ID attributes etc. Is there comprehensive documentation of what is and what is not supported.
Any help appreciated
Thanks
Venu -
Problems with xml and j2sdk-1.5
Hello everyone,
until i upgraded my version of the jdk (from 1.4.2 to 1.5.0) everything was working fine concerning xml-processing. Now i am having problems with at least two methods that were working just fine before the upgrade.
public void createRootElement(String s) {
Element root = doc.createElement(s);
doc.appendChild(root);
//that was the first one
public void addFirstChildElement(String element, String node) {
Element root = doc.getDocumentElement();
System.out.println("Rootelement: "+root.toString()+" Element: "+element+" node: "+node);
try {
Element nextElement = doc.createElement(element);
System.out.println("Nextelement "+nextElement.toString());
root.appendChild(nextElement);
nextElement.appendChild(doc.createTextNode(node));
catch (DOMException e) {
e.printStackTrace();
//the second onethe problem is now that for some reasong nothing is written into the xml document except "<?xml version='1.0' encoding='UTF-8' ?>".
The result of the System.out.println command in the second method is:
Rootelement: [Preferences: null] Element: DefaultLanguage node: de
As i mentioned already everything was fine before the upgrade, but now i really don't have a clue what's wrong...
Any ideas?
Thanks in advance...It seems that the toSring() method doesn't print out the complete XMl structure. anymore.
Only some "debug" information is printed.
You have to use a transfomer (text transfomer) to print out the XML in text form... -
Problems with XML Instance Generator
Hi.
I still have problems with the XML instance Generator. I had the problem other people have commented here before:
parsing a grammar: newspaper.dtd
generating document #1
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer
at com.sun.msv.generator.Driver.run(Unknown Source)
at com.sun.msv.generator.Driver.main(Unknown Source)
I read somewhere that xercesImpl.jar was necessary. I have downoladed a version of it of about 3 Mb size, and now the message I receive is the following:
parsing a grammar: newspaper.dtd
generating document #1
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/ranges/DocumentRange
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:272)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.newDocume
nt(DocumentBuilderImpl.java:206)
at com.sun.msv.generator.Driver.run(Unknown Source)
at com.sun.msv.generator.Driver.main(Unknown Source)
after executing the command: java -jar xmlgen.jar -dtd newspaper.dtd
All .jar files coming with the xmlgen.zip are in the same directory where I type the command. Does anybody know what am I doing wrong?
Thanks to all.Hi,
I am also getting the same problem.
Thanks
-Manoj -
Hi everybody.
Sorry, I've got a french accent, then if you don't understand, dont' be worry ^^
I try using the apache's xmpl-rpc package, and I have got some problems with the xml-rpc client.
Here my source :
public interface ICalculator {
public int add(int i1, int i2);
public int subtract(int i1, int i2);
public class Calculator implements ICalculator {
public int add(int i1, int i2) {
return i1 + i2;
public int subtract(int i1, int i2) {
return i1 - i2;
import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcServer;
import org.apache.xmlrpc.server.XmlRpcServerConfigImpl;
import org.apache.xmlrpc.webserver.WebServer;
public class Server {
private static final int port = 8080;
public static void main(String[] args) throws Exception {
WebServer webServer = new WebServer(port);
XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler(Calculator.class.getName(), Calculator.class);
phm.addHandler(ICalculator.class.getName(), ICalculator.class);
xmlRpcServer.setHandlerMapping(phm);
XmlRpcServerConfigImpl serverConfig =
(XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
serverConfig.setEnabledForExtensions(true);
serverConfig.setContentLengthOptional(false);
webServer.start();
System.out.println("Serveur XML-RPC is ready");
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory;
import org.apache.xmlrpc.client.util.ClientFactory;
public class Client {
public static void main(String[] args) throws Exception {
// create configuration
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("http://127.0.0.1:8080/xmlrpc"));
config.setEnabledForExtensions(true);
config.setConnectionTimeout(60 * 1000);
config.setReplyTimeout(60 * 1000);
XmlRpcClient client = new XmlRpcClient();
System.out.println("Connection");
// use Commons HttpClient as transport
client.setTransportFactory(
new XmlRpcCommonsTransportFactory(client));
// set configuration
client.setConfig(config);
ClientFactory factory = new ClientFactory(client);
ICalculator calc = (ICalculator)factory.newInstance(ICalculator.class); //Problems here !!!
System.out.println("Calculing");
System.out.println("Result : " + calc.add(2, 3));
And the error is:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException
at org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory.getTransport(XmlRpcCommonsTransportFactory.java:31)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)
at org.apache.xmlrpc.client.util.ClientFactory$1.invoke(ClientFactory.java:104)
at $Proxy0.add(Unknown Source)
at projet.Client.main(Client.java:45)
Can you help please ?The problem is not related to your code, but it seems that there is a missing jar which contains the class org.apache.commons.httpclient.HttpException or perhaps the jar isn't included in your CLASSPATH.
The jar seems to be commons-httpclient.jar you can found at http://jakarta.apache.org/commons/httpclient
Maybe you are looking for
-
We have two different iTunes account, how can we share the songs?
-
AirPort Extreme & USB Hard Drive Time Machine Backups
Hi everyone. I'm a brand spanking new MacBook Pro owner and am looking at ways to backup my machine and to save my films, photos and files on a wireless network that is available to everyone in my home. I'm the first to admit that I'm not the most co
-
Error in Creating Purchase Order (ME21N)
Dear Experts, A pleasant day to all of you! I would like to ask help because when I try to save Purchase Order, error messages "There is an error in the specifications for area 04 in co. code XXXX". Message no. AC391 Diagnosis You specified for depre
-
Hello I am trying to test SCCM client push installation. I used active directory system group discovery as discovery method. All clients(windows 2008 r2) that were on the same subnet reported fine on collection and installed client through client pus
-
HP Laserjet 3050 does not install on MacBook Pro Yosemite
Unable to install printer. Get the following error message: Unable to find the appropriate software after running software update. But the software shows up in my updates? Thanks for feedback. This question was solved. View Solution.