views:

1182

answers:

2

Hi all,

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.

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.

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.

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".

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 guessing 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 should pick it up (although I am nothing close to an expert on these matters so I could be wrong).

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:

<context-param>
 <param-name>dataSource</param-name>
 <param-value>@database.dataSource@</param-value>
</context-param>
<context-param>
 <param-name>db.drivertype</param-name>
 <param-value>@database.drivertype@</param-value>
</context-param>
<context-param>
 <param-name>db.host</param-name>
 <param-value>@database.host@</param-value>
</context-param>
<context-param>
 <param-name>db.dbname</param-name>
 <param-value>@database.name@</param-value>
</context-param>
<context-param>
 <param-name>db.username</param-name>
 <param-value>@database.username@</param-value>
</context-param>
<context-param>
 <param-name>db.password</param-name>
 <param-value>@database.password@</param-value>
</context-param>
<context-param>
 <param-name>db.port</param-name>
 <param-value>@database.port@</param-value>
</context-param>
<context-param>
 <param-name>db.protocol</param-name>
 <param-value>@database.protocol@</param-value>
</context-param>

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.

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:

    <jta-data-source>ourProductionDataSource</jta-data-source>

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.

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.

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:

<context-param>
 <param-name>dataSource</param-name>
 <param-value>@database.dataSource@</param-value>
</context-param>

however that does not seem to have fixed the problem.

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 ?

thanks heaps guys

David Buddrige.

A: 

Also verify that weblogic.xml is properly configured. Sometimes context-root causes the app to fail deployment on Weblogic 10.3, even when it works fine on Weblogic 8.

Following needs to be present in weblogic.xml:

<context-root>/</context-root>
Ravi Gupta
A: 

Hello David,

We are also planning a similar upgrade with Struts 1.1 on WebLogic 8.1 to WebLgoic 10gR3. I was more interested in knowing if Struts 1.1 are compatible with WL10gR3. Did you run into any issues with struts while upgrading WebLogic.

thanks Kumar

Kumar
You should better ask this as a new question, not post it here as an answer. More people would look at it that way. The "Ask Question" button is in the top right...
sth