cancel
Showing results for 
Search instead for 
Did you mean: 

ResourceNotReadyException in CreateSfcService.createSfc(..)

Former Member
0 Kudos

Hello,

I wrote a webservice (EJB 3, not ME service) for SAP ME 6.1 using NWDS/NWDI. The webservice uses PAPI services only.

This webservice imports large files with assembly data sets, parses them and creates items, SFCs and does the ME assembly.

If an item in the file does not exist in SAP ME yet, the webservice has to create it and modify the SFC-BOM of the parent SFC. Afterwards the webservice creates the component SFC and assembles it to the parent SFC.

Therefore the webservice calls both configuration services (ItemConfigurationService, ...) and production services (CreateSfcService, ...) in the same "session".

Now the problem:

  1. ItemConfigurationService.createItem(...): Create a new Item
  2. CreateSfcService.createSfc(...):  Create a SFC for this new Item
  3. CreateSfcService.createSfc(...): Throws a ResourceNotReadyException

But if the item already exists, the CreateSfcService works. I changed my webservice to bean managed transaction and added a userTransaction.commit() after the ItemConfigurationService, but the ResourceNotReadyException still gets thrown.

Is there something like a special "ME service commit"? Any ideas how this can be done in one session?

Best regards,

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

A webservice with bean managed transaction was the correct idea. I just had some more technical problems to solve to make it work.

Answers (1)

Answers (1)

Former Member
0 Kudos

Could you please clarify how step 3 is different from step 2?

ResourceNotReadyException is thrown whenever resource is not in production state to start or complete SFC.

Thanks,
Bakhtiyar

Former Member
0 Kudos

Hi,

3 is not a step, it's the consequence of step 1 and step 2

Better:

1. ItemConfigurationService.createItem(...)

  • Create a new Item

2. CreateSfcService.createSfc(...):

  • Try to create a SFC for this new Item
  • Throws a ResourceNotReadyException

The resource status is Enabled (301) and the setup state is Open in table RESRC. And there is no record in RESOURCE_SETUP for this resource. Is there another table to check?

If I call both services independently - for testing as webservices with SOAPUI - createSFC works. Only if the services are called in a single webservice (stateless session bean), the ResourceNotReadyException gets thrown.

Best regards,

Martin