0

ローカル マシンから XML ファイルを読み込もうとしています。ただし、次のコード:

$datasourceXmlFilePath=$configuration.config.mondrian.DataSources.filePath

$webXmlFilePath=$configuration.config.mondrian.web.'web-app'.filePath

if(!(Test-Path($datasourceXmlFilePath)))
{
    Write-Host "Datasource.xml not found. Exiting the script" -ForegroundColor red
    exit
}

if(!(Test-Path($webXmlFilePath)))
{
    Write-Host "Web.xml not found. Exiting the script" -ForegroundColor red
    exit
}

[xml]$datasourceXml=Get-Content $datasourceXmlFilePath
Write-Host "XML created"

[xml]$webl= Get-content $webXmlFilePath
Write-Host "XML Created"

次のエラーが表示され続けます。

XML created
Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "The remote server returned an error: (407) Pr
oxy Authentication Required."
At line:20 char:11
+ [xml]$webl <<<< = Get-content $webXmlFilePath
    + CategoryInfo          : MetadataError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : RuntimeException

どちらの XML も整形式ですが、一方のファイルが正常に読み取られ、もう一方のファイルが正常に読み取られない理由がわかりません。2 番目の xml ファイルの場所を変更しようとしましたが、それでも同じ結果が得られました。

Windows 7 マシンで実行している WindowsPowershell_ise v1.0 を使用しています。

問題が発生している xml ファイルは次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

  <display-name>Mondrian</display-name>
  <description/>

  <!-- optional? now in JPivot by default  -->
  <context-param>
    <param-name>contextFactory</param-name>
    <param-value>com.tonbeller.wcf.controller.RequestContextFactoryImpl</param-value>
  </context-param>

  <context-param>
    <param-name>connectString</param-name>
    <!--<param-value>Provider=Mondrian;Jdbc=jdbc:mysql://localhost:3306/foodmart?user=root&#38;password=;Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=com.mysql.jdbc.Driver</param-value>-->
  <param-value>Provider=Mondrian;Jdbc='jdbc:sqlserver://172.25.37.213;user=QwikSilver_user;password=Newuser123;databaseName=FoodMart;';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>
  </context-param>

  <!-- optional
  <context-param>
    <param-name>chartServlet</param-name>
    <param-value>/path/to/chartServlet</param-value>
  </context-param>
  -->

  <filter>
    <filter-name>JPivotController</filter-name>
    <filter-class>com.tonbeller.wcf.controller.RequestFilter</filter-class>
    <init-param>
      <param-name>errorJSP</param-name>
      <param-value>/error.jsp</param-value>
      <description>URI of error page</description>
    </init-param>
    <init-param>
      <param-name>busyJSP</param-name>
      <param-value>/busy.jsp</param-value>
      <description>This page is displayed if a the user clicks
        on a query before the previous query has finished</description>
    </init-param>
    <!--
    <init-param>
      <param-name>forceExtension</param-name>
      <param-value>.faces</param-value>
      <description>replace .jsp with .faces</description>
    </init-param>
    -->
  </filter>

  <filter-mapping>
    <filter-name>JPivotController</filter-name>
    <url-pattern>/testpage.jsp</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>mondrian.web.taglib.Listener</listener-class>
  </listener>

  <!-- resources initializer -->
  <listener>
    <listener-class>com.tonbeller.tbutils.res.ResourcesFactoryContextListener</listener-class>
  </listener>

  <servlet>
    <servlet-name>MDXQueryServlet</servlet-name>
    <servlet-class>mondrian.web.servlet.MdxQueryServlet</servlet-class>
    <init-param>
      <param-name>connectString</param-name>
      <!--<param-value>Provider=Mondrian;Jdbc=jdbc:mysql://localhost:3306/foodmart?user=root&#38;password=;Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=com.mysql.jdbc.Driver</param-value>-->
    <param-value>Provider=Mondrian;Jdbc='jdbc:sqlserver://172.25.37.213;user=QwikSilver_user;password=Newuser123;databaseName=FoodMart;';Catalog=/WEB-INF/queries/FoodMart.xml;JdbcDrivers=com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>
    </init-param>
  </servlet>

  <servlet>
    <servlet-name>MondrianXmlaServlet</servlet-name>
    <servlet-class>mondrian.xmla.impl.DynamicDatasourceXmlaServlet</servlet-class>
    <!--<servlet-class>mondrian.xmla.impl.DefaultXmlaServlet</servlet-class>-->
   <init-param>
      <param-name>DataSourcesConfig</param-name>
      <param-value>file:D:\setups\apache-tomcat-6.0.24\webapps\mondrian\WEB-INF\datasources.xml</param-value>
    </init-param>

    <!-- 
      This is an example of how to add a callback to the XML/A servlet.
      It must implement mondrian.xmla.XmlaRequestCallback.
    <init-param>
      <param-name>Callbacks</param-name>
      <param-value>com.example.MyCallbackClass;com.example.SomeOtherCallback</param-value>
    </init-param>
    -->
  </servlet>


  <!-- jfreechart provided servlet -->
  <servlet>
    <servlet-name>DisplayChart</servlet-name>
    <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
  </servlet>

  <!-- jfreechart provided servlet -->
  <servlet>
    <servlet-name>GetChart</servlet-name>
    <display-name>GetChart</display-name>
    <description>Default configuration created for servlet.</description>
    <servlet-class>com.tonbeller.jpivot.chart.GetChart</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>Print</servlet-name>
    <display-name>Print</display-name>
    <description>Default configuration created for servlet.</description>
    <servlet-class>com.tonbeller.jpivot.print.PrintServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>DisplayChart</servlet-name>
    <url-pattern>/DisplayChart</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Print</servlet-name>
    <url-pattern>/Print</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>GetChart</servlet-name>
    <url-pattern>/GetChart</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>MDXQueryServlet</servlet-name>
    <url-pattern>/mdxquery</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>MondrianXmlaServlet</servlet-name>
    <url-pattern>/xmla</url-pattern>
  </servlet-mapping>

  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>

  <taglib>
    <taglib-uri>http://www.tonbeller.com/wcf</taglib-uri>
    <taglib-location>/WEB-INF/wcf/wcf-tags.tld</taglib-location>
  </taglib>

  <taglib>
    <taglib-uri>http://www.tonbeller.com/jpivot</taglib-uri>
    <taglib-location>/WEB-INF/jpivot/jpivot-tags.tld</taglib-location>
  </taglib>

</web-app>

どんな助けでも大歓迎です。

4

1 に答える 1