You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by David Sean Taylor <da...@b3interactive.com> on 2001/04/20 09:56:24 UTC
[patch] TurbineServletService
here's a little patch for TurbineServletService
when I call getResource() on a resource that doesn't exist,
getServletContext().getResource() returns null, and the next line gives a
NullPointerException
since it can normally return null, it should be checked before using
public URL getResource( String uri ) {
if ( servletContext == null) return null;
URL url = null;
try
{
url = getServletContext().getResource( uri ); <------
returns NULL
// work-around for Websphere 3.52
if (url != null && url.toString().startsWith("classloader:")) <----
here's the fix, see diff below
{
url = new URL("file:" + url.toString().substring(12));
}
cvs diff TurbineServletService.java
Index: TurbineServletService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/servlet/Turbi
neServletService.java,v
retrieving revision 1.7
diff -r1.7 TurbineServletService.java
174c174
<
---
>
179c179
< if (url.toString().startsWith("classloader:"))
---
> if (url != null && url.toString().startsWith("classloader:"))
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: [patch] TurbineServletService
Posted by Jason van Zyl <jv...@apache.org>.
David Sean Taylor wrote:
>
> here's a little patch for TurbineServletService
> when I call getResource() on a resource that doesn't exist,
> getServletContext().getResource() returns null, and the next line gives a
> NullPointerException
> since it can normally return null, it should be checked before using
>
> public URL getResource( String uri ) {
> if ( servletContext == null) return null;
>
> URL url = null;
>
> try
> {
> url = getServletContext().getResource( uri ); <------
> returns NULL
> // work-around for Websphere 3.52
> if (url != null && url.toString().startsWith("classloader:")) <----
> here's the fix, see diff below
> {
> url = new URL("file:" + url.toString().substring(12));
> }
>
> cvs diff TurbineServletService.java
> Index: TurbineServletService.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/servlet/Turbi
> neServletService.java,v
> retrieving revision 1.7
> diff -r1.7 TurbineServletService.java
> 174c174
> <
> ---
> >
> 179c179
> < if (url.toString().startsWith("classloader:"))
> ---
> > if (url != null && url.toString().startsWith("classloader:"))
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Done, thanks.
--
jvz.
Jason van Zyl
jvanzyl@apache.org
http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: TDK and Turbine CVS
Posted by Daniel Rall <dl...@collab.net>.
"Gareth Coltman" <ga...@majorband.co.uk> writes:
> Hi,
>
> Is the TDK rebuilt every night with that day's Turbine patches? At the
> moment I have both the Turbine and Turbine-TDK repositories checked out. If
> I am happy with daily builds can I just update my TDK daily?
You can do one of two things:
1) Checkout a large number of CVS modules and rebuild the entire TDK.
2) Rebuild the Turbine JAR file and drop that into the TDK (you may
also need to rebuild Torque and move the torque.zip file).
I strongly recommend option 2.
Daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
RE: TDK and Turbine CVS
Posted by Dave Bryson <da...@miceda-data.com>.
On Fri, 20 Apr 2001, you wrote:
> > Hi,
> >
> > Is the TDK rebuilt every night with that day's Turbine patches?
No. Jason has been building them at certain stages.
>
> Hmm. Stupid question I think. As far as I can tell the TDK build script is
> pulling the libraries from the turbine module.
When the TDK is built it pulls together the resources that it needs; such as
the Turbine libs, Tomcat, etc... In order to build the TDK, you'll need to
check out these additional libraries. Take a look at the build xml file from
the TDK in CVS.
--
Dave Bryson
daveb@miceda-data.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Re: TDK and Turbine CVS
Posted by Jason van Zyl <jv...@apache.org>.
Gareth Coltman wrote:
>
> Sorry guys,
>
> If I want to update my TDK without recompiling (and having to get
> Flux/Tomcat etc) is this a complete list of what I have to copy from my
> Jakarta-Turbine CVS module:
>
> /lib/* -> /share/tdk-lib/*
> /conf/* -> /share/conf*
>
> Is this enough?
I do not encourage the building of the TDK for end use. What you
have above is not enough. Many other things might change and it
varies.
I am working on getting GUMP to build the TDK so it can be built
on a daily basis (not necessarily for distribution because it's huge,
but for testing turbine with cactus). When the GUMP build process
is finished then you can have your own copy of GUMP and build the
TDK if you wish.
Right now you have to have a lot of repositories checked out in
parallel and it admittedly isn't documented 100%. I will not support
end use building of the TDK. If you want to help develop it that's
another story, but this will also be a lot easier when the GUMP build
is finished. This is the primary reason I want to use GUMP, so that
others
can easily help develop the TDK and so I can have some daily testing
routines.
>
> Gareth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
--
jvz.
Jason van Zyl
jvanzyl@apache.org
http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
RE: Oracle with W2K
Posted by Kevin Newman <kn...@home.com>.
Gareth,
Here is the message I got from Jason when I had this problem a few days ago.
All I did was comment out the create-database line and the build-project
init worked for me:
"
The only thing the TDK lacks for Oracle is the creation of the
database that turbine requires. The scripts for creating an Oracle
database haven't been worked into the TDK yet. But the rest of
process works.
If you create the oracle database, and comment out the 'create-database'
target in the project-build.xml file everything else should work. People
have reported success but I haven't installed Oracle yet to test it.
"
c' ya!
kln
-----Original Message-----
From: Gareth Coltman [mailto:gareth_coltman@majorband.co.uk]
Sent: Friday, April 20, 2001 6:57 AM
To: turbine-dev@jakarta.apache.org
Subject: RE: Oracle with W2K
Hello again.
I seem to be using this mailing list all on my own today.
I have had a better look at the mail archive (which I should have done
before posting all these messages - sorry) and see that auto generation in
Oracle under Windows is a known problem. I will run the scripts manually.
Gareth
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
RE: Oracle with W2K
Posted by Gareth Coltman <ga...@majorband.co.uk>.
Hello again.
I seem to be using this mailing list all on my own today.
I have had a better look at the mail archive (which I should have done
before posting all these messages - sorry) and see that auto generation in
Oracle under Windows is a known problem. I will run the scripts manually.
Gareth
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
Oracle with W2K
Posted by Gareth Coltman <ga...@majorband.co.uk>.
Hi again,
I have pulled the latest torque from CVS but....
build-project init fails because it creates an empty create-database.bat
file, which W2K considers to be an invalid executable.
I have
database = oracle
in my project properties file, which is definately the problem, as 'mysql'
will generate a valid batch file.
Is this a W2K problem?
Any ideas?
Gareth
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
RE: TDK and Turbine CVS
Posted by Gareth Coltman <ga...@majorband.co.uk>.
Sorry guys,
If I want to update my TDK without recompiling (and having to get
Flux/Tomcat etc) is this a complete list of what I have to copy from my
Jakarta-Turbine CVS module:
/lib/* -> /share/tdk-lib/*
/conf/* -> /share/conf*
Is this enough?
Gareth
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
RE: TDK and Turbine CVS
Posted by Gareth Coltman <ga...@majorband.co.uk>.
> Hi,
>
> Is the TDK rebuilt every night with that day's Turbine patches? At the
> moment I have both the Turbine and Turbine-TDK repositories
> checked out. If
> I am happy with daily builds can I just update my TDK daily?
>
> Gareth
Hmm. Stupid question I think. As far as I can tell the TDK build script is
pulling the libraries from the turbine module.
Gareth
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
TDK and Turbine CVS
Posted by Gareth Coltman <ga...@majorband.co.uk>.
Hi,
Is the TDK rebuilt every night with that day's Turbine patches? At the
moment I have both the Turbine and Turbine-TDK repositories checked out. If
I am happy with daily builds can I just update my TDK daily?
Gareth
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org