on 06-19-2007 2:16 PM
Hi,
first of all, my enviroment:
1. DC ejbrecipe (EJB Module), containing the EJB Beans:
- one Entity Bean Cook
- one Session Bean RecipeBean with a local Interface and a method: [code]public Cook getCook();[/code]
- the method implementation:
[code]
Cook c = new Cook();
c.setName("Chefkoch");
return c;
[/code]
2. DC earecipe (Enterprise Application)
- the earecipe is only for the webdynpro component to forward the beans via public parts
3. DC wdrecipe (WebDynpro Application, uses earecipe)
- created a application, with a view
- created a model "MyModel" wich is linked to the EJB Bean
- the Component Controller is linked to the model "MyModel"
- in the Component Controller in "wdDoInit":
[code]
com.test.model.MyModel model = new com.test.model.MyModel();
wdComponentAPI.getModelInstanceMap().putDefaultInstance("com.test.model.MyModel", model);
- the view context is linked to the component controller context
- on the view there is a input fiield, with it's value linked to "Response_RecipeLocal_getCook"
[/code]
when i fire up the application i get:
[code]
java.lang.IllegalArgumentException: model object must not be null
at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:63)
at recipeapp.comp.wdp.IPublicRecipeComp$IResponse_RecipeLocal_getCookElement.<init>(IPublicRecipeComp.java:296)
at recipeapp.comp.wdp.IPublicRecipeComp$IContextNode.doCreateElement(IPublicRecipeComp.java:53)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:1064)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1047)
[/code]
What am i doing wrong?
regards,
Christian
Message was edited by:
Christian Pelster
Christian, what is cardinality of your model node? Is it 1..Smth.?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for your qucik response, at least the model is null error has gone.
this is how my init looks now:
com.test.model.RecipeModel model = new com.lhsystems.recipe.model.RecipeModel();
wdComponentAPI.getModelInstanceMap().putDefaultInstance("com.test.model.RecipeModel", model);
try
{
wdContext.currentRequest_RecipeLocal_getCookElement().modelObject().execute();
wdContext.nodeRequest_RecipeLocal_getCook().invalidate();
}
catch (Exception e)
{
}
but my input field remains empty when i launch my application, i read somewhere that i have to tell the input element that there ist changed content available.
i also debuged the application and noticed that the RecipeBean never gets called.
Regards,
Christian
Hi,
thats more a chat than a forum discussion =).
Anyway, i tried you proposition and and got the following:
java.lang.ClassNotFoundException: com.lhsystems.recipe.RecipeBean ------------------------- Loader Info ------------------------- ClassLoader name: [demo.sap.com/wdrecipe] Living status: alive Direct parent loaders: [system:Frame] [service:servlet_jsp] [service:ejb] [service:tc~cm~ejb~api] [service:sld] [sap.com/tc~wd~api] [demo.sap.com/earecipe] Resources: D:usrsapCE1J01j2eeclusterappsdemo.sap.comwdrecipeservlet_jspwebdynproresourcesdemo.sap.comwdreciperootWEB-INFlibapp.jar ---------------------------------------------------------------
at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:256)
at com.sap.engine.boot.loader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:225)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:333)
at recipeapp.comp.RecipeComp.wdDoInit(RecipeComp.java:114)
at recipeapp.comp.wdp.InternalRecipeComp.wdDoInit(InternalRecipeComp.java:132)
Christian, there is no miracle. If it is not working - must be the reason.
Most probably the reason is that you don`t have reference from your WD project (DC) to EAR containing EJB classes. OR reference is not correct.
To check depedencies go to visual administrator, open service "ClassLoader viewer" (SID->server->services->classloader in the tree on the left pane), select your WD application or EAR and you will see all dependencies. You can also use for getting full name of EAR component which you can use for sharing reference.
Hi,
i looked up the dependencies on the netweaver AS Telnet console:
wdrecipe:
>app_refs_graph demo.sap.com/wdrecipe
+Application References
|
+->+application:demo.sap.com/wdrecipe (STARTED)
|
+->+HARD to library:tc~aii~base~offline~facade (loaded)
|
+->+HARD to library:tc~bl~jrfc~api (loaded)
|
+->+HARD to library:tc~cmi (loaded)
|
+->+HARD to application:demo.sap.com/earecipe (STARTED)
|
+->+HARD to library:tc~je~webservices~lib (loaded)
|
+->+HARD to library:tc~ddic~runtime~facade (loaded)
|
+->+HARD to service:tc~je~security~api (started)
|
+->+HARD to application:sap.com/tc~wd~api (STARTED)
| |
| +->+HARD to service:sld (started)
| |
| +->+HARD to library:com.sap.util.monitor.jarm (loaded)
| |
| +->+HARD to service:tc~wd~webdynpro (started)
| |
| +->+HARD to library:tc~aii~base~offline~facade (loaded)
| |
| +->+HARD to library:tc~graphics~igs (loaded)
| |
| +->+HARD to library:tc~je~webservices~lib (loaded)
| |
| +->+HARD to library:tc~cmi (loaded)
| |
| +->+HARD to library:tc~bl~jrfc~api (loaded)
| |
| +->+HARD to library:tc~ddic~runtime~facade (loaded)
| |
| +->+HARD to library:com.sap.lcr.api.cimclient (loaded)
| |
| +->+HARD to service:tc~je~security~api (started)
|
+->+HARD to library:tc~graphics~igs (loaded)
|
+->+HARD to service:sld (started)
|
+->+HARD to library:com.sap.lcr.api.cimclient (loaded)
|
+->+HARD to service:tc~cm~ejb~api (started)
and earecipe
>app_refs_graph demo.sap.com/earecipe
+Application References
|
+->+application:demo.sap.com/earecipe (STARTED)
i found you article on jarclassfinder (/people/maksim.rashchynski/blog/2006/08/14/the-story-about-how-2-eclipse-plugins-helped-me-to-make-a-lot-of-points-on-sdn-forum), the classfinder says the same thing as the java engine, there is a dependencie on RecipeBean.
i wonder how to tell netweaver to use ebrecipe, i inserted a dependencie in the component properties and in the project properties (referned projects) of the wdrecipe but no change.
is ther any ohter place or trick to tell NW to use ebrecipe?
regards,
christian
Hi Christian,
You have to do something like that:
1 - Use the visual tool to add the model component inside your application
2 - At the init method in the controller put these code:
RecipeBean recipeBean = //get the sesssion bean instance
wdContext.nodeRecipeBean().bind(recipeBean);
..
Regards,
Luciano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.