Skip to main content

RI Implementation throwing the MPEMediaError to the Applications

5 replies [Last post]
krushna
Offline
Joined: 2010-09-21
Points: 0

Some parts of the RI code is throwing the MPEMediaError to the applications.It will abort the application by leaving no clue what has happened.

Do we need to catch the error in implementation and send some meaningful exception saying what has happaned.

Currently the exception looks like :

ogging.LogRuntimeException: Could not find the class in the result object
at com.tvworks.cats.video.dcl.DclMessageSender.receive(DclMessageSender.java:101)
at com.tvworks.cats.video.dcl.DclMessageSender.execute(DclMessageSender.java:67)
at com.tvworks.cats.video.dcl.DcliManagerFacade.executeCommand(DcliManagerFacade.java:129)
at com.tvworks.cats.video.dcl.DcliManagerFacade.executeClass(DcliManagerFacade.java:169)
at com.tvworks.cats.video.settop.Settop.executeClass(Settop.java:832)
at org.ocaptdk.util.server.TDKTestCase.executeTestCase(TDKTestCase.java:118)
at org.ocaptdk.dvr.recording.test.RecordingConcurrencyTest.performTest(RecordingConcurrencyTest.java:119)
at org.ocaptdk.dvr.recording.test.RecordingConcurrencyTest.testConcurrentScheduleRecordings(RecordingConcurrencyTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:46)
at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:37)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.cablelabs.impl.media.mpe.MPEMediaError
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at com.tvworks.cats.video.dcl.DclMessageSender.receive(DclMessageSender.java:96)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
greg80303
Offline
Joined: 2008-07-03
Points: 0

From the looks of your log, MPEMediaError is not being thrown. ClassNotFoundException is being thrown. The class that it can not find is MPEMediaError. There is something wrong with your environment setup. Whatever you are running is trying to classload MPEMediaError and that class is not being found. I don't see a single level of your stack trace that refers to RI stack code.

G

pradeepngupta
Offline
Joined: 2011-07-03
Points: 0

Hi Greg,

Since the javadoc doesn't mention anything about the MPEMediaError, my test dcli doesn't catch this error and so, this error is propagated to the Test Server which doesn't know about the OCAP internal classes. The Test Server is only knows about the OCAP Public APIs or OCAP Stub.

So, here the question is: Should public OCAP API need to throw Exceptions or Errors whose class files are not there in the ocap-stub or the ocap public API?

Thanks & REgards,

Pradeep Gupta

greg80303
Offline
Joined: 2008-07-03
Points: 0

The MPEMediaError exception should never reach the application. Please create a JIRA issue for this problem and post the associated log files and stack traces.

Thanks,

Greg

pradeepngupta
Offline
Joined: 2011-07-03
Points: 0

Thanks Greg.

Raised JIRA Issue:

http://java.net/jira/browse/OCAP_RI-542

Regards,

Pradeep Gupta

krushna
Offline
Joined: 2010-09-21
Points: 0

Hi The logs i provided is from app Side.

If the class itself is not loaded i don't see the error log which is part of MPEMediaError.

The piece of code thorwn this error is :

int err = nativeGetRecordingContentItemLocalSize(recordingName, size);
if (err != 0) throw new MPEMediaError(err, "getRecordingContentItemLocalSize");

Actual RI code logs where it is creating the MPEMediaError and thorwn is :

org.cablelabs.impl.media.mpe.MPEMediaError: MPE Error 2 (0x2): getRecordingContentItemLocalSize

org.cablelabs.impl.media.mpe.MPEMediaError: MPE Error 2 (0x2): getRecordingContentItemLocalSize

at org.cablelabs.impl.media.mpe.HNAPIImpl.getRecordingContentItemLocalSize(HNAPIImpl.java:282)

at org.cablelabs.impl.ocap.hn.upnp.srs.RecordingContentItemLocal.getRecordingSizeStr(RecordingContentItemLocal.java:859)

at org.cablelabs.impl.ocap.hn.upnp.srs.RecordingContentItemLocal.updateMetadata(RecordingContentItemLocal.java:381)

at org.cablelabs.impl.manager.recording.db.HNSerializationMgrDelegate.saveRecord(HNSerializationMgrDelegate.java:61)

at org.cablelabs.impl.manager.recording.db.SerializationMgr.saveRecord(SerializationMgr.java:269)

at org.cablelabs.impl.manager.recording.RecordingRequestImpl.saveRecordingInfo(RecordingRequestImpl.java:404)

at org.cablelabs.impl.manager.recording.RecordingImpl.saveRecordingInfo(RecordingImpl.java:639)

at org.cablelabs.impl.manager.recording.RecordingImpl.setStateAndNotify(RecordingImpl.java:2081)

at org.cablelabs.impl.manager.recording.RecordingImpl$IStateStarted.handleNativeTerminationNotification(RecordingImpl.java:5507)

at org.cablelabs.impl.manager.recording.RecordingImpl.asyncEvent(RecordingImpl.java:5162)

at org.cablelabs.impl.manager.ed.EventDispatchImpl$EventDispatchThread.run(EventDispatchImpl.java:178)