on 05-06-2008 6:59 AM
Hello,
I develop a RFC adaptative project.
When i execute the application, i obtain the following exception:
java.lang.NullPointerException
at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModelClass.createNewBaseTypeDescriptor(AiiModelClass.java:256)
at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModelClass.descriptor(AiiModelClass.java:222)
at com.sap.tut.wd.rodlist.model.Ztest_Rod_Input.<init>(Ztest_Rod_Input.java:51)
at com.sap.tut.wd.rodocomponent.RodoCust.wdDoInit(RodoCust.java:98)
at com.sap.tut.wd.rodocomponent.wdp.InternalRodoCust.wdDoInit(InternalRodoCust.java:130)
... 45 more
Ztest_Rod_Input is my adaptative RFC ...
This excception appears with the following code line:
> ztest_rod_Input input = new ztest_rod_Input();
I tried with a known BAPI in other project and i don't have this exception ...
Have you any suggestions ?
Thanks a lot,
Rodolphe.
Hi Arch,
I execute your code and in the Input View i enter the following code:
> public void onActionSearch {
>String RFCelement = wdContext.currentContextElement().getLocalMatnr();
>wdThis.wdGetRodoCustController().wdGetContext().currentZtest_Rod_InputElement().setMatnr(RFCelement);
> wdThis.wdGetRodoCustController().executeZtest_Rod_Input();
When the user complete the input field and he execute the button Search ...
i obtain the following exception:
java.lang.NullPointerException
at com.sap.tut.wd.rodocomponent.InputRodView.onActionSearch(InputRodView.java:145)
at com.sap.tut.wd.rodocomponent.wdp.InternalInputRodView.wdInvokeEventHandler(InternalInputRodView.java:140)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
... 26 more
Then when i look the SDL server log i see:
#1141 05/06/2008 14:06:04.607 [SAPEngine_Application_Thread[impl:3]_12] ERROR com.sap.lcrabapapi.ejb.AbapSLDRequestBean: Caught an Exception while processing a JCO request. Check the RFC engine for sanity and check your server logs and traces for more information.
Thrown:
java.lang.NullPointerException
Rodolphe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this
public void onActionSearch {
try
{
Ztest_Rod_Input input = new Ztest_Rod_Input();
wdContext.nodeZtest_Rod_Input().bind(input);
String RFCelement = wdContext.currentContextElement().getLocalMatnr();
wdThis.wdGetRodoCustController().wdGetContext().currentZtest_Rod_InputElement().setMatnr(RFCelement);
wdThis.wdGetRodoCustController().executeZtest_Rod_Input();
}
catch (Exception ex)
{
wdComponentAPI.getMessageManager().reportSuccess( ex.getLocalizedMessage());
}
Arch
hi,
Is there any othe Model classes available ? .
in the DoInit Method of the component Controller , after binding the input to the model node .
Just type input.set(ctrl+space);
are u able to get any model nodes to be initialised for the RFC Model , if Yes the do it with corresponding Objects .
please trace out the error logs from the server for information for this Exception.
Thanks and regards
Fazal B
Hi Fistae,
I don't know this procedure.
The server ? it is the server where the SDL is running ?
How i proceed to execute the service registry ?
Hi Mikhil,
here my code ... it's simply:
>public void wdDoInit()
> {
> try
> {
> Ztest_Rod_Input input = new Ztest_Rod_Input();
> wdContext.nodeZtest_Rod_Input().bind(input);
> input.setMatnr(new String());
>
> }
> catch (Exception ex)
> {
> //ex.printStackTrace();
> wdComponentAPI.getMessageManager).reportSuccess( ex.getLocalizedMessage());
> }
HI Arch,
In the Input View where there is my inputField,
i go to the context. Then, i see:
Context
Ztest_Rod_Input
Matnr
In properties of Ztest_Rod_Input, i see cardinality 0..n
but i can't change the value ...
Thanks!
Rodolphe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try to compare your code with this article
Adaptive Web Service Model Controller Coding
Explained
Regards
Ayyapparaj
Hi Rodolphe
I will suggest you that if you need to send one matnr value to your BAPI,
create a separate attribute say localMantr in your view context & bind that attribute with your input field.
Then in your code when you need to set it...
like input.setMatr("") that you had posted earlier
write this
input.setMatr(wdcontext.currentContextElement.getLocalMantr())
& execute your model.
Hoping that you are writting your model execution code in View itself.
Hope it helps
Arch
Hi,
I am not sure how to execute the RFC Module in the server .
But while Importing the Model u might have given the MetaData For the RFC Module , then only the Rfc Model Classes will be Visible In the Model tab.
and we cannot change the cardinality of the model node .
Thanks and Regards
Fazal B
Hi Vinod V,
Thanks for your attention ...
It is strange, because when i add your try/catch code,
i have no error report and
I see my application but... with my InputField deactivated ....
Other ideas ?
Rodolphe.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
just check whether the Rfc model is getting excecuted in the server.
Just go the servise registry in the server and execute ur model in the server and check whether it is excecuting correctly.
please check whether u have instantiated the model in the doinit method of the component Controller and bind the Model to the Model Nodes.
Thanks and Regards
Fazal
Rudolf,
Are you sure that you have done binding in right manner? I think that the cause of the NPE.
For enabling the input field, you have to create a context element of type string and bind that to the input UI element. and in init() method, you have to assign the input model context element to the local element.
say
wdContext.currentContextElement().setLocalElement(wdContext.current<yournode>InputElement().setFldName( "value"));
here LocalElement is the local context element and other is the model context element name.
Regards
Vinod V
Hi,
Please check the cardinality property of the node whose attribute you have binded with your input field.
It seems the input node has some attribute say mantr which you have binded to your input field.
Just let me know the cardinality of your input node...
If the value for this is 0...n , your input field will be disabled.
Arch
Hi Arch,
I obtain the same error exception !
The exception is coming from THIS line:
> ztest_rod_Input input = new ztest_rod_Input();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rudolf,
Try this code in your application and report what is the error report showing:
try
{
Ztest_Rod_Input input = new Ztest_Rod_Input();
wdContext.nodeZtest_Rod_Input().bind(input);
}
catch (Exception ex)
{
wdComponentAPI.getMessageManager().reportSuccess( ex.getLocalizedMessage());
}
Regards
Vinod V
Furthermode, i don t know how manage exception to obtain more inofrmation about my problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
When i put the following code:
>Ztest_Rod_Input input = new Ztest_Rod_Input();
>wdContext.nodeZtest_Rod_Input().bind(input);
>input.setMatnr(new String());
I got the exception "java.lang.NullPointerException "
But when i use the following code:
>try
>{
> Ztest_Rod_Input input = new Ztest_Rod_Input();
> wdContext.nodeZtest_Rod_Input().bind(input);
> input.setMatnr(new String());
>}
>catch (Exception ex)
>{
> ex.printStackTrace();
>}
I don't have the exception and the InputField that i have created is always deactivated...
I think that all is bound (object to model).
Any ideas?
Thanks
Rodolphe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post the piece of code for creating objects and setting input parameters.
Do check if you have bound the objet with the model node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Here u are creating an Object and i dont think u will get the null pointer exception.when u re trying to invoke a method with a null object we will get this exception.
Use message manager to trace the actual place of Exception and out the codes in the try and catch block to catch the exception.
Thanks and regards
Fistae
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.