Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Invoke Transfromation from JSP

  1. #1
    Join Date
    Dec 2009
    Posts
    27

    Default Invoke Transfromation from JSP

    Dear Kettle,
    I tried to launch carte and sending transformation file to it using J2EE application, it works OK.
    But, I try to invoke java bean which launch Carte and send transformation from JSF/JSP page, it generates error.
    The same error is generated if used JSP tags directly to embed java code for launching carte and sending transformation.
    Code:
                 ClusterGenerator cg = new ClusterGenerator();
                 CarteLauncher cl = new CarteLauncher("localhost", 1500);
                 cl.run();
                 cg.launchSlaveServers();
                 KettleEnvironment.init();
                TransMeta transMeta = new TransMeta("C:/Users/Rashed/workspace/kettle_test/trans/tests/excel2XML.ktr");
                Trans trans = new Trans(transMeta);
                 trans.getTransMeta().setInternalKettleVariables(trans);
                TransExecutionConfiguration jec = new TransExecutionConfiguration();
                jec.setRemoteServer(cg.LOCAL_TEST_SLAVES[0]);
                trans.sendToSlaveServer(transMeta, jec, null);
    generates the following error:
    Code:
    Error 500--Internal Server Error
    
    javax.faces.FacesException: #{transUI_backing.commandButton1_action}: java.lang.NullPointerException
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
    	at javax.faces.component.UICommand.broadcast(UICommand.java:387)
    	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
    	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
    	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
    	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    	... 25 more
    Caused by: java.lang.NullPointerException
    	at org.pentaho.di.trans.StepLoader.initStepPluginMeta(StepLoader.java:113)
    	at org.pentaho.di.trans.StepLoader.init(StepLoader.java:154)
    	at org.pentaho.di.trans.StepLoader.init(StepLoader.java:165)
    	at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:20)
    	at running.Send2Carte.runTransformation(Send2Carte.java:62)
    	at running.transUI_backing.commandButton1_action(transUI_backing.java:35)
    	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 com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
    	... 26 more
    Last edited by rdkhalil; 07-28-2010 at 12:20 PM.

  2. #2
    Join Date
    Dec 2009
    Posts
    27

    Default Invoke Transfromation from JSP and/or Web service

    Dear Kettles,

    Is there any solution to execute tansformations/jobs via JSP pages and/or Web service?
    or at least manage Carte web server from Web application deployed on another Web server?

    Thanks in advance ))

  3. #3
    Join Date
    Dec 2009
    Posts
    27

    Default

    Any help from kettle members ?

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I guess what you are trying to do is a bit... extra-ordinary.
    It seems like your JSP is launching a cluster or Carte instances just to execute a transformation on it. Perhaps that is a bit excessive.

    First, make sure to run KettleEnvironment.init(); before anything else Kettle related.

    Then... Perhaps you can run the slave server as a separate service on a server somewhere. Then you can simply load the TransMeta and send it over to the slave server.

    Forget about creating a Trans object. You can try:

    Trans.sendToSlaveServer(transMeta, jec, null);

    Now, again, personally I would simply execute the transformation without the use of the slave server unless it was really necessary.

    Good luck,
    Matt

  5. #5
    Join Date
    Dec 2009
    Posts
    27

    Default

    Dear Matt,

    Quote Originally Posted by MattCasters View Post
    First, make sure to run KettleEnvironment.init(); before anything else Kettle related.
    ....
    You can try:

    Trans.sendToSlaveServer(transMeta, jec, null);

    Matt
    The first posted error is still generated.

    Quote Originally Posted by MattCasters View Post
    I guess what you are trying to do is a bit... extra-ordinary.
    It seems like your JSP is launching a cluster or Carte instances just to execute a transformation on it. Perhaps that is a bit excessive.

    Matt
    Because I develope Web aplication to integrate data from several data sources in dynamic way, I need to develop ETL tasks as Integration services.
    Now, I haven't problem to run transformations/jobs/carte or sending transformation/job to slave server using PDI's Java library.
    But, when developing Web services from these java classes, it always generates the above error, when testing the Web service or when invoking the java bean from JSP/JSF pages.
    Unfortunately, my web application is compiled successfully, but the error is generated in the runtime. I tried to deploy the same Web application in several Web server containers (e.g. Oracle WebLogic server, GlassFish, Tomcat, and Jboss), but always can't initailize KettleEnvironment or StepLoader in the Web server.
    Best regards,
    Thanks in advance!
    rdkhalil

  6. #6
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I don't think anybody ever ran a transformation using Java in JSP.
    To be honest, I know absolutely nothing about JSP. However, my gut feeling is that it's not a good idea.

    Good luck with your project!

    Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.