9 Replies Latest reply: May 20, 2009 7:23 PM by tbeets RSS

    NPE validating a configuration plan in JDev

    tbeets
      I'm trying to define an SCA reference property (File Adapter) using a configuration plan.

      Here is my .jca file for the adapter. I've defined LogicalDirectory at design time to be token "TARGET_DIRECTORY". For deployment, I want to define the target directory as the physical directory:
      <adapter-config name="WriteApprovalResults" adapter="File Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
        
        <connection-factory location="eis/FileAdapter" adapterRef=""/>
        <endpoint-interaction portType="Write_ptt" operation="Write">
          <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
            <property name="LogicalDirectory" value="TARGET_DIRECTORY"/>
            <property name="FileNamingConvention" value="order_%SEQ%.txt"/>
            <property name="Append" value="false"/>
            <property name="NumberMessages" value="1"/>
          </interaction-spec>
        </endpoint-interaction>
      
      </adapter-config>
      Here is how the SCA reference property looks in composite.xml:
        <reference name="WriteApprovalResults"
                   ui:wsdlLocation="WriteApprovalResults.wsdl">
          <interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/file/POProcessing/POProcessing/WriteApprovalResults%2F#wsdl.interface(Write_ptt)"/>
          <binding.jca config="WriteApprovalResults_file.jca"/>
          <property name="TARGET_DIRECTORY" type="xs:string" many="false"
                    override="may"></property>
        </reference>
      I right-clicked composite.xml in jdev and created the configuration plan. In the generated plan there was already a TARGET_DIRECTORY property reference and an empty <replace></replace> element.

      I put the physical directory in the <replace>:
       <reference name="WriteApprovalResults">
           <property name="TARGET_DIRECTORY">
               <replace>/usr2/eaoracle/temp</replace>
           </property>
           <binding type="jca"/>
      </reference>
      But this is what I get when I validate the configuration plan:
      Buildfile: /usr/local/workspace/dev/ofm1111eap/jdeveloper/bin/ant-sca-compile.xml
      
      validateplan:
          [input] skipping input as property scac.input has already been set.
          [input] skipping input as property scac.output has already been set.
          [input] skipping input as property scac.plan has already been set.
      [validateplan] reportPlanFrom: Started for composite file = /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/composite.xml Report to file = /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/SCA-INF/classes/POProcessing_cfgplan_report.log
      [validateplan] Loading Composite file /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/composite.xml
      [validateplan] Composite loaded
      [validateplan] Attempting to load provided plan file /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/POProcessing_cfgplan.xml
      [validateplan] Load deployment plan file /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/POProcessing_cfgplan.xml
      [validateplan] Done Load deployment plan file /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/POProcessing_cfgplan.xml
      [validateplan] Done loading provided plan file /usr/local/workspace/mywork/eap11gR1/SOA11gFoundationTutorial/po/POProcessing/POProcessing/POProcessing_cfgplan.xml
      [validateplan] Read composite model =POProcessing
      [validateplan] Adding import, services and references to POProcessing from rules for POProcessing
      [validateplan] Modified Composite [ POProcessing ]
      [validateplan] 
      [validateplan]      Service
      [validateplan] 
      [validateplan]        Service  [ receivePO ]
      [validateplan] 
      [validateplan]          Service Bindings
      [validateplan] 
      [validateplan]             Binding  [ ws ]
      [validateplan] 
      [validateplan]      Attribute name=port
      [validateplan] 
      [validateplan]           No change in old and new value http://oracle.com/sca/soapservice/POProcessing/POProcessing/receivePO#wsdl.endpoint(receivePO/execute_pt) 
      [validateplan] 
      [validateplan]      Reference
      [validateplan] 
      [validateplan]        Reference  [ WriteApprovalResults ]
      [validateplan] 
      [validateplan]          Property [ TARGET_DIRECTORY ]
      [validateplan] 
      [validateplan] java.lang.NullPointerException
      [validateplan]      at oracle.soa.deployplan.DeployManager.logAndAppend(DeployManager.java:1126)
      [validateplan]      at oracle.soa.deployplan.DeployManager.checkProperties(DeployManager.java:756)
      [validateplan]      at oracle.soa.deployplan.DeployManager.checkCompositeService(DeployManager.java:1732)
      [validateplan]      at oracle.soa.deployplan.DeployManager.checkPlan(DeployManager.java:629)
      [validateplan]      at oracle.soa.deployplan.DeployManager.reportAndModify(DeployManager.java:1505)
      [validateplan]      at oracle.soa.deployplan.task.reportPlan.execute(reportPlan.java:68)
      [validateplan]      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [validateplan]      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      [validateplan]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [validateplan]      at java.lang.reflect.Method.invoke(Method.java:597)
      [validateplan]      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
      [validateplan]      at org.apache.tools.ant.Task.perform(Task.java:348)
      [validateplan]      at org.apache.tools.ant.Target.execute(Target.java:357)
      [validateplan]      at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [validateplan]      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
      [validateplan]      at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
      [validateplan]      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [validateplan]      at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
      [validateplan]      at org.apache.tools.ant.Main.runBuild(Main.java:698)
      [validateplan]      at org.apache.tools.ant.Main.startAnt(Main.java:199)
      [validateplan]      at org.apache.tools.ant.Main.start(Main.java:161)
      [validateplan]      at org.apache.tools.ant.Main.main(Main.java:250)
      
      BUILD FAILED
      /usr/local/workspace/dev/ofm1111eap/jdeveloper/bin/ant-sca-compile.xml:217: java.lang.NullPointerException
      
      Total time: 0 seconds
        • 1. Re: NPE validating a configuration plan in JDev
          tbeets
          More info:

          Even though it wouldn't validate, I attached the configuration plan during deployment of the composite from JDev. The composite deployed cleanly and there were no deployment errors; however the TARGET_DIRECTORY property did not get set.

          This is not what I would have expected.

          Todd
          • 2. Re: NPE validating a configuration plan in JDev
            jay.kasi
            Please see appendix B in the soa tutorial that was made available in the EAP site to figure out how to do this.
            • 3. Re: NPE validating a configuration plan in JDev
              tbeets
              Hi Jay,

              The example in Appendix B happens to accomplish this specific example (i.e. by modifying the jca:property "PhysicalDirectory") but begs the real point ~

              Is it not legal to use a configuration plan to replace a Service reference property in composite.xml?

              -Todd
              • 4. Re: NPE validating a configuration plan in JDev
                jay.kasi
                yes. you can promote a jca property as a sca reference property and modify it. You are refereing to the property by value, not name. The name of the property is PhysicalDirectory. See how "append" was promoted to an sca reference property in appendix B.
                • 5. Re: NPE validating a configuration plan in JDev
                  tbeets
                  I'm a little confused about what you're trying to convey.

                  Are you saying that using the Logical Directory functionality of the File Adapter is deprecated in 11g and not expected to work?

                  It was the JDev File Adapter wizard which created the SCA reference property "TARGET_DIRECTORY" from the value that I specified for the JCA property LogicalDirectory.

                  In fact, I have been using EM to set the value of the TARGET_DIRECTORY SCA property against the deployed composite reference and the File Adapter has been honoring this [directory] value when writing to server disk (i.e. it is in fact doing what I expected). The only part not working is setting the SCA reference property via configuration plan rather than through the EM console.

                  I do notice that the generated configuration plan does differ from the example in Appendix B in that the <property> to replace is not nested in the <binding> element as in Appendix B.

                  Please clarify.

                  -Todd
                  • 6. Re: NPE validating a configuration plan in JDev
                    jay.kasi
                    What I did was the ollowing.

                    open composite.xml.
                    click on the file adapter reference.
                    look the the property editor in the lower right.
                    click the plus sign in the binding properties section of the property editor.
                    select PhysicalDirectory.
                    You will see the property PhysicalDirectory in the sca reference for the file adapter in the xml view of the composite.xml
                    Now right click on composite.xml and select generate a deploymnt plan.
                    You will see the property PhysicalDirectory in the deployment plan.
                    Modify the directory value of the property.
                    select validate the deploymnt plan.
                    You will see the new directory now being used.
                    • 7. Re: NPE validating a configuration plan in JDev
                      tbeets
                      I completely understand the Appendix.

                      I don't understand the relationship of the LogicalDirectory functionality of the JCA FileAdapter in respect to what you are repeating. Should either technique work or are you saying that the LogicalDirectory functionality is broken in RC2 and should never be used (i.e. it is now an outmoded concept now that SCA reference properties can do the abstraction more cleanly)?

                      Either way, seems like there need to be changes by Oracle around this to either fix bugs, remove deprecated functionality, or change documentation.

                      Todd
                      • 8. Re: NPE validating a configuration plan in JDev
                        jay.kasi
                        I am sorry. I have never used the "LogicalDirectory" thing that you are talking about. Has anyone else?
                        • 9. Re: NPE validating a configuration plan in JDev
                          tbeets
                          Hi Jay,

                          Please see this EAP documentation:

                          Oracle® Fusion Middleware User's Guide for Technology Adapters
                          11g Release 1 (11.1.1.1.0)
                          Part Number E10231-01

                          4.3.1.2.1 Specifying Inbound Physical or Logical Directory Paths in SOA Composite

                          -Todd