cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with an Adaptive Webservice Model

kevin_maerz
Explorer
0 Kudos

Hello!

I am quite new to Web Dynpro Java and got the following issue:

I have to adopt an exisiting project in the NWDS. A checkbox-element should be changed to a dropdown-list (so boolean to string). To save the data in the corresponding MaxDB the Project consumes an Adaptive Webservice, so i also changed this webservice and deployed. Everythings fine with the WSDL-File when opening it in the browser, the attribute-type now is string and not boolean.

Next i reimported the Webservice-Model, made new context-bindings everywhere and deployed the modelcomponent (where the Adaptive Webservice and other models are stored) and also the application itself. Everything worked fine, no errors when rebuilding or deploying the projects, especially not with wrong attribute-types.

I also changed the attribute-type of the respective column in the MaxDB with the help of a dictionary-component in the NWDS, so everything should be fine there too.

The problem now is: While submitting the form I get the following error:


com.sap.tc.cm.base.exception.BaseModelRuntimeException: 
Class 'java.lang.String' of new attribute value is not assignment 
compatible for attribute 'CRYPTO_REL' of type 'boolean' in 
model class 'ZfaCD' 
    at com.sap.tc.cm.base.model.BaseGenericModelClass.
           setAttributeValue(BaseGenericModelClass.java:306)
    at com.sap.tc.webdynpro.model.webservice.gci.
           WSTypedModelClass.setAttributeValue(WSTypedModelClass.java:78)
    at com.sap.demo.selfservicemodelcomponent.
          wswebasdbaccessmodel.ZfaCD.setCRYPTO_REL(ZfaCD.java:260)
    at com.sap.demo.selfservicemodelcomponent.selfservicemodelcomp.wdp.
          IPublicWSWebASDBAccessCust$IZfaCDElement.wdSetString
                   (IPublicWSWebASDBAccessCust.java:5652)
    at com.sap.tc.webdynpro.progmodel.context.
           MappedNodeElement.wdSetString(MappedNodeElement.java:311)
    ... 77 more

Do I have to change the Adaptive Webservice Model anywhere else too? Isnt it enough to rebuild and deploy the Modelcomponent?

Do I have to restart any systems?

Thank you for help.

Regards Kevin

Edited by: Kevin Maerz on Oct 13, 2010 2:14 PM

Edited by: Kevin Maerz on Oct 13, 2010 2:14 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

See the below thread..this might solve your issue

Regards,

Vijaykumar Pappala.

former_member182374
Active Contributor
0 Kudos

You need to restart the J2EE engine in order to clean the cache.

kevin_maerz
Explorer
0 Kudos

Oh, thank you very much, the error is gone now. Didn't expect that there is such an easy solution.

Now i can submit the form but the data is still not written in the database.

I get the following exception message:

Exception on execution of web service with WSDL URL 'http://swm2:50000/SelfServiceSessionService/SelfServiceSessionBean?wsdl' with operation 'createZfaCD' in interface 'SelfServiceSessionLocal'

Any further ideas?

Thank you and regards

former_member182374
Active Contributor
0 Kudos

Hi,

First of all try to test your WS without Web Dynpro (try using Web Service Navigator or something similar).

Second, how did you reimport your Adaptive Web Service to WD? did you use this blog?

/people/bertram.ganz/blog/2005/10/10/how-to-reimport-web-service-models-in-web-dynpro-for-java

The error can also be generated if you have unhandled exception in your WS code (the error you got is a generic one from the J2EE). Try to add logging code to the problematic method in your WS code.

Regards,

Omri

kevin_maerz
Explorer
0 Kudos

Ok i tested the method in WS Navigator and got the following error:

Web-Service gab Fehler zurück. Fehlercode: "(http://schemas.xmlsoap.org/soap/envelope/)Server" Fehlerstring: "javax.ejb.EJBException: nested exception is: com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletion of ( SAP J2EE Engine JTA Transaction : )."

(the few words at the beginning say: Web-Service returned an error: Errorcode: ..."

I just used the "Reimport Model" option (available in the Context-Menu of the Model in NWDS). I think you dont need to follow the instructions of the blogpost anymore since there is a "Reimport Model" option now, do you?

(I use the SAP Netweaver 7.1 Composition Environment SP08)

What do you mean with "logging code"? I can't really imagine, that it is a problem with the method. I really changed one attribute-type from boolean to string only and before there were no errors at all.

Thanks and regards

Kevin

Edited by: Kevin Maerz on Oct 13, 2010 4:27 PM

former_member182374
Active Contributor
0 Kudos

Hi,

I'm still with 7.00 so I guess you don't need to reimport the model according to the blog if 'reimport' is available.

By logging (or debugging if you can) I mean test the problematic method or even try to see if your code is getting to it.

You will get 'Web-Service returned an error...' if you have unhandled exception in your method code.

Regards,

Omri

former_member214651
Active Contributor
0 Kudos

Hi,

BaseRollBackException generally occurs when u try to insert records into the DB which could be:

1. The Type of the data is not matching (Type Mismatch). i.e, If you try to insert a string value for a Boolean or

2. If there exists a record earlier with the same primary key.

Are you using an EJB, JPA to insert into the DB? If yes,

1. check if you have made the changes in your EJB code after you changed the type of the data in the DB Table

2. Generated the Entities again for the changed table

3. published the EAR file which contains the changed EJB

Hope this helps you.

Regards,

Poojith MV

kevin_maerz
Explorer
0 Kudos

1. check if you have made the changes in your EJB code after you changed the type of the data in the DB Table

2. Generated the Entities again for the changed table

3. published the EAR file which contains the changed EJB

As mentioned in my first post, the WSDL file is absolutely fine (the type of the respective attribute is 'String' and not 'boolean) so I think I adopted the EJB appropriately and published ( = deployed) it with EAR. If not I couldn't reimport the Adaptive Webservice Model with the correct attribute type, could I?

Are there more things I have to do with EJB beside deploying it with EAR that it runs correctly?

When generating the entities the Java-Files don't get the same structure as the current ones (in the head of the files) and I get even more errors.

Thanks & regards

Kevin

Edited by: Kevin Maerz on Oct 15, 2010 11:23 AM

kevin_maerz
Explorer
0 Kudos

push Any other Ideas? Did I understand something wrong?

I'd be glad if anybody could give me some further help

Thanks&Regards

Kevin