Object is not an instance of declaring class

Hi All,
I am having an issue with reflection invoking a method. I have looked up the error I am getting but cannot see why my code is throwing it. As I understand it, the error thinks I am invoking a method on the wrong instance of an expected object, but clearly my code shows I am passing the same class.
The call to field.getName() will return capitalised variables Id and Description, so that when "get" is prepended, getId and getDescription are formed. Neither method takes arguments.
I have placed a log statement gm= to find out whether the Method object has been captured, and it has. I get getId logged to the console. All fine so far until a call is made to invoke. Clearly my passed lineItemClass is causing a problem but I am not sure why, this class afterall does have getId. Have also tried changing the lineItemClass param to lineItem which is an actual instance found earlier in my code but this throws ClassCastException, even though that too has getId.
Your help appreciated!
try {
Object[] args = {};
Class[] paramTypes = {};
Class lineItemClass = lineItem.getClass();
Method getMethod = lineItemClass.
getDeclaredMethod("get" + field.getName(), paramTypes);                    
System.out.println("gm=" + getMethod.getName());
Object value = getMethod.invoke(lineItemClass, args);
} catch (Exception e) {
System.out.println("error on getFieldValue " + field.getName() + " " + e.getMessage());
}

You cannot overload a method with a different return type only, in this case invoke can only return an Object.
What reflection does for you is ensure that if the actual method invoked returns a primitive, that the equivalent Number type or Boolean is returned.
Number is the superclass of all primitive wrappers except Boolean, which is the wrapper for the boolean primitive type.
What reflection also does for you is ensure that although parameter values must be objects that the correct type is used in a method invocation so a method that expects an int will be invoked with a parameter of type Integer, Method.invoke ensures that the Integer value is converted to an int before the method actually is called.

Similar Messages

  • Clustered timers object is not an instance of declaring class

    WLS 12.1.3 installation, one cluster of two managed servers.
    An enterprise application contains 3 EJB timers. Timers are clustered and persisted to DB (table WEBLOGIC_TIMERS).
    The application is written for JEE version 5 and timers are coded according rto EJB3.0 spec.
    Each time ejbTimeout() triggers for one of the timers, the following exception is logged
    <Error> <EJB> <SRVAW00> <clusterServer_1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-002F16F44C0F7F98CBA5> <> <1426609941352> <BEA-011088> <The following error occurred while invoking the ejbTimeout(javax.ejb.Timer) method of EJB MyBean(Application: MyClusteredApp, EJBComponent: LucyStarEJB.jar).
    javax.ejb.EJBTransactionRolledbackException: EJB Exception:
         at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:452)
         at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:251)
         at weblogic.ejb.container.internal.BaseLocalObject.postInvoke(BaseLocalObject.java:431)
         at weblogic.ejb.container.internal.TimerDrivenLocalObject.postInvoke(TimerDrivenLocalObject.java:44)
         at weblogic.ejb.container.timer.TimerHandlerImpl$TimerObject.execute(TimerHandlerImpl.java:131)
         at weblogic.ejb.container.timer.TimerHandlerImpl.executeTimer(TimerHandlerImpl.java:45)
         at weblogic.ejb.container.timer.ClusteredTimerImpl.timerExpired(ClusteredTimerImpl.java:95)
         at weblogic.scheduler.ejb.internal.EJBListenerWrapper.executeTimer(EJBListenerWrapper.java:59)
         at weblogic.scheduler.ejb.internal.EJBListenerWrapper.timerExpired(EJBListenerWrapper.java:50)
         at weblogic.scheduler.TimerState$1$2.run(TimerState.java:200)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.scheduler.TimerState$1.run(TimerState.java:197)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
    Caused By: java.lang.IllegalArgumentException: object is not an instance of declaring class
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:606)
         at weblogic.ejb.container.timer.TimerHandlerImpl$TimerObject.execute(TimerHandlerImpl.java:118)
         at weblogic.ejb.container.timer.TimerHandlerImpl.executeTimer(TimerHandlerImpl.java:45)
         at weblogic.ejb.container.timer.ClusteredTimerImpl.timerExpired(ClusteredTimerImpl.java:95)
         at weblogic.scheduler.ejb.internal.EJBListenerWrapper.executeTimer(EJBListenerWrapper.java:59)
         at weblogic.scheduler.ejb.internal.EJBListenerWrapper.timerExpired(EJBListenerWrapper.java:50)
         at weblogic.scheduler.TimerState$1$2.run(TimerState.java:200)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.scheduler.TimerState$1.run(TimerState.java:197)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
    Alternatively, the stack trace is slightly different:
    <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-012838E30163E6919A1F> <> <1426809856301> <BEA-011088> <The following error occurred while invoking the ejbTimeout(javax.ejb.Timer) method of EJB MyServicesBean(Application: MyAppClustered, EJBComponent: MyEJB.jar).
    javax.ejb.EJBTransactionRolledbackException: EJB Exception:
        at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:452)
        at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:251)
        at weblogic.ejb.container.internal.BaseLocalObject.postInvoke(BaseLocalObject.java:431)
        at weblogic.ejb.container.internal.TimerDrivenLocalObject.postInvoke(TimerDrivenLocalObject.java:44)
        at weblogic.ejb.container.timer.TimerHandlerImpl$TimerObject.execute(TimerHandlerImpl.java:131)
        at weblogic.ejb.container.timer.TimerHandlerImpl.executeTimer(TimerHandlerImpl.java:45)
        at weblogic.ejb.container.timer.ClusteredTimerImpl.timerExpired(ClusteredTimerImpl.java:95)
        at weblogic.scheduler.ejb.internal.EJBListenerWrapper.executeTimer(EJBListenerWrapper.java:59)
        at weblogic.scheduler.ejb.internal.EJBListenerWrapper.timerExpired(EJBListenerWrapper.java:50)
        at weblogic.scheduler.TimerState$1$2.run(TimerState.java:200)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
        at weblogic.scheduler.TimerState$1.run(TimerState.java:197)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
    Caused By: java.lang.IllegalArgumentException: java.lang.ClassCastException@402f37c8
        at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at weblogic.ejb.container.timer.TimerHandlerImpl$TimerObject.execute(TimerHandlerImpl.java:118)
        at weblogic.ejb.container.timer.TimerHandlerImpl.executeTimer(TimerHandlerImpl.java:45)
        at weblogic.ejb.container.timer.ClusteredTimerImpl.timerExpired(ClusteredTimerImpl.java:95)
        at weblogic.scheduler.ejb.internal.EJBListenerWrapper.executeTimer(EJBListenerWrapper.java:59)
        at weblogic.scheduler.ejb.internal.EJBListenerWrapper.timerExpired(EJBListenerWrapper.java:50)
        at weblogic.scheduler.TimerState$1$2.run(TimerState.java:200)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
        at weblogic.scheduler.TimerState$1.run(TimerState.java:197)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
    It seems that this exception is not enough to stop timer schedulation, because it goes on and on. In some way, therefore, WLS keeps track of the timer recurring expirations. On the other hand, my code in ejbTimeout() is never executed.
    What is causing these exceptions ? The stack trace is fully in WLS internal code.
    Thanks

    Indeed, the AbstractPageBean is a JSF managed bean. What does it mean to me?
    I want to add some Information:
    If I build a 'helper' class, with the following body, the same error is thrown:
    public class EJBTestHelper {
        private EJBTestRemote lookupEJBTestBean() {
                try {
                    Context c = new InitialContext();
                    return (EJBTestRemote) c.lookup("java:comp/env/ejb/EJBTestBean");
                } catch (NamingException ne) {
                    throw new RuntimeException(ne);
    }What can I do?

  • IllegalArgumentException: object is not an instance of declaring class

    Hi all,
    I know that this is the not exact forum to post this issue.
    I'm working on a clustered environment and my server details are given below
    a) jboss-4.0.2
    b) J2SDK-1.4.2_09
    In my jboss.xml file, I have defined
           <session>
                <ejb-name>ExampleSLBean</ejb-name>
                <jndi-name>ExampleSLHome</jndi-name>
                <cache-invalidation>true</cache-invalidation>
                <clustered>true</clustered>
           </session>And in my servlet i have written below code to lookup up a Stateless Session bean
    Hashtable hashtable = new Hashtable();
    hashtable.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    hashtable.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
    hashtable.put(Context.PROVIDER_URL, "localhost:1100");
    Context context = new InitialContext(hashtable);            
    Object objectRef = context.lookup("ExampleSLHome");
    System.out.println("objectRef ::: "+objectRef)
    ExampleSLHome home = (ExampleSLHome) PortableRemoteObject.narrow(objectRef, ExampleSLHome.class);after the context.lookup("ExampleSLHome") statement, I'm getting the error as
    java.lang.IllegalArgumentException: object is not an instance of declaring class.
    I'm not able to find the possible cause of the problem.
    Please help me
    thanks
    arvind

    Try this:
    Class objCls = Class.forName ("ClassName");
    Object obj = objCls.newInstance();
    method.invoke(objCls , null);
    This will throw an exception. However, following will work:
    method.invoke(obj , null);
    OR
    method.invoke(new ClassName(), null);
    Refer to the following thread for detailed discussion:
    http://forum.java.sun.com/thread.jspa?threadID=439811&messageID=1980996

  • Java.lang.IllegalArgumentException: object is not an instance of declaring

    Hi,
    I have deployed my web project(Jdev 11g) on JBoss 5GA and successful. My project use JDBC connection to Oracle Database 10g and run OK.
    But I have 1 issue. My issue: While i click pages(all page used databinding get data from DB10g), JBoss log will appearance ERROR message:
    14:49:20,361 ERROR [STDERR] Jun 13, 2011 2:49:20 PM oracle.adf.share.ADFContext getNativeJdbcConnection
    INFO:
    java.lang.IllegalArgumentException: object is not an instance of declaring class
    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 oracle.adf.share.ADFContext.getNativeJdbcConnection(ADFContext.java:1701)
    at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:990)
    at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1165)
    at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6728)
    at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:300)
    at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:331)
    at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:203)
    at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:576)
    at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:419)
    at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:8933)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4496)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2458)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2270)
    at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3168)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:460)
    at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:234)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:431)
    at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:426)
    at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:516)
    at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:862)
    at oracle.adf.model.binding.DCDataControl.setErrorHandler(DCDataControl.java:483)
    at oracle.jbo.uicli.binding.JUApplication.setErrorHandler(JUApplication.java:261)
    at oracle.adf.model.BindingContext.put(BindingContext.java:1300)
    at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:174)
    at oracle.adf.model.BindingContext.instantiateDataControl(BindingContext.java:1024)
    at oracle.adf.model.dcframe.DataControlFrameImpl.doFindDataControl(DataControlFrameImpl.java:1282)
    at oracle.adf.model.dcframe.DataControlFrameImpl.internalFindDataControl(DataControlFrameImpl.java:1186)
    at oracle.adf.model.dcframe.DataControlFrameImpl.findDataControl(DataControlFrameImpl.java:1146)
    at oracle.adf.model.BindingContext.internalFindDataControl(BindingContext.java:1149)
    at oracle.adf.model.BindingContext.get(BindingContext.java:1102)
    at oracle.adf.model.binding.DCParameter.evaluateValue(DCParameter.java:82)
    at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:111)
    at oracle.adf.model.binding.DCBindingContainer.getChildByName(DCBindingContainer.java:2708)
    at oracle.adf.model.binding.DCBindingContainer.internalGet(DCBindingContainer.java:2756)
    at oracle.adf.model.binding.DCExecutableBinding.get(DCExecutableBinding.java:115)
    at oracle.adf.model.binding.DCUtil.findSpelObject(DCUtil.java:328)
    at oracle.adf.model.binding.DCBindingContainer.evaluateParameterWithElCheck(DCBindingContainer.java:1460)
    at oracle.adf.model.binding.DCBindingContainer.findDataControl(DCBindingContainer.java:1590)
    at oracle.adf.model.binding.DCIteratorBinding.initDataControl(DCIteratorBinding.java:2470)
    at oracle.adf.model.binding.DCIteratorBinding.getDataControl(DCIteratorBinding.java:2414)
    at oracle.adf.model.binding.DCIteratorBinding.refresh(DCIteratorBinding.java:4313)
    at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:341)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.isAttributeUpdateable(JUCtrlValueBinding.java:1638)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.isAttributeUpdateable(JUCtrlValueBinding.java:1745)
    at oracle.jbo.uicli.binding.JUCtrlValueBinding.isUpdateable(JUCtrlValueBinding.java:2600)
    at oracle.adfinternal.view.faces.model.AdfELResolver._isReadOnly(AdfELResolver.java:96)
    at oracle.adfinternal.view.faces.model.AdfELResolver.isReadOnly(AdfELResolver.java:112)
    at javax.el.CompositeELResolver.isReadOnly(CompositeELResolver.java:81)
    at com.sun.faces.el.FacesCompositeELResolver.isReadOnly(FacesCompositeELResolver.java:113)
    at org.apache.el.parser.AstValue.isReadOnly(AstValue.java:128)
    at org.apache.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:224)
    at org.apache.jasper.el.JspValueExpression.isReadOnly(JspValueExpression.java:71)
    at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
    at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
    at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:117)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:334)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1015)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:46)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1491)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1410)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
    at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:352)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:187)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:405)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:654)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:573)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:170)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:290)
    at o
    14:49:20,364 ERROR [STDERR] rg.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:255)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:330)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:220)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2633)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1181)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:273)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:204)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:777)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:293)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:213)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:680)
    I don't know why this Error message appearance? Although my project run OK!
    I don't want ERROR message appearance in JBoss log. Please help me?

    You need to pass the Human object on which you intend to call that method on to invoke().
    Trying to call an instance method without an instance won't work even with reflection.

  • Object Reference Not Set To An Instance Of An Object - Outlook Add-In - Add-In Express

    Hi,
    My Add-In has been developed in VS2010 using the Add-In Express pack.
    Its a very simple add-in that shows an IT support ticket email detailing PC information. To use it, following installing the add-in, the user must select the tab in outlook and click on the Send IT Support Email button which will generate an Outlook Email
    Template with specific information about the PC that I pull using VB.
    It works fine in Windows 7 & 8, but throws an 'Object Reference Not Set To An Instance Of An Object' exception in Windows XP. Screenshot is shown below:
    The code is below
    Imports System.Runtime.InteropServices
    Imports System.ComponentModel
    Imports System.Drawing
    Imports System.Windows.Forms
    Imports AddinExpress.MSO
    Imports System.Object
    Imports System.Net
    Imports System.Environment
    Imports System.Net.NetworkInformation
    Imports System.Windows.Forms.Application
    Imports Microsoft.Office.Interop.Outlook
    Imports outlook = Microsoft.Office.Interop.Outlook
    'Add-in Express Add-in Module
    <GuidAttribute("735B7BC8-DD2F-44D8-BC37-30D86769C065"), ProgIdAttribute("$safeprojectname$.AddinModule")> _
    Public Class AddinModule
    Inherits AddinExpress.MSO.ADXAddinModule
    #Region " Add-in Express automatic code "
    'Required by Add-in Express - do not modify
    'the methods within this region
    Public Overrides Function GetContainer() As System.ComponentModel.IContainer
    If components Is Nothing Then
    components = New System.ComponentModel.Container
    End If
    GetContainer = components
    End Function
    <ComRegisterFunctionAttribute()> _
    Public Shared Sub AddinRegister(ByVal t As Type)
    AddinExpress.MSO.ADXAddinModule.ADXRegister(t)
    End Sub
    <ComUnregisterFunctionAttribute()> _
    Public Shared Sub AddinUnregister(ByVal t As Type)
    AddinExpress.MSO.ADXAddinModule.ADXUnregister(t)
    End Sub
    Public Overrides Sub UninstallControls()
    MyBase.UninstallControls()
    End Sub
    #End Region
    Public Shared Shadows ReadOnly Property CurrentInstance() As AddinModule
    Get
    Return CType(AddinExpress.MSO.ADXAddinModule.CurrentInstance, AddinModule)
    End Get
    End Property
    Private Sub AddInModule_AddInInitiatize(ByVal sender As Object, ByVal e As EventArgs) _
    Handles MyBase.AddinInitialize
    'Outlook 2010 = 14
    If Me.HostMajorVersion >= 14 Then
    AdxOlExplorerCommandBar1.UseForRibbon = False
    End If
    End Sub
    Public ReadOnly Property OutlookApp() As Outlook._Application
    Get
    Return CType(HostApplication, Outlook._Application)
    End Get
    End Property
    'Gets the MAC Address from the NIC Information
    Function getMacAddress()
    Dim nics() As NetworkInterface = _
    NetworkInterface.GetAllNetworkInterfaces
    Return nics(0).GetPhysicalAddress.ToString
    End Function
    Sub CreateTemplate()
    Dim sHostName As String
    Dim sDomain As String
    Dim sUserName As String
    Dim sOS As String
    Dim s64 As String
    Dim sMAC As String
    Dim host As String = System.Net.Dns.GetHostName()
    Dim LocalHostaddress As String = System.Net.Dns.GetHostEntry(host).AddressList(1).ToString()
    Dim MyItem As Outlook.MailItem
    'Finds the PC Number
    sHostName = Environ$("computername")
    'Finds the Domain
    sDomain = Environ$("userdomain")
    'Finds the Username logged into the PC
    sUserName = (Environment.UserDomainName & "\" & Environment.UserName)
    'Finds the Operating System
    sOS = (My.Computer.Info.OSFullName)
    'Shows the results collected from the getMacAddress Function in the sMac variable
    sMAC = getMacAddress()
    'Finds the Architecture of the Operating System - x86 or x64
    If (Environment.Is64BitOperatingSystem) Then
    s64 = ("64bit")
    Else
    s64 = ("32bit")
    End If
    'Creates a Template Email
    MyItem = OutlookApp.CreateItem(Outlook.OlItemType.olMailItem)
    'Configures the Sender as [email protected]
    MyItem.To = "[email protected]"
    'Shows the template
    MyItem.Display()
    'Shows all of the string in the Email Body
    MyItem.HTMLBody = String.Concat("<b><u>IT SUPPORT TICKET</u></b>", "<br/><br/>", "<tr><b>PC Number: </b></tr>", sDomain, "\", sHostName, "<b></b>", "<br/><br/>", "<b>Username: </b>", sUserName, "<b></b>", "<br/><br/>", "<b>OS Version: </b>", sOS, s64, "<b></b>", "<br/><br/>", "<b>IP Address: </b>", LocalHostaddress, "<b></b>", "<br/><br/>", "<b>MAC Address: </b>", sMAC, "<b></b>", "<br/><br/>", "<b>Comment:</b>", "<br/>", "<i>Please give a brief description of your problem attaching a screen shot if possible</i>", "<br/><br/>") & MyItem.HTMLBody
    End Sub
    Private Sub AdxRibbonButton1_OnClick(ByVal sender As Object, ByVal control As IRibbonControl, ByVal pressed As Boolean) Handles AdxRibbonButton1.OnClick
    'Runs CreateTemplate
    CreateTemplate()
    End Sub
    Private Sub AdxCommandBarButton1_Click(ByVal sender As Object) Handles AdxCommandBarButton1.Click
    'Runs CreateTemplate
    CreateTemplate()
    End Sub
    End Class
    I would appreciate any help with this whatsoever as I am pulling my hair out!!
    Many Thanks!!
    Chris

    Hi,
    Welcome to MSDN forum.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because your Add-in is developed using Add-in Express which is third-party, I suggest consulting Add-in Express forum:
    http://www.add-in-express.com/forum/index.php for better support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • "Object reference not set to an instance of an object" when using Sheel Shah's example

    I am attempting to use a custom add dialog as in http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx and
    I get the error "Object reference not set to an instance of an object." when clicking my button to AddEntity().  My code to call the control is:
    User u = new User();
    userdialoghelper.AddEntity(u);
    Any ideas as to why I'm getting this error?  I "think" that I've set up the class properly?
    Scott

    I may be a couple of years late to the party here (using VS2013) but I also had some issues adapting to Yann's improvements over Sheel's code.
    Sheel's screen code as provided has the word "Old in the InitializeDataWorkspace and the created methods. this does not work when copy/pasted. ALso removed the "UI" from "InitialiseUI()"
    Following code can be used with Yann's Helper Class.
    Namespace LightSwitchApplication
    Public Class EditableCustomersGrid
    Private customersDialogHelper As ModalWindow
    Private Sub EditableCustomersGrid_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
    customersDialogHelper = New ModalWindow(Me.Customers, "CustomerViewDialog")
    End Sub
    Private Sub EditableCustomersGrid_Created()
    customersDialogHelper.Initialise()
    End Sub
    Private Sub gridAddAndEditNew_CanExecute(ByRef result As Boolean)
    customersDialogHelper.CanAdd()
    End Sub
    Private Sub gridAddAndEditNew_Execute()
    customersDialogHelper.AddEntity()
    End Sub
    Private Sub gridEditSelected_CanExecute(ByRef result As Boolean)
    customersDialogHelper.CanView()
    End Sub
    Private Sub gridEditSelected_Execute()
    customersDialogHelper.ViewEntity()
    End Sub
    Private Sub EditDialogOk_Execute()
    customersDialogHelper.DialogOk()
    End Sub
    Private Sub EditDialogCancel_Execute()
    customersDialogHelper.DialogCancel()
    End Sub
    End Class
    End Namespace

  • Crawler Help: Object reference not set to an instance of an object

    I'm trying to write a custom crawler and having some difficulties.  I'm getting the document information from a database.  I'm trying to have the ClickThroughURL be a web URL and the IndexingURL be a UNC path to the file on a back-end file share.  Also, I'm not using DocFetch.  The problem I'm having is that when the crawler runs I get the following error for every card:
    &#034;4/19/05 13:43:30- (940) Aborted Card creation for document: TestDoc1.  Import error: IDispatch error #19876 (0x80044fa4): [Error Importing Card.
    Error writing Indexing File.
    SOAP fault: faultcode='soap:Server' faultstring='Server was unable to process request. --> Object reference not set to an instance of an object.']&#034;
    Has anyone seen this before?  Any help you can provide would be greatly appreciated.  I have included the code from my document.vb in case that helps.
    Thanks,
    Jerry
    DOCUMENT.VB
    Imports System
    Imports Plumtree.Remote.Util
    Imports Plumtree.Remote.Crawler
    Imports System.Resources
    Imports System.Globalization
    Imports System.Threading
    Imports System.IO
    Imports System.Data.SqlClient
    Imports System.Text
    Namespace Plumtree.Remote.CWS.MoFoDocsOpen
        Public Class Document
            Implements IDocument
            Private m_logger As ICrawlerLog
            Private DocumentLocation As String
            Private d_DocumentNumber As Integer
            Private d_Library As String
            Private d_Name As String
            Private d_Author As String
            Private d_AuthorID As String
            Private d_Category As String
            Private d_ClientName As String
            Private d_ClientNumber As String
            Private d_DateCreated As DateTime
            Private d_DocumentName As String
            Private d_DocumentType As String
            Private d_EnteredBy As String
            Private d_EnteredByID As String
            Private d_FolderID As String
            Private d_KEFlag As String
            Private d_LastEdit As DateTime
            Private d_LastEditBy As String
            Private d_LastEditByID As String
            Private d_Maintainer As String
            Private d_MaintainerID As String
            Private d_MatterName As String
            Private d_MatterNumber As String
            Private d_Practice As String
            Private d_Description As String
            Private d_Version As Integer
            Private d_Path As String
            Private d_FileName As String
            Public Sub New(ByVal provider As DocumentProvider, ByVal documentLocation As String, ByVal signature As String)
                Dim location() As String = DocumentLocation.Split(&#034;||&#034;)
                Me.DocumentLocation = DocumentLocation
                Me.d_DocumentNumber = location(0)
                Me.d_Library = location(2)
                Dim objConn As New SqlConnection
                Dim objCmd As New SqlCommand
                Dim objRec As SqlDataReader
                objConn.ConnectionString = &#034;Server=sad2525;Database=PortalDocs;Uid=sa;Pwd=;&#034;
                objConn.Open()
                objCmd.CommandText = &#034;SELECT * FROM DocsOpenAggregate WHERE Library = '&#034; & Me.d_Library & &#034;' AND DocumentNumber = &#034; & Me.d_DocumentNumber
                objCmd.Connection = objConn
                objRec = objCmd.ExecuteReader()
                Do While objRec.Read() = True
                    Me.d_Name = objRec(&#034;Name&#034;)
                    Me.d_Author = objRec(&#034;Author&#034;)
                    Me.d_AuthorID = objRec(&#034;AuthorID&#034;)
                    Me.d_Category = objRec(&#034;Category&#034;)
                    Me.d_ClientName = objRec(&#034;ClientName&#034;)
                    Me.d_ClientNumber = objRec(&#034;ClientNumber&#034;)
                    Me.d_DateCreated = objRec(&#034;DateCreated&#034;)
                    Me.d_DocumentName = objRec(&#034;DocumentName&#034;)
                    Me.d_DocumentType = objRec(&#034;DocumentType&#034;)
                    Me.d_EnteredBy = objRec(&#034;EnteredBy&#034;)
                    Me.d_EnteredByID = objRec(&#034;EnteredByID&#034;)
                    Me.d_FolderID = objRec(&#034;FolderID&#034;)
                    Me.d_KEFlag = objRec(&#034;KEFlag&#034;)
                    Me.d_LastEdit = objRec(&#034;LastEdit&#034;)
                    Me.d_LastEditBy = objRec(&#034;LastEditBy&#034;)
                    Me.d_LastEditByID = objRec(&#034;LastEditByID&#034;)
                    Me.d_Maintainer = objRec(&#034;Maintainer&#034;)
                    Me.d_MaintainerID = objRec(&#034;MaintainerID&#034;)
                    Me.d_MatterName = objRec(&#034;MatterName&#034;)
                    Me.d_MatterNumber = objRec(&#034;MatterNumber&#034;)
                    Me.d_Practice = objRec(&#034;Practice&#034;)
                    Me.d_Description = objRec(&#034;Description&#034;)
                    Me.d_Version = objRec(&#034;Version&#034;)
                    Me.d_Path = objRec(&#034;Path&#034;)
                    Me.d_FileName = objRec(&#034;FileName&#034;)
                Loop
                objCmd = Nothing
                If objRec.IsClosed = False Then objRec.Close()
                objRec = Nothing
                If objConn.State <> ConnectionState.Closed Then objConn.Close()
                objConn = Nothing
            End Sub
            'If using DocFetch, this method returns a file path to the document in the backend repository.
            Public Function GetDocument() As String Implements IDocument.GetDocument
                m_logger.Log(&#034;Document.GetDocument called for &#034; & Me.DocumentLocation)
                Return Me.d_Path
            End Function
            'Returns the metadata information about this document.
            Public Function GetMetaData(ByVal aFilter() As String) As DocumentMetaData Implements IDocument.GetMetaData
                m_logger.Log(&#034;Document.GetMetaData called for &#034; & DocumentLocation)
                Dim DOnvp(23) As NamedValue
                DOnvp(0) = New NamedValue(&#034;Author&#034;, Me.d_Author)
                DOnvp(1) = New NamedValue(&#034;AuthorID&#034;, Me.d_AuthorID)
                DOnvp(2) = New NamedValue(&#034;Category&#034;, Me.d_Category)
                DOnvp(3) = New NamedValue(&#034;ClientName&#034;, Me.d_ClientName)
                DOnvp(4) = New NamedValue(&#034;ClientNumber&#034;, Me.d_ClientNumber)
                DOnvp(5) = New NamedValue(&#034;DateCreated&#034;, Me.d_DateCreated)
                DOnvp(6) = New NamedValue(&#034;DocumentName&#034;, Me.d_DocumentName)
                DOnvp(7) = New NamedValue(&#034;DocumentType&#034;, Me.d_DocumentType)
                DOnvp(8) = New NamedValue(&#034;EnteredBy&#034;, Me.d_EnteredBy)
                DOnvp(9) = New NamedValue(&#034;EnteredByID&#034;, Me.d_EnteredByID)
                DOnvp(10) = New NamedValue(&#034;FolderID&#034;, Me.d_FolderID)
                DOnvp(11) = New NamedValue(&#034;KEFlag&#034;, Me.d_KEFlag)
                DOnvp(12) = New NamedValue(&#034;LastEdit&#034;, Me.d_LastEdit)
                DOnvp(13) = New NamedValue(&#034;LastEditBy&#034;, Me.d_LastEditBy)
                DOnvp(14) = New NamedValue(&#034;LastEditByID&#034;, Me.d_LastEditByID)
                DOnvp(15) = New NamedValue(&#034;Maintainer&#034;, Me.d_Maintainer)
                DOnvp(16) = New NamedValue(&#034;MaintainerID&#034;, Me.d_MaintainerID)
                DOnvp(17) = New NamedValue(&#034;MatterName&#034;, Me.d_MatterName)
                DOnvp(18) = New NamedValue(&#034;MatterNumber&#034;, Me.d_MatterNumber)
                DOnvp(19) = New NamedValue(&#034;Practice&#034;, Me.d_Practice)
                DOnvp(20) = New NamedValue(&#034;Description&#034;, Me.d_Description)
                DOnvp(21) = New NamedValue(&#034;Version&#034;, Me.d_Version)
                DOnvp(22) = New NamedValue(&#034;Path&#034;, Me.d_Path)
                DOnvp(23) = New NamedValue(&#034;FileName&#034;, Me.d_FileName)
                Dim metaData As New DocumentMetaData(DOnvp)
                Dim strExt As String = Right(Me.d_FileName, Len(Me.d_FileName) - InStrRev(Me.d_FileName, &#034;.&#034;))
                Select Case LCase(strExt)
                    Case &#034;xml&#034;
                        metaData.ContentType = &#034;text/xml&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case &#034;vsd&#034;
                        metaData.ContentType = &#034;application/vnd.visio&#034;
                        metaData.ImageUUID = &#034;{2CEEC472-7CF0-11d3-BB3A-00105ACE365C}&#034;
                    Case &#034;mpp&#034;
                        metaData.ContentType = &#034;application/vnd.ms-project&#034;
                        metaData.ImageUUID = &#034;{8D6D9F50-D512-11d3-8DB0-00C04FF44474}&#034;
                    Case &#034;pdf&#034;
                        metaData.ContentType = &#034;application/pdf&#034;
                        metaData.ImageUUID = &#034;{64FED895-D031-11D2-8909-006008168DE5}&#034;
                    Case &#034;doc&#034;
                        metaData.ContentType = &#034;application/msword&#034;
                        metaData.ImageUUID = &#034;{0C35DD71-6453-11D2-88C3-006008168DE5}&#034;
                    Case &#034;dot&#034;
                        metaData.ContentType = &#034;application/msword&#034;
                        metaData.ImageUUID = &#034;{0C35DD71-6453-11D2-88C3-006008168DE5}&#034;
                    Case &#034;rtf&#034;
                        metaData.ContentType = &#034;text/richtext&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case &#034;xls&#034;
                        metaData.ContentType = &#034;application/vnd.ms-excel&#034;
                        metaData.ImageUUID = &#034;{0C35DD72-6453-11D2-88C3-006008168DE5}&#034;
                    Case &#034;xlt&#034;
                        metaData.ContentType = &#034;application/vnd.ms-excel&#034;
                        metaData.ImageUUID = &#034;{0C35DD72-6453-11D2-88C3-006008168DE5}&#034;
                    Case &#034;pps&#034;
                        metaData.ContentType = &#034;application/vnd.ms-powerpoint&#034;
                        metaData.ImageUUID = &#034;{0C35DD73-6453-11D2-88C3-006008168DE5}&#034;
                    Case &#034;ppt&#034;
                        metaData.ContentType = &#034;application/vnd.ms-powerpoint&#034;
                        metaData.ImageUUID = &#034;{0C35DD73-6453-11D2-88C3-006008168DE5}&#034;
                    Case &#034;htm&#034;
                        metaData.ContentType = &#034;text/html&#034;
                        metaData.ImageUUID = &#034;{D2E2D5E0-84C9-11D2-A0C5-0060979C42D8}&#034;
                    Case &#034;html&#034;
                        metaData.ContentType = &#034;text/html&#034;
                        metaData.ImageUUID = &#034;{D2E2D5E0-84C9-11D2-A0C5-0060979C42D8}&#034;
                    Case &#034;asp&#034;
                        metaData.ContentType = &#034;text/plain&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case &#034;idq&#034;
                        metaData.ContentType = &#034;text/plain&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case &#034;txt&#034;
                        metaData.ContentType = &#034;text/plain&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case &#034;log&#034;
                        metaData.ContentType = &#034;text/plain&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case &#034;sql&#034;
                        metaData.ContentType = &#034;text/plain&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                    Case Else
                        metaData.ContentType = &#034;application/octet-stream&#034;
                        metaData.ImageUUID = &#034;{F8F6B82F-53C6-11D2-88B7-006008168DE5}&#034;
                End Select
                metaData.Name = Me.d_Name
                metaData.Description = Me.d_Description
                metaData.FileName = Me.d_FileName ' This is a file name - for example &#034;2jd005_.DOC&#034;
                metaData.IndexingURL = Me.d_Path ' This is a file path - for example &#034;\\fileserver01\docsd$\SF01\DOCS\MLS1\NONE\2jd005_.DOC&#034;
                metaData.ClickThroughURL = &#034;http://mofoweb/docsopen.asp?Unique=&#034; & HttpUtility.HtmlEncode(Me.DocumentLocation)
                metaData.UseDocFetch = False
                Return metaData
            End Function
            'Returns the signature or last-modified-date of this document that indicates to the portal whether the document needs refreshing.
            Public Function GetDocumentSignature() As String Implements IDocument.GetDocumentSignature
                Dim SigString As New StringBuilder
                Dim SigEncode As String
                SigString.Append(Me.d_DocumentNumber & &#034;||&#034;)
                SigString.Append(Me.d_Library & &#034;||&#034;)
                SigString.Append(Me.d_Name & &#034;||&#034;)
                SigString.Append(Me.d_Author & &#034;||&#034;)
                SigString.Append(Me.d_AuthorID & &#034;||&#034;)
                SigString.Append(Me.d_Category & &#034;||&#034;)
                SigString.Append(Me.d_ClientName & &#034;||&#034;)
                SigString.Append(Me.d_ClientNumber & &#034;||&#034;)
                SigString.Append(Me.d_DateCreated & &#034;||&#034;)
                SigString.Append(Me.d_DocumentName & &#034;||&#034;)
                SigString.Append(Me.d_DocumentType & &#034;||&#034;)
                SigString.Append(Me.d_EnteredBy & &#034;||&#034;)
                SigString.Append(Me.d_EnteredByID & &#034;||&#034;)
                SigString.Append(Me.d_FolderID & &#034;||&#034;)
                SigString.Append(Me.d_KEFlag & &#034;||&#034;)
                SigString.Append(Me.d_LastEdit & &#034;||&#034;)
                SigString.Append(Me.d_LastEditBy & &#034;||&#034;)
                SigString.Append(Me.d_LastEditByID & &#034;||&#034;)
                SigString.Append(Me.d_Maintainer & &#034;||&#034;)
                SigString.Append(Me.d_MaintainerID & &#034;||&#034;)
                SigString.Append(Me.d_MatterName & &#034;||&#034;)
                SigString.Append(Me.d_MatterNumber & &#034;||&#034;)
                SigString.Append(Me.d_Practice & &#034;||&#034;)
                SigString.Append(Me.d_Description & &#034;||&#034;)
                SigString.Append(Me.d_Version & &#034;||&#034;)
                SigString.Append(Me.d_Path & &#034;||&#034;)
                SigString.Append(Me.d_FileName & &#034;||&#034;)
                Dim encoding As New UTF8Encoding
                Dim byteArray As Byte() = encoding.GetBytes(SigString.ToString())
                SigEncode = System.Convert.ToBase64String(byteArray, 0, byteArray.Length)
                Return SigEncode
            End Function
            'Returns an array of the users with access to this document.
            Public Function GetUsers() As ACLEntry() Implements IDocument.GetUsers
                'no acl info retrieved
                Dim aclArray(-1) As ACLEntry
                Return aclArray
            End Function
            'Returns an array of the groups with access to this document.
            Public Function GetGroups() As ACLEntry() Implements IDocument.GetGroups
                'no acl info retrieved
                Dim aclArray(-1) As ACLEntry
                Return aclArray
            End Function
        End Class
    End Namespace

    1. I don't think you can just set the index url to a unc path.
    2. Try creating an index aspx page. In your MetaData.IndexURL set it to the index aspx page, and include query string params for the encoded unc path as well as the content type.
    3. In the index servlet, get the content type and path from the query string
    4. Get the filename from the file path
    5. Set the headers for content-type and Content-Disposition, e.g.
    Response.ContentType="application/msword"
    Response.AddHeader("Content-Disposition", "inline; filename'" + filename)
    6. Stream out the file:
    FileStream fs = new FileStream(path, FileMode.Open)
    byte[] buffer = new byte[40000]
    int result
    System.IO.Stream output = Response.OutputStream
    do
    result = fs.Read(buffer, 0, 40000)
    output.Write(buffer, 0, result)
    while (result == 40000)
    put the above in a try-catch, and then delete the temp file in the finally block.
    If this does not help, set a breakpoint in the code to find the error. Also use Log4Net to log any errors.

  • Creating multiple instances of a class in LabVIEW object-oriented programming

    How do you create multiple instances of a class in a loop?  Or am I thinking about this all wrong?
    For instance, I read in a file containing this information:
    Person Name #1
    Person Age #1
    Hobby #1
    Hobby #2
    Hobby #3
    Person Name #2
    Person Age #2
    Hobby #1
    Hobby #2
    Hobby #3
    Person Name #3
    Person Age #3
    Hobby #1
    Hobby #2
    Hobby #3
    If I define a Person class with name, age, and an array of strings (for the hobbies), how can I create several new Person instances in a loop while reading through the text file?
    FYI, new to LabVIEW OOP but familiar with Java OOP.  Thank you!

    First of all, let's get your terminology correct.  You are not creating multiple instances of a class.  You are creating Objects of the class.
    Use autoindexing to create an array of your class type.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Jaas sample progrma in weblogic 6.1 giving the following error java.lang.SecurityException: attempting to add an object which is not an instance of java.security.Principal to a Subjec

    jaas sample progrma in weblogic 6.1 giving the following error java.lang.SecurityException:
    attempting to add an object which is not an instance of java.security.Principal
    to a Subjec
    on runnig the program during the call of method Authenticate.authenticate(env,
    subject); giving following exceptions Error: Login Exception on authenticate,
    java.lang.SecurityException: attempting to add an object which is not an instance
    of java.security.Principal to a Subjec t's Principal Set Authentication Failed:
    Unexpected Exception, javax.security.auth.login.LoginExce ption: java.lang.SecurityException:
    attempting to add an object which is not an instance of java.security.Principal
    to a Subject's Principal Set javax.security.auth.login.LoginException: javax.security.auth.login.LoginExcepti
    on: java.lang.SecurityException: attempting to add an object which is not an ins
    tance of java.security.Principal to a Subject's Principal Set at examples.security.jaas.SampleLoginModule.login(SampleLoginModule.java
    :192) at java.lang.reflect.Method.invoke(Native Method) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:595)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1 25) at
    javax.security.auth.login.LoginContext$3.run(LoginContext.java:531) at java.security.AccessController.doPrivileged(Native
    Method) at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java
    :528) at javax.security.auth.login.LoginContext.login(LoginContext.java:449) at
    examples.security.jaas.SampleClient.main(SampleClient.java:96)
    1)what is the reason for this problem
    2)in weblogic document they told to edit server.policy file in webligic\lib folder
    a)what the modification is needed in this file..?

    Hi jerry
    i already got that problem solved by removing jaas.jar file
    from class path.
    i don'nt how it is working with out in classpath...?
    Jerry <[email protected]> wrote:
    Hi Nivas,
    I think that the problem you are seeing has something to do with the
    placement of jaas.jar in your classpath
    On WebLogic server, put jaas.jar in the classpath after weblogic.jar.
    I would bet that you have it placed before weblogic.jar right now.
    I don't think the exception that you're seeing right now has anything
    to do with your weblogic.policy file right now, so I think it is
    safe to not worry about it right now.
    Hope this helps,
    Joe Jerry

  • "cacheHostInfo is null" and Add-SPDistributedCacheServiceInstance : Object reference not set to an instance of an object.

    I am working on a standalone install Sharepoint 2013 (no Active Directory). I found newsfeed feature is not available and checked Distributed Cache service is stopped. When start it “cacheHostInfo is null” is returned.
    I checked the Windows service “AppFabric caching service” is stopped because the default identity “Network Service” not work. Then I change the AppFabric service identity to use “.\administrator” (which is also the sp farm administrator) and the service can
    be started.
    However the “cacheHostInfo is null” when try to start Distributed Cache service in central admin.
    I searched on web and found this blog: http://rakatechblog.wordpress.com/2013/02/04/sharepoint-2013-spdistributedcacheserviceinstance-cachehostinfo-is-null/
    I tried to run the script but it return error:
    Add-SPDistributedCacheServiceInstance : Object reference not set to an
    instance of an object.
    At C:\root\ps\test.ps1:8 char:13
    + $whatever = Add-SPDistributedCacheServiceInstance
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (Microsoft.Share…ServiceInstance:
    SPCmdletAddDist…ServiceInstance) [Add-SPDistributedCacheServiceInstance]
    , NullReferenceException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletAddDistr
    ibutedCacheServiceInstance
    I am not sure what went wrong. Please give me some idea? Thank you for any comment!

    Can you deploy Active Directory as installing without is not a supported installation scenario - http://support.microsoft.com/kb/2764086.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Test-OutlookConnectivity WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object.

    Hi All,
    When we do a test-outlookconnectivity -protocol:http the result is a success but then we get the following:
    ClientAccessServer   ServiceEndpoint                               Scenario                           
    Result  Latency
    (MS)
    xxxxxxxxxxxx... xxxxxxxxxxxxxx                 Autodiscover: Web service request.  Success   46.80
    WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance
     of an object.
    Object reference not set to an instance of an object.
        + CategoryInfo          : NotSpecified: (:) [Test-OutlookConnectivity], NullReferenceException
        + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Monitoring.TestOutlookConnectivityTask
    So it looks like it's not completing successfully.
    I can't find anything on this in particular, and don't really know how to go about solving it - We are fully up to date, Exchange 2010 Sp2 with Rollup 5-v2
    Any help appreciated!

    hi,
    I have the same issue also on Exchange 2010 SP2 RU5v2
    I ran your command and get the below
    [PS] C:\Installs\report\Activesync>Test-OutlookConnectivity -Protocol:http |FL
    RunspaceId                  : ebd2c626-1634-40ad-a17e-c9a713d1a62b
    ServiceEndpoint             : autodiscover.domain.com
    Id                          : Autodiscover
    ClientAccessServer          : CAS01.domain.com
    Scenario                    : Autodiscover: Web service request.
    ScenarioDescription         :
    PerformanceCounterName      :
    Result                      : Success
    Error                       :
    UserName                    : Gazpromuk.intra\extest_645e41faa55f4
    StartTime                   : 8/21/2013 4:08:50 PM
    Latency                     : 00:00:00.1250048
    EventType                   : Success
    LatencyInMillisecondsString : 125.00
    Identity                    :
    IsValid                     : True
    WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object.
    Object reference not set to an instance of an object.
        + CategoryInfo          : NotSpecified: (:) [Test-OutlookConnectivity], NullReferenceException
        + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Monitoring.TestOutlookConnectivityTask
     Any help would be greatly appreciated, I also get random failures of OWA, EAS and web services, very frustrating
    I have no errors in the app event log
    thanks
    Faisal Saleem Windows Systems Analyst 07595781867

  • "An error has occurred:Object reference not set to an instance of an object."

    This error message comes up with a user in InfoView.  The user schedules a report, updates parameters, and the report kicks off successfully.  But then a few minutes later, this error is received.    This occurs sporadically, regardless of the length of time of report or amount of data being retrieved.  Sometimes the report runs to completion.  Other times this error message occurs.
    Has anyone seen this before and have any thoughts?
    Thank you.
    “An error has occurred:Object reference not set to an instance of an object.”

    Are you able to replicate the issue both in Java and .NET InfoView?
    For .NET InfoView, sometimes the "An error has occurred: Object reference not set to an instance of an object" error shows up after the .NET Framework is upgraded to 2.0

  • "Object reference not set to an instance of an object" when opening designer

    I have a Windows Forms project which was originally developed in Visual Studio 2010. I migrated the project to VS2013, and now every time I open the project's main form, the designer complains of a null reference. If I hit "Ignore and Continue",
    the code compiles just fine. The error in question appears in the "Windows Form Designer generated code" region. Even more curious, the line in question is not the first reference to the object. It's as if the first few times it needs to interact
    with the object, it's fine, then at a certain point it becomes null.
    Here is the call stack for the error:
    at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component,
    Object value)at
    Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkPropertyDescriptor.SetValue(Object
    component, Object value)at
    System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager
    manager, CodeAssignStatement statement, CodePropertyReferenceExpression
    propertyReferenceEx, Boolean reportError)at
    System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager
    manager, CodeAssignStatement statement)at
    System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
    manager, CodeStatement statement) 
    And here is the code in question:
    this.optionsControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); 
    this.optionsControl.IsAsciiMode = false;           
    this.optionsControl.Location = new System.Drawing.Point(3, 3);
    this.optionsControl.LogControl = null;           
    this.optionsControl.Name = "optionsControl";           
    this.optionsControl.PlugInManager = null;           
    this.optionsControl.PortFacade = null;           
    this.optionsControl.Size = new System.Drawing.Size(613, 259);
    this.optionsControl.TabIndex = 0;
    The problem is reported at the third line, "this.optionsControl.Location = new System.Drawing.Point(3, 3);".

    Hi Eric,
    I have made a research about your issue, and I found it might be caused by the usercontrol in the project. Was “this.optionsControl” a UserControl? It seems that this issue was difficult to handle.
    If possible, I would recommend you recreate this control in a new project.
    In addition, I think you could turn to the links below, they may be useful to you:
    # How to get more information about exceptions thrown by the designer when switching from code to design view?
    http://community.sharpdevelop.net/forums/p/16124/43105.aspx
    # How to avoid WSODs in the Visual Studio 2005 Designer
    http://www.codeproject.com/Articles/13584/How-to-avoid-WSODs-in-the-Visual-Studio-Desig
    # design time error: object reference not set an instance of an object but runs fine
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b3676bef-e457-4aac-b438-d3ed8a667e3f/design-time-error-object-reference-not-set-an-instance-of-an-object-but-runs-fine?forum=winforms
    Best Regards,
    Edward
    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
    Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
    completely understand the risk before retrieving any software from the Internet.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • "object reference not set to an instance of an object" after update datasource lightswitch

    I'm using Latest Visual Studio 2013 Ultimate (2013.3) and when I attempt to open "update datasource"  it throws an error
    "Object reference not set to instance of an object." 

    It's quite possibly an issue with the data source definition being dependent on a newer version of a lightswitch framework DLL.  When I've hit these kinds of issues I've simply deleted the datasource, run a nuget refresh and added the datasource again.
     If you have any code or queries, save a copy of the code-behind files and jot down the details of the queries before you try this.

  • Object reference not set to an instance of an object. at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.

    Hello.
    I just installed a new farm, the wizard was succesfull in all steps.  However when I try to load the default site it created I got this exception.
    Any idea?
    System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs()
        at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext)     at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalAvailable()     at Microsoft.Office.Server.WebControls.MyLinksRibbon.EnsureMySiteUrls()
        at Microsoft.Office.Server.WebControls.MyLinksRibbon.get_PortalMySiteUrlAvailable()     at Microsoft.Office.Server.WebControls.MyLinksRibbon.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at
    System.Web.UI.Control.LoadRecu...
    Follow me on Twitter <<<

    I tried removing the user profile service application and creating it again, when I did that, and tried to navigate to the page to manager the user profile application it shows me an exception
    According to the uls log viewer its;
    Microsoft.Office.Server.UserProfiles.UserProfileApplicationNotAvailableException: This User Profile Application's connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator.
       at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage.get_CurrentApplicationProxy()     at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage.IsProfileSynchronizationRunning()     at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceImportStatisticsWebPart.RenderSectionContents(HtmlTextWriter
    writer)     at Microsoft.SharePoint.Portal.WebControls.UserProfileServiceImportStatisticsWebPart.RenderWebPart(HtmlTextWriter writer)     at Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter ...
    I checked and the sharepoint web services default was stopped, I started and still the same error,  that pool is under Local Service account.
    Follow me on Twitter <<<

Maybe you are looking for

  • Prompting the Answers from BI Publisher Report

    Hi Gurus, Our Customer needs a report in particular format. So i had used the Bi publisher to create and I have uploaded template and all works fine. Now he wants to get the details of particular column. So i what I had done was that in template buil

  • Upgrading N586 CPU to A10-4600m

    I have heard of many people upgrading their AMD A6-4400m to the more powerful A10-4600m as they are the same socket (FS1r2) with great success. I was planning to do the same and wondering if its possible to switch them out on a lenovo laptop and if t

  • Sharing in 2nd account

    For some reason the SHARED feature in the side bar does not show up in my wife's account on my iMac. If I log in to my account (admin) I can see my Macbook under shared but when I switch to my wifes account nothing is there????

  • Stone plus (with built-in speaker) can't connect to pc

    6stone plus (with built-in speaker) can't connect to pcm hi, my creative stone plus with in built speaker got a problem, when I connect it to the pc it starts charging, but it isn't recognized in "my computer" ( my OS is windows xp), so I'm not able

  • Frequent delays, hard drive noises

    Hey there everyone, I was wondering if anyone had a clue what might be causing the problems that I've been having with my PB lately. Ever since I installed 10.4 (a clean install as I had a ton of stuff that I wanted to get rid of) I've had issues wit