cancel
Showing results for 
Search instead for 
Did you mean: 

J2SE XML to Flat File Content Conversion

Former Member
0 Kudos

Hi

I've currently got a scenario which sends a flat file to the integration server, it gets mapped and sent to a receiver adapter on a deployed j2se engine.

I'm now trying to convert the xi-xml structured file to a flat file again on the j2se side (the same flat file format it originally had).

My original flat file looks like this -

477

477=AA1

My xml file looks like this -

<?xml version="1.0" encoding="UTF-8"?>

<ns0:ResultMessage xmlns:ns0="urn:xxxx-com:a_test_j2se_filetofile">

<Item>

<field1>477</field1>

</Item>

<Item>

<field1>477</field1>

<field2>AA1</field2>

</Item>

</ns0:ResultMessage>

I am using these content conversion parameters:

xml.addHeaderLine=0

xml.fieldSeparator==

xml.endSeparator='nl'

I get this error on the integration engine (sxmb_moni):

Error while sending by HTTP (error code: 500, error text: Internal Server Error:java.lang.NullPointerException) (See attachment HTMLError for details)

and the j2se adpater log says this:

17:16:32 (4120): Message "13b9d644-54c9-4ffb-0c40-db4c14458d77" of type "application/xml", kind "B" received

17:16:32 (4124): Parsing XML message

17:16:32 (4131): ERROR: Message processing failed with "java.lang.NullPointerException"

What am i missing?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Patch it with SAPXICONS23_0-20000271.SCA

Former Member
0 Kudos

Please provide the complete configuration of your channel in J2SE

Former Member
0 Kudos

This is the current full j2se file receiver config:

    1. File adapter java class

classname=com.sap.aii.messaging.adapter.ModuleXMB2File

version=30

mode=XMB2FILEWITHCONVERSION

#----


#Adress for XMB endpoint -

#----


XI.httpPort=8111

XI.httpService=http://<host>:8111/file/receiver

#----


#File Adapter specific parameters -

#----


file.createDir=1

file.targetDir=E:
xitest
File Receive

file.targetFilename=xmboutput.txt

#file.writeMode=append

#file.writeMode=overwrite

file.writeMode=addCounter

file.counterMode=immediately

#file.counterMode=afterFirst

file.counterSeparator=_

file.counterFormat=00000

file.counterStep=1

#----


#File Content Conversion specific parameters -

#----


xml.addHeaderLine=0

xml.fieldSeparator='0x0B'

xml.endSeparator='nl'

Former Member
0 Kudos

Did a normal file transfer of your message to your J2SE adapter work?

Former Member
0 Kudos

Yes it did.

The output is the xml is specified in my first post.

Former Member
0 Kudos

So, now my J2SE runs again (I was searching for the right JDK...)

I copy&pasted your configuration and after restarting the adapter, the configuration was at least initialized and the adapter started. Can you confirm that with your J2SE too?

Former Member
0 Kudos

Yes, my config works. The J2SE adpater initializes and starts

Former Member
0 Kudos

So, now... I did a test configuration in XI and sent your test-payload...it worked.

The J2SE adapter configuration:

____________________________

    1. File adapter java class

classname=com.sap.aii.messaging.adapter.ModuleXMB2File

version=30

mode=XMB2FILEWITHCONVERSION

#----


#Adress for XMB endpoint -

#----


XI.httpPort=8111

XI.httpService=/file/receiver

#----


#File Adapter specific parameters -

#----


file.createDir=1

file.targetDir=c:/transfer/inbound

file.targetFilename=xmboutput.txt

#file.writeMode=append

#file.writeMode=overwrite

file.writeMode=addCounter

file.counterMode=immediately

#file.counterMode=afterFirst

file.counterSeparator=_

file.counterFormat=00000

file.counterStep=1

#----


#File Content Conversion specific parameters -

#----


xml.addHeaderLine=0

xml.fieldSeparator==

xml.endSeparator='nl'

____________________________

And here the configuration of the receiver communication channel in the integration directory:

____________________________

Adapter Type: XI

Receiver

Transport-Protocol: HTTP 1.0

Message-Protocol: XI 3.0

Adapter-Engine: Integration Server

Adressing-Type: URL Address

Target Host: <yourJ2SEip>

Service Number: 8111

Path Prefix:http://<yourJ2SEip>:8111/file/receiver

Authentication Data

Logon data for non-SAP systems

User

Password

____________________________

That's it... sent your payload and got the wished result:

477

477=AA1

Regards,

Heinrich

Former Member
0 Kudos

This is very confusing. Our configs on both the J2SE and Integration Server sides are the same but still i'm getting the original null pointer exception error.

The only other thing i can think of is that perhaps the installation of the adpater engine is somehow wrong.

Initially i couldnt get it to run as a service and ha dto modify the batch file which installs it as a service to reflect the same jars as the manual adapter install batch file.

Once i did that it worked.

I dont think its that though. Did you at stage patch your j2se adapter engine?

Can you think of anything else?

Former Member
0 Kudos

I think you should reinstall and check your J2SE adapter engine. The configuration of the adapter itself seems to be appropriate. I can't give you more hints about basis J2SE configuration. I'm using an installation that runs for years now.

What XI and J2SE version are you using? These information could be helpful for others that may help you on the J2SE configuration.

By the way, did you see this topic?

Former Member
0 Kudos

Hi

I've patched my J2SE adapter with SAPXICONS23_0-20000271.SCA and it's working perfectly now.

Thanks for all the help

Former Member
0 Kudos

Try this:

Item.addHeaderLine=0

Item.fieldSeparator='0x0B' or '='

Item.endSeparator='nl'

What "mode" did you chose? "XMB2FILEWITHCONVERSION" or "XMB2FILEWITHROWCONVERSION"?

Former Member
0 Kudos

Hi

Like i said before using anything but xml.<property> gives me this error:

Parameter 'xml.addHeaderLine' is missing (4403)

Invalid 'addHeaderLine' value 'null' found

So using Item.addHeaderLine=0 doesnt seem to work.

The j2se adpater engine forces me to use xml.<property> (as described in the documentation).

I've tried using both XMB2FILEWITHCONVERSION and XMB2FILEWITHROWCONVERSION. No results

GabrielSagaya
Active Contributor
0 Kudos

Please use the following

Item.addHeaderLine=0

Item.fieldNames=field1,field2

Item.fieldSeparator= =

Item.endSeparator='nl'

Former Member
0 Kudos

Hi Guys

I've tried both your sugestions with no result.

Using:

Item.endSeparator = 'nl'

Item.fieldSeparator = =

Gives me this error:

09:29:07 : Error(s) in adapter configuration parameters found:

Conversion initialization failed with "java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: (4408)

Parameter 'xml.addHeaderLine' is missing (4403)

Invalid 'addHeaderLine' value 'null' found (4407)

"(4022_E_YLOG)

09:29:07 (4108): Unable to start file adapter (not initialized)

And using:

Item.addHeaderLine=0

Item.fieldNames=field1,field2

Item.fieldSeparator= =

Item.endSeparator='nl'

Gives me the same initialization error.

If i swap back to using 'xml' instead of 'Item' the adpater can start but then i still get the original error.

According to the adapter documentation you're supposed to use 'xml'. Has using anything worked for you guys?

Former Member
0 Kudos

Hi,

Try using,

Item.endSeparator = 'nl'

Item.fieldSeparator = =

instead of xml.endSeparator

and xml.fieldSeparator

Edited by: sivasakthi danasekaran on Apr 1, 2009 6:23 PM

Edited by: sivasakthi danasekaran on Apr 1, 2009 6:55 PM