title: converting struts 1.1 web application from weblogic 8.1 to weblogic 10.3
body: <p>I have a web application that was written to run under Weblogic 8.1.  It is a struts 1.1 application, using Java 1.4.  </p>
  
  <p>For the sake of maintainability we have decided to attempt to conver this application run under Java 6 and Weblogic 10gR3 in line with all our other applications.  We've been putting off doign this because we had a major release due with functionality that the users were screaming for, but now that the application is in User Acceptance Testing, we figured it was time to pull the finger out and get this thing running under a more up-to-date JVM and container.</p>
  
  <p>To this end, I have loaded up the source-code and got it compiling under Java 6, and used its build script to generate the .war file that comprises the application.</p>
  
  <p>I then attempted to deploy this application under a weblogic 10gR3 server.  However, while the deploy steps appeared to proceed without any problems, when they are complete, and I click on "Deployments" in the Domain Structure panel in the weblogic console, the application lists with a state of "Failed".</p>
  
  <p>I checked the weblogic logs but the only errors I could see were related to being unable to find the log4j configuration - which shouldn't stop the application itself from running.  I was <em>guessing</em> that maybe there was somethign wrong in the way the jdbc connections were set up - this being significantly different in weblogic 10.3 from 8.1.  However I am not certain that this is the cause of the problem - and in any case I had set up the data source under weblogic 10.3 so that it has the same jndi name so it <em>should</em> pick it up (although I am nothing close to an expert on these matters so I could be wrong). </p>
  
  <p>One thing I have noticed that differs from other weblogic 10gR3 applications that we have, is the way that this program accesses the database.  The program I am trying to convert has the following entries in its web.xml:</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;dataSource&lt;/param-name&gt;
      &lt;param-value&gt;@database.dataSource@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.drivertype&lt;/param-name&gt;
      &lt;param-value&gt;@database.drivertype@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.host&lt;/param-name&gt;
      &lt;param-value&gt;@database.host@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.dbname&lt;/param-name&gt;
      &lt;param-value&gt;@database.name@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.username&lt;/param-name&gt;
      &lt;param-value&gt;@database.username@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.password&lt;/param-name&gt;
      &lt;param-value&gt;@database.password@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.port&lt;/param-name&gt;
      &lt;param-value&gt;@database.port@&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;db.protocol&lt;/param-name&gt;
      &lt;param-value&gt;@database.protocol@&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>with the various @somestring@ fields being replaced with actual values by the build script which gets them from a deploy.properties file so that we can specify either the live production database or the development database depending on whether we are compiling for development or production.</p>
  
  <p>The other application that I am using as a reference on the other hand uses EJB entity beans which are configured using a persistence.xml file - and the only reference in there I can find to the actual database is:</p>
  
  <pre><code>    &lt;jta-data-source&gt;ourProductionDataSource&lt;/jta-data-source&gt;
  </code></pre>
  
  <p>which referrs to a datasource set up in the Data Sources section under JDBC in the "Services" section of the Domain Structure pane in the weblogic console for weblogic 10gR3.</p>
  
  <p>Even that is entirely different to the original weblogic 8 application since with the weblogic 8 app, we needed to set up a JDBC Connection pool which had all the database details and then set up a separate JDBC Data Source which referred to the JDBC Connection Pool but provided a JNDI name that could be used to find the datasource within the java application.</p>
  
  <p>I really have no idea how to munge this into something that weblogic 10gR3 is going to recognise so that the legacy weblogic 8 application will know how to find its data.  I am assuming of course that this is the major problem of why the application wont deploy successfully (I might be wrong).  In attempting to resolve this probelm,  I also created (under weblogic 10gR3) a Data Source Factory in the hope that perhaps this might be able to emulate what the weblogic 8 app needs.  I then referred to the Data Source Factory name that I had created in the database.dataSource entry in the .propery file so that it is swapped into the following entry in the web.xml for the application:</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;dataSource&lt;/param-name&gt;
      &lt;param-value&gt;@database.dataSource@&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>however that does not seem to have fixed the problem.</p>
  
  <p>Can anyone give me some clues as to the kinds of things I need to be focusing on in order to get this application (written for weblogic 8.1) to run under weblogic 10gR3 ?</p>
  
  <p>thanks heaps guys</p>
  
  <p>David Buddrige.</p>