How to catch Glide Exceptions Properly? - android-image

Am using Glide 4.x and getting FileNotFoundException as the URL returns 404. I tried to catch the exception using the RequestListener. But it is not Caching this Exception.
GlideApp.with(getApplicationContext()).load(URL).placeholder(R.mipmap.ic_launcher).listener(new RequestListener<Drawable>() {
#Override
public boolean onLoadFailed(#Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
System.out.println("MainActivity.onLoadFailed"+e.getMessage());
return false;
}
#Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
System.out.println("MainActivity.onResourceReady");
return false;
}
}).error(R.mipmap.ic_launcher).transform(new CircleCrop()).into(profileImage);
Log as Follows:
2019-03-20 17:48:07.134 32233-32233/com.zyta.zflikz W/Glide: Load
failed for
https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg
with size [183x183]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There were 2 causes:
java.io.FileNotFoundException(https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg)
java.io.FileNotFoundException(https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Fetching data failed,
class java.io.InputStream, REMOTE
There was 1 cause:
java.io.FileNotFoundException(https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class java.io.FileNotFoundException: https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg
Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Fetching data failed,
class java.io.InputStream, REMOTE
There was 1 cause:
java.io.FileNotFoundException(https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class java.io.FileNotFoundException: https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg
Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed
LoadPath{StringUri->Object->Drawable}, LOCAL
Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed
DecodePath{StringUri->Drawable->Drawable}
Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed
DecodePath{StringUri->Bitmap->Drawable} 2019-03-20 17:48:07.135
32233-32233/com.zyta.zflikz I/Glide: Root cause (1 of 2)
java.io.FileNotFoundException: https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:251)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:26)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:106)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:59)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:272)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:233)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
2019-03-20 17:48:07.137 32233-32233/com.zyta.zflikz I/Glide: Root
cause (2 of 2)
java.io.FileNotFoundException: https://lh4.googleusercontent.com/-UxjwFuQRjXA/AAAAAAAAAAI/AAAAAAAAAAA/ACLGyWByUX_zz0_9075kpV4xIdPmN_dtNQ/s96-c/photo.jpg
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:251)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:26)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:106)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:59)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302)
at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherFailed(DecodeJob.java:397)
at com.bumptech.glide.load.engine.SourceGenerator.onLoadFailed(SourceGenerator.java:119)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:65)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:272)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:233)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
2019-03-20 17:48:07.138 32233-32233/com.zyta.zflikz I/System.out:
MainActivity.onLoadFailedFailed to load resource
Please let me know if anybody has a Fix or Alternate Solution for this.

This Issue is addressed by Making another call with Glide in local Image from Drawable in error method.
Glide.with(mContext)
.load(url)
.placeholder(R.drawable.YourIconForPlaceholder)
.error(R.drawable.YourIconWhenfailed)
.into(imageView);

Related

error when running cucumber feature file : Error creating bean with name 'myService'

`Wrote cucumber tests for my project, getting following error when running cucumber feature file. The value for field policyDays is given in my application.yml file In the service class it is defined as follows : #Value("${company.client.policyDays }")
private Integer policyDays;
Am creating an object of MyService.java (myService) in StepDefinitions.java file.
Error log : SEVERE: Exception while executing pickle java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to load ApplicationContext at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:117) at io.cucumber.core.runtime.Runtime.lambda$run$0(Runtime.java:82) at io.cucumber.core.runtime.Runtime.execute(Runtime.java:94) at io.cucumber.core.runtime.Runtime.run(Runtime.java:80) at io.cucumber.core.cli.Main.run(Main.java:87) at io.cucumber.core.cli.Main.main(Main.java:30)
Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at io.cucumber.spring.TestContextAdaptor.<init>(TestContextAdaptor.java:32)
at io.cucumber.spring.SpringFactory.start(SpringFactory.java:152)
at io.cucumber.core.runner.Runner.buildBackendWorlds(Runner.java:134)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:70)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$6(Runtime.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$7(Runtime.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:249)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at io.cucumber.core.runtime.Runtime.lambda$runFeatures$3(Runtime.java:110)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:111)
... 5 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myService': Unsatisfied dependency expressed through field 'policyDays'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:127)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:276)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:244)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 31 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:79)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1339)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
... 50 more
Caused by: java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.valueOf(Integer.java:766)
at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211)
at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)
Tried #Value("#{company.client.policyDays }") instead of #Value("${company.client.policyDays }"), didn't worked

Fatal Exception: java.lang.RuntimeException : unable to start Activity

Hey guys i m new in Android studio help me to out following. i use ActionBarSherlock Library and it hold Reference of current Fragment instance when user pause application.
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maruticourier.android/com.myapplication.activity.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException**
at com.myapplication.fragment.PendingTask.checksyncdata(PendingTask.java:378)
at com.myapplication.fragment.PendingTask.onCreateView(PendingTask.java:182)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:548)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5143)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)
you must initialize Activity Object ActionBarSherlock project file

R function Failure in UDx RPC call InvokeGetUdxType() Issue

I am tring to create an R function in Vertica and i am getting an error.
Any help or clue would be highly apreaciated
dbadmin=> create transform function pred as language 'R' name 'pred' library predLb;
ROLLBACK 3399: Failure in UDx RPC call InvokeGetUdxType(): Error calling getUdxType() in User Defined Object [predict] at [/scratch_a/release/16125/vbuild/vertica/OSS/UDxFence/vertica-udx-R.cpp:209], error code: 0, message: Error happened in getUdxType : Exception in processing required attribute udxtype in the factory function : no applicable method for 'predict' applied to an object of class "NULL"
#dbLog error
Starting UDxSideProcess for language R
with command line: /opt/vertica/bin/vertica-udx-R 3 node-32420:0x61c5 debug-log-off /home/dbadmin/stream/v_stream_node0001_catalog/UDxLogs
#Error from the UDx log
/home/dbadmin/stream/v_stream_node0001_catalog/UDxLogs/UDxFencedProcesses.log
2015-06-24 11:15:55.922 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 UDx side process started
11:15:55.922 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 My port: 46526
11:15:55.922 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 My address: 0.0.0.0
11:15:55.922 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 Vertica port: 37765
11:15:55.922 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 Vertica address: 127.0.0.1
11:15:55.922 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 Vertica address family: 2
11:15:55.946 [R-node-32420:0x61c5-2309] 0x7f3c460457a0 UDx_ereport: Exception in processing required attribute udxtype in the factory function : no applicable method for 'predict' applied to an object of class "NULL"
11:15:55.946 [R-node-32420:0x61c5-2309] 0x7f3c460457a0 UDx_ereport: Error happened in getUdxType : Exception in processing required attribute udxtype in the factory function : no applicable method for 'predict' applied to an object of class "NULL"
11:15:55.946 [R-node-32420:0x61c5-2309] 0x7f3c460457a0 Error in recv(): Vertica process has exited abnormally
11:15:58.003 [R-node-32420:0x61c5-2308] 0x7f3c460457a0 Received SIGTERM, exiting
Found the answer !
Actually there is nothing wrong with the R libs it was just a spelling matter ! :(, not on my part. I don't review R Udx code.
The R function name is pred is different.

Naming Context not found exception

I am deploying a EAR from RAD .The EAR pacakges a WAR and EJB module. I am getting the following error after the application in invoked..
javax.naming.NameNotFoundException: Context: C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1, name: ejb/org/ifc/dots/business/services/DOTSStartupServiceHome: First component in name DOTSStartupServiceHome not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapNotFoundException(CNContextImpl.java:4360)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1793)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1748)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1499)
How do I verify the naming context entries in the websphere server... ?
Actually the error occurred because the ejb was not part of the EAR deployment descriptor..I added ejb module in the deployment descriptor and now the error is gone..
I am now getting the following error..
[2/6/14 18:16:37:808 IST] 00000023 FfdcProvider I com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_295f295f_14.02.06_18.16.37.59110970.txt com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt 1507
[2/6/14 18:16:37:810 IST] 00000023 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: lookupExt
Context name: C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1
Target name: ejb/org/ifc/dots/business/services/DOTSStartupServiceHome
Other data: ""
Exception stack trace: com.ibm.ws.naming.util.InvalidObjectException: Some object reference in the name "ejb/org/ifc/dots/business/services/DOTSStartupServiceHome" relative to the context "C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1" is invalid. Some possible causes include a context binding in the name which refers to a destroyed context, or an object binding which contains an invalid EJBHome reference. [Root exception is org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapINV_OBJREF(CNContextImpl.java:4391)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1807)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1748)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1499)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:636)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.ifc.dots.business.locator.ServiceLocator.getServiceHome(ServiceLocator.java:228)
at org.ifc.dots.business.delegation.DotsBusinessServiceDelegate.invokeService(DotsBusinessServiceDelegate.java:96)
at org.ifc.dots.web.aggregation.DOTSXMLHelper.getXML(DOTSXMLHelper.java:468)
at org.ifc.dots.web.servlet.DOTSWebServlet.getXMLElement(DOTSWebServlet.java:126)
at org.ifc.framework.web.servlet.BaseWebServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:1995)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1675)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:580)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2163)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:538)
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2792)
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2788)
at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:762)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:2786)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1789)
... 34 more
Caused by: org.omg.CORBA.OBJECT_NOT_EXIST: SERVANT_NOT_FOUND (4) for key 0x49454a50020033e2132d077365727665723103454a420000005cacac0002000100290000005f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d657308444f5453494923444f54534949456a622e6a617223444f54535374617274757053657276696365 vmcid: IBM minor code: C14 completed: No
at com.ibm.rmi.corba.ObjectManager.lookupServant(ObjectManager.java:110)
at com.ibm.CORBA.iiop.ServerDelegate.getServant(ServerDelegate.java:311)
at com.ibm.rmi.iiop.ORB.lookupLocalObject(ORB.java:592)
at com.ibm.CORBA.iiop.ORB.lookupLocalObject(ORB.java:1465)
at com.ibm.rmi.iiop.CDRReader.newObjRef(CDRReader.java:1290)
at com.ibm.rmi.iiop.CDRReader.read_Object(CDRReader.java:1130)
at com.ibm.rmi.iiop.CDRReader.read_Object(CDRReader.java:1094)
at com.ibm.rmi.corba.IorURL.iorbytesToObjref(IorURL.java:105)
at com.ibm.rmi.corba.IorURL.resolve(IorURL.java:93)
at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3718)
at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3256)
at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3619)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:1921)
... 43 more

Reflecting Assemblies on Mono for Android

I'm creating an app "plugin" dll that loads at run-time for my Mono for Android App and starts a new Activity. (the app will be installed ad-hoc - so no comments on downloading executable code)
I'm coming from Obj-C on iOS - where you can include .nibs and ViewControllers in a library.
I can have the main Android app and the loaded dll both reference another common dll, and load objects just fine.
The following works:
var test = plugin.CreateInstance("Test.Satellite.testClass");
MethodInfo getString = test.GetType().GetMethod("getString");
MethodInfo tryPatient = test.GetType().GetMethod("tryPatient");
Where
public class testClass
{
public string getString ()
{
return "This was read from the object";
}
public string tryPatient ()
{
Patient p = new Patient();
p.Name = "This was created from the Core/Common DLL";
return p.Name;
}
}
However, when I try to load an Activity (either through CreateInstance or Intent/StartActivity) it gives the following exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: test.satellite.RootActivity
at Android.Runtime.JNIEnv.FindClass (System.String classname) [0x00087] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.2.7-branch/0e9eea34/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:275
at Android.Runtime.JNIEnv.FindClass (System.Type type) [0x00009] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.2.7-branch/0e9eea34/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:233
--- End of managed exception stack trace ---
java.lang.NoClassDefFoundError: test.satellite.RootActivity
at test.MainActivity.n_onCreate(Native Method)
at test.MainActivity.onCreate(MainActivity.java:29)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
at android.app.ActivityThread.access$2200(ActivityThread.java:119)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: test.satellite.RootActivity in loader dalvik.system.PathClassLoader#44e8c678
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
... 15 more
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <IL 0x000e0, 0x00670>
at System.Reflection.MethodBase.Invoke (object,object[]) <IL 0x00006, 0x0008f>
at Test.MainActivity.OnCreate (Android.OS.Bundle) [0x001e9] in /Users/stephen/Projects/test/test/MainActivity.cs:86
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-monodroid-4.2.7-branch/0e9eea34/source/monodroid/src/Mono.Android/platforms/android-8/src/generated/Android.App.Activity.cs:1490
at (wrapper dynamic-method) object.ca46b703-b14e-4853-b371-499ea96364fc (intptr,intptr,intptr) <IL 0x00012, 0x00033>
What I can read from that is that the Dalvik can't find the class test.satellite.RootActivity - but it found test.satellite.testClass just fine...?
Any help would be appreciated.
It looks like you are inconsistent about the casing of packages. Might that be the problem?
"Test.Satellite.testClass" -- works
"test.satellite.RootActivity" -- doesn't work

Resources