on 08-05-2014 9:00 AM
Hi all,
I created a respository service to update a custom km property when I received the event checkIn. The problem is it execute es very slow and after I have this error:
This is the method and I don't understand where is the problem...
public void received(IEvent event) {
try {
if (event!=null){
IResourceEvent myEvent = (IResourceEvent) event;
IResource res = myEvent.getResource();
PropertyName propertyNamePublicado =
new PropertyName("namespace","prp_Publicado");
IProperty propPublicado = res.getProperty(propertyNamePublicado);
if (myEvent.getType() == ResourceEvent.CHECKIN)
{
if(propPublicado!=null){
boolean pub=false;
IMutableProperty mutableProperty = propPublicado.getMutable();
mutableProperty.setBooleanValue(pub);
res.setProperty(mutableProperty);
}
else{
IProperty proPublic = new Property(propertyNamePublicado,Boolean.FALSE);
res.setProperty(proPublic);
}//else
}//if checkin
}//IF event null
}//try
catch (ResourceException e) {
e.printStackTrace();
}
Thanks and regards
Mónica
Whats your dev trace is saying regarding that?
cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have modified my method this is the source code:
public void received(IEvent event) {
try {
if (event!=null){
IResourceEvent myEvent = (IResourceEvent) event;
IResource res = myEvent.getResource();
IPropertyName propertyNamePublicado =
new PropertyName("namespace","prp_Publicado");
IProperty propPublicado = res.getProperty(propertyNamePublicado);
if (myEvent.getType() == ResourceEvent.CHECKIN)
{
// IMutableProperty mutableProperty = propPublicado.getMutable();
// mutableProperty.setBooleanValue(false);
// res.setProperty(propPublicado);
}//if checkin
}//IF event null
}//try
catch (ResourceException e) {
e.printStackTrace();
}
}
I commented the 3 lines where I modify the property and I tested again it is the trace error:
Heartbeat: Input Stream Error
[EXCEPTION]
com.sap.util.monitor.grmg.GrmgRequestException: Input Stream Error
at com.sap.util.monitor.grmg.GrmgRequest.<init>(GrmgRequest.java:75)
at com.sap.engine.heartbeat.ServerGRMGApplication.doPost(ServerGRMGApplication.java:92)
at com.sap.engine.heartbeat.ServerGRMGApplication.doGet(ServerGRMGApplication.java:142)
at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:313)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:757)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:394)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Thanks and regards
The source you provided seems to doesnt match the exception, Im not able to see any use of InputStream. You have to take a look to at com.sap.util.monitor.grmg.GrmgRequest.<init>(GrmgRequest.java:75). The service you have wrote seems to provocate this somehow, so it has to be presented in the stack trace, if I got you properly. Hang in there with NWDS and debug if you are not sure whats going wrong. The trace is a bit too short, you are not able to more in the logs regarding this issue? No "caused by" or any attendant exceptions?
cheers
Hi,
Yes the trace was about a problem with nwa.
Now I can read the event check-in , I need to change the property value to false.
When is receiving the event checkin, the property change but the property value is not saving in my IResource..
I following this page: http://help.sap.com/saphelp_nw73/helpdata/en/43/9cbe501fa925b3e10000000a1553f7/content.htm
if (myEvent.getType() == ResourceEvent.CHECKIN)
{
IMutableProperty mutableProperty = propPublicado.getMutable();
mutableProperty.setBooleanValue(false);
res.setProperty(propPublicado);
}//if checkin
I haven't any error, the property seems to have changed but when I refresh my KM or I work with other document,the property reverts to the previous value.
what is the problem??
Thanks! and regards
Mónica
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.