Documentum 5.3 SP6 : TBO ClassCastException

I implemented Custom TBO. But When I try to execute custom code I received exception: ClassCastException
If I look to object :
CustomType#1221
but if I look like this:
object instaceof ICustomType
result is false.

What could i forgot here?

Comments

  • Pasting your actual code would help give us context.

  • ssmirnov
    edited September 18, 2018 #3

    Here is my simple code:
    public interface ICustomType extends IDfDocument, IDfBusinessObject, IDfDynamicInheritance {
    public boolean tryLock() throws DfException;
    }

        public class CustomType extends DfDocument implements ICustomType {
            public boolean tryLock() throws DfException {
                //  some code here
            }
        }
    
  • This looks fine. What about your code that calls TBO? Have you reviewed this link:

    http://rinturajak.blogspot.com/2014/06/implementation-of-documentum-business.html?m=1

  • @DCTM_Guru had not seen that link before. Will bookmark. Found another I had not seen:
    https://ajithp.com/category/documentum/dfc-documentum/bof-dfc-documentum-documentum

    I usually refer to Paul Warren or Don Robertson blogs:
    https://paulcwarren.wordpress.com/category/bof/
    https://donr7n.wordpress.com/category/bof/

    Anyhow as this is for 5.3 SP6, and Composer was a dream in the eyes of engineering, need an older resource, like blue fish guides
    https://www.bluefishgroup.com/insights/articles/practical-guide-to-bof

    @ssmirnov have you configured debor.properties to define your new TBO?

    Brian Dinneen
    ECD Documentum Designated Support Engineer

    image

  • Yes, I configured dbor.properties and put him to config folder.

  • Curious... please post code calling which would fire the TBO and the full exception

    Brian Dinneen
    ECD Documentum Designated Support Engineer

    image

  • ssmirnov
    edited September 18, 2018 #8

    run from lifecycle module:
    ...
    boolean isLock = ((ICustomType) object).tryLock();
    ...

    Exception another i recieved:
    javax.servlet.ServletException: DfException:: THREAD: http-9080-Processor25; MSG: [DM_DFC_E_CLASS_NOT_FOUND] Unable to instantiate the necessary java class: ru.cs.bof.custom_type.CustomType; ERRORCODE: 202; NEXT: null
    at com.documentum.mthdservlet.DoMethod.invokeMethod(Unknown Source)
    at com.documentum.mthdservlet.DoMethod.doPost(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)

    I have composer, maybe create module tbo through this product?

  • run from lifecycle module:
    ...
    boolean isLock = ((ICustomType) object).tryLock();
    ...

    Strange method call.. get a proper handle on custom TBO interface, so you can access all methods.

    ICustomType object = (ICustomType) session.getObject ...
    boolean isLock = object.tryLock();

    Exception:
    javax.servlet.ServletException: DfException:: THREAD: http-9080-Processor25; MSG: [DM_DFC_E_CLASS_NOT_FOUND] Unable to instantiate the necessary java class: ru.cs.bof.custom_type.CustomType; ERRORCODE: 202; NEXT: null
    at com.documentum.mthdservlet.DoMethod.invokeMethod(Unknown Source)
    at com.documentum.mthdservlet.DoMethod.doPost(Unknown Source)

    @ssmirnov where have you put the implementation jar file?
    If you have put them on the method server they are not being found.
    You are in Java CLASSLOADER ****.
    Stop JMS, move your jar files, putting them in the lib folder under ServerApps.war might work

    If you have not copied them to JMS, do so.

    I have composer, maybe create module tbo through this product?

    Composer will not help.
    1. It uses BOF2 deployment process. BOF2 was introduced in 6.0
    2. It will not fix the problem of jars

    Brian Dinneen
    ECD Documentum Designated Support Engineer

    image

  • thanks Brian! I will try.

  • Brian Dinneen
    edited September 20, 2018 #11

    Any luck? Another blog post on jar **** .. https://blog.codefx.org/java/jar-****

    Brian Dinneen
    ECD Documentum Designated Support Engineer

    image

  • Thanks for your help Brian, now its work.
    I found solution in your reference https://donr7n.wordpress.com/category/bof/

  • Happy to help, please mark this question as answered

    Brian Dinneen
    ECD Documentum Designated Support Engineer

    image