cancel
Showing results for 
Search instead for 
Did you mean: 

SMP3 - Custom service failed

Former Member
0 Kudos

Dear All,

I had SMP3.0 SP07 PL02 server, I follow a guide for implement my first project. I had CUSTOM and BEP Service setup on the cockpit (ZFLIGHT_PROJECT and ZBAPI) like the following:

ZBAPI Service is calling the same FM and deployed by  Java IDE. I able to "open source document" for BEP Service like the following

But I'm not able to "open source document" for ZBAPI that deployed via JAVA IDE like the following with error "Internal_server_error":

Please advise.

Thank you.

Regards

Marcus

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi JK and Pavel,

Currently I'm able to create Custom and BEP services in IGW, possible I can know how is the linkage/purpose between Custom and BEP and how to consume these service in iOS development?

I will open another discussion but i hope i can get some idea before open the new discussion.

Regards,

Marcus

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can try with publicly available service as mentioned here

You dont need to check message.log, startup.log file, should look into xxx-smp-server.log

Former Member
0 Kudos

Following is the xxx.smp-server.log but as mentioned previously, the last update was 4th of Jun 2015.

2015 06 04 19:04:36#+0800#ERROR#com.sap.gateway.core.service.repository.api.ServiceRepositoryAPIHandler##anonymous#Framework Event Dispatcher###[Gateway][TECHNICAL][ApiHandlerGetServiceFailed]:Error in getting the service. Exception: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory. |

2015 06 04 19:04:36#+0800#ERROR#com.sap.gateway.core.service.repository.api.ServiceRepositoryAPIHandler##anonymous#Framework Event Dispatcher###java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory. com.sap.gateway.core.service.exception.ServiceRepositoryException: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.

  at com.sap.gateway.core.service.dao.CustomServiceDAO.getService(CustomServiceDAO.java:38)

  at com.sap.gateway.core.service.repository.api.ServiceRepositoryAPIHandler.getServiceEntity(ServiceRepositoryAPIHandler.java:232)

  at com.sap.gateway.core.service.ljs.registry.ServiceRegistrationActivator.bundleChanged(ServiceRegistrationActivator.java:143)

  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847)

  at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)

  at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.verifyOpen(EntityManagerFactoryDelegate.java:306)

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:289)

  at com.sap.gateway.core.service.dao.DBPersistence.getEntityManager(DBPersistence.java:136)

  at com.sap.gateway.core.service.dao.CustomServiceDAO.getService(CustomServiceDAO.java:22)

  ... 5 common frames omitted

|

2015 06 04 19:04:36#+0800#ERROR#com.sap.gateway.core.service.ljs.registry.ServiceRegistrationActivator##anonymous#Framework Event Dispatcher###[Gateway][TECHNICAL][LjsSrvRegGetSrvError]:Error in getting registered service. Exception: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory. |

2015 06 04 19:04:36#+0800#ERROR#com.sap.gateway.core.service.ljs.registry.ServiceRegistrationActivator##anonymous#Framework Event Dispatcher###java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory. com.sap.gateway.core.service.api.exception.ServiceRepositoryAPIException: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.

  at com.sap.gateway.core.service.repository.api.ServiceRepositoryAPIHandler.getServiceEntity(ServiceRepositoryAPIHandler.java:239)

  at com.sap.gateway.core.service.ljs.registry.ServiceRegistrationActivator.bundleChanged(ServiceRegistrationActivator.java:143)

  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847)

  at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)

  at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

Caused by: com.sap.gateway.core.service.exception.ServiceRepositoryException: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.

  at com.sap.gateway.core.service.dao.CustomServiceDAO.getService(CustomServiceDAO.java:38)

  at com.sap.gateway.core.service.repository.api.ServiceRepositoryAPIHandler.getServiceEntity(ServiceRepositoryAPIHandler.java:232)

  ... 4 common frames omitted

Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.verifyOpen(EntityManagerFactoryDelegate.java:306)

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)

  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:289)

  at com.sap.gateway.core.service.dao.DBPersistence.getEntityManager(DBPersistence.java:136)

  at com.sap.gateway.core.service.dao.CustomServiceDAO.getService(CustomServiceDAO.java:22)

  ... 5 common frames omitted

|

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I dont get much hint from log text. Looping to share his understanding.

If you have access to marketplace, you may raise a support ticket.

PavelPenaz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear Choong,

The ZSFLIGHT_SERVER_PROJECT BEP service, I wonder why it has namespace SAP in your Gateway cockpit. This is the service you registered from your cockpit, from the MD1 destination I would assume? In my test, this should always have namespace IWBEP. Do you know why there is namespace SAP instead?


How is your destination configured please?


Otherwise the debug logs for Integration Gateway should be in Gateway Cockpit, under troubleshooting, as per the screenshot attached. Can you look there too if there are any useful logs?

Thanks.

Pavel

Former Member
0 Kudos

Hi Pavel,

Thanks for reply. The ZSFLIGHT_SERVER_PROJECT BEP service namespace is automatic added when i register service at cockpit. Will it possible that i install the IWBEP in SAP ECC and expose the OData services so that the name space is SAP?


To avoid confusion, I redeploy the custom service namespace to IWBEP and following is the latest screen shot.

My Destination was configure as MD1 and configure the URL as http://serverdomain/sap/iwbep?sap-client=100. Its ping successfully like the following:

Thanks for pointing the correct Integration Gateway and it display log on the cockpit like the following:

Error : while trying to invoke the method com.sap.gateway.core.api.srvrepo.IServiceInfo.getServiceName() of a null object loaded from local variable 'serviceInfo'

Regards,

Choong

Former Member
0 Kudos

Hi JK and Pavel,

I did try to use the demo service available on SAP Gateway Demo system and deploy as same as your guide provided like the following:

But i failed with the same error when i access the following:

https://server:8084/gateway/odata/SAP/SAMPLEFLIGHT;v=1/CarrierCollection('AA').

Hope someone can support me.

Regards,

Marcus

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

What error message you see? I would ask you check step #5 as per guide

Name: RMTSAMPLEFLIGHT

Namespace: IWBEP

PavelPenaz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Marcus,

I tried the same steps on my local installation, as per the guide, and for me it works.

Please, check the following three steps first and let me know.

1. Change target runtime to SP07 in Eclipse

2. In Eclipse create the Data Source for CarrierCollection entity set as follows:

3. Redeploy the project to IGW, under namespace SAP.

4. Test with URL: https://smp30pp:8083/gateway/odata/SAP/SAMPLEFLIGHT;v=1/CarrierCollection('AB')

Note that in your URL above, you have 'AA', but there is no Carrier with 'AA' ID, so use 'AB' instead please.

Fingers crossed! Pavel

Former Member
0 Kudos

Hi JK and Pavel,

Thanks for your advise. Following is the step i change the data source and deploy as NameSpace = SAP.

Change the URL to /CarrierCollection('AB') the following is the outcome.

Regards

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

seems you were in hurry and entered wrong name. Please check it again

Former Member
0 Kudos

Awesome.. That is my typo on the data source name and currently my SMP server able to work with SAP Gateway Demo System.

Back to OData in my SAP gateway, based on the SAP Gateway testing, it proved that my SMP server is working without error. Can you suggest how to troubleshooting the SAP gateway?

Regards

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Great!!

How is your SAP landscape? Is it an embedded system or hub deployment (frontend and backend)?

Lets try this:

1. Delete both services ZBAPI and ZSFLIGHT_PROJECT_SRV from Registered Services list

2. Register it again (directly on IGW > Register>Search) >> Are you able to execute it?

Can you configure debug logging for IGW and check the Troubleshooting section? As per the procedure below?

Regards,

JK

Former Member
0 Kudos

Hi JK,

My landscape is install all the IWFND, IWCBS, IWCNT, IWSCS, IWBEP into SAP ECC 6 (This is embedded ?)

Besides, i tried to delete both services and register a new service like the following:

As posted before, it working well when i test the "open source document".

Regards,

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I wonder why Namespace was not popping up for ZSFLIGHT_PROJECT_SRV service as per 1st screenshot.

btw, you are able to run EntitySet result for this service? right?

Former Member
0 Kudos

Yes, im able to run the EntitySet for this service.

PavelPenaz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Choong,

Please try as follows:

1. In Eclipse create a new project for runtime SP07 - with any name

2. New ODATA Model, any name, select type ODC, ODATA Service URL: use your full URL for the ZSFLIGHT_PROJECT_SRV service (does the URL: contain /sap/opu/odata/sap/ or /sap/opu/odata/IWFND/ or /sap/opu/odata/IWBEP/?)

3. Create Data Source as follows (and use SAP as NameSpace) for all the entity sets, assuming that the ODATA service URL contains SAP and not IWFND or IWBEP:

4. Deploy to IGW with any name and SAP namespace (here the namespace does not really make a big difference).

PS. I tried with my GW service, that is in SAP namespace (not IWBEP or IWFND), then it also shows namespace as empty in search services - but using SAP, as namespace in Eclipse, works for me.

Fingers crossed!

Pavel

Former Member
0 Kudos

Hi Pavel,

Thanks for the step and it did alert me of something which help me solve my problem.

Following is my root cause and hope it help can the others:

My root cause is because my SMP server is SP07 PL02 but my project created in Eclipse IDE is SP06.

So I update my SAP Development tools in Eclipse and create oData Project with SP07 did solve my problem.

Regards

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you double check the settings for that particular entitySet? Check step #5 as per

Make sure for below matching:

Name:ZSFLIGHT_PROJET_SRV

Namespace: IWBEP (should match with Registered service in GW cockpit)

Regards,

JK

Former Member
0 Kudos

Hi JK,

Thanks for you advise. The setting is same with the GW Cockpit like the following.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I was talking about below screen settings:

Do you see below details?

Name:ZSFLIGHT_PROJET_SRV

Namespace: IWBEP

Former Member
0 Kudos

Hi JK,

Thanks for your clarify, Following is my data source detail screen shot.

Do I need to change the name to "ZSFLIGHT_PROJET_SRV" ?

Regards

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

yes, this is where you are binding OData model entitySets to backend. (it has to be done for all EntitySets for ODC data source )

Once done, redeploy and test.

Former Member
0 Kudos

Hi JK,

I change the name to ZSFLIGHT_PROJET_SRV for all the EntitySets, redeploy the project and restart the SMP Server.

It get the same problem when I retest. Is there any others setup missing?

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am assuming you have done that changes for both entitysets CarrierSet and FlightSet

Are you able to execute individual entity sets?

url: https://host:port/gateway/odata/SAP/ZBAPI;v=1/CarrierSet

https://host:port/gateway/odata/SAP/ZBAPI;v=1/FlightSet

Try deploying again with changing its version.

Is that service publicly available if i want to check at my end?

Increase server log settings for Integration Gateway in Admin cockpit to deug and Trace>Enabled. If error persists, look into logs.

Regards,

JK

Former Member
0 Kudos

Hi JK,

Thanks for your suggestion.

I tried to deploy with version 2 and setup the log setting to debug like the following:

I run individual entity set with https://host:port/gateway/odata/SAP/ZBAPI;v=1/CarrierSet

was failed with the same error also.

I check on the log and Trace but it didn't show anything.

Am I checking to the right log file?

Regards

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Adjust time frame.. you may also look at server log file available under LOG FILES section.

The service you are accessing is available publicly?

Former Member
0 Kudos

I tried to adjust the time frame from May to Jun, The log is not showing any latest error.

As per the screen shot like the following, the problem is because I wrongly create a duplicated profile.

I had downloaded the smp.server.log and the last update was 4th Jun 2015, the log file is not updated even i restart the SMP server. Is that any problem here?

Besides, I'm apologize that the service is not publicly available service. May I know how to make it available publicly ?

Regards

Choong

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

<< I thought you might be trying with some publicly available service, i am not asking you to make any internal service as public)>>

Were you able to run ?https://host:port/gateway/odata/SAP/ZSFLIGHT_PROJECT_SRV;v=1/CarrierSet

and then https://host:port/gateway/odata/SAP/ZSFLIGHT_PROJECT_SRV;v=1/FlightSet

Above log screenshot is not related to your error. Do you see anything relevant in SMP server.log file under LOG FILES tab?

Former Member
0 Kudos

<I haven't try with others publicly available service and I will try it soonest possible, it will be great if you have any publicly service for me to test, Much appreciate if you have any>

Besides, I'm able to run the URL as suggest like the following:

I tried to find the LOG FILE tab and there is no any relevant log

Messages.log is empty. events.log and start.log did provide some info like the following:

Regards,

Choong