Re: [thredds] Adding custom services to TDS

Hi again,

No worries - we'll get this working. The thredds.war I've used
successfully can be found here:

https://dl.dropboxusercontent.com/u/75575742/thredds.war

I'm using the tomcat 7 binary distribution (core) from
http://tomcat.apache.org/download-70.cgi (version 4.0.47)

Java 1.7.0_05-b06 from Oracle (as installed by OSX - nothing special
done here)

I also have my JAVA_HOME environmental variable set to

JAVA_HOME=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

I've tried to document the steps I used to build and deploy this war
file. I started with a clean install of tomcat, as extracted from the
zip file I downloaded from their site. Note that I am using the latest
from git, and I am using MVN as well, so I think we are using the same
build tools. I've tried to detail everything in case other users are
following along (i.e. I know you understand how to start tomcat :-) )

#
# get the git repository and checkout the target-4.4.0 branch
#
git clone --origin unidata https://github.com/Unidata/thredds.git
git checkout -b target-4.4.0 unidata/target-4.4.0

(commit number c497d6eb6727ba66713e1910d1d035f4732fbcea, which is the
latest as of 11 am MST)

#
# clean out any previous build cruft (if any) and build the thredds war
# file
#
mvn clean package


#
# put the war file in the webapps directory
#
move $GITREPO/tds/target/thredds.war to $CATALINA_HOME/webapps

#
# Prepare the basic tomcat settings
#
create, if needed, $CATALINA_BASE/bin/setenv.sh, and add the following
and change accordingly:

=====

export
JAVA_OPTS=-Dtds.content.root.path=/Users/lesserwhirls/.unidata/content

export CATALINA_HOME=/Users/lesserwhirls/dev/unidata/java/apache-tomcat-7

export TOMCAT_HOME=$CATALINA_HOME

=====

make sure the following files are executable in $CATALINA_HOME/bin :

startup.sh
shutdown.sh
catalina.sh
setenv.sh

#
# Initialize the basic thredds config files and example catalogs by
# copying them from the tds src tree. Note that these used to
# automagically appear in $CATALINA_BASE/content/thredds
#
Copy the contents of
$GITREPO/tds/src/main/webapp/WEB-INF/altContent/startup to
tds.content.root.path/thredds, as specified in setenv.sh. Note that you
need to add the thredds/ directory under tds.content.root.path. For
example, using my tds.content.root.path from above, I would need to put
the files from $GITREPO/tds/src/main/webapp/WEB-INF/altContent/startup
in /Users/lesserwhirls/.unidata/content/thredds

#
# start up tomcat, cross your fingers, and check logs
#
Start up tomcat (running $CATALINA_HOME/bin/startup.sh).

Check your logs for errors ($CATALINA_HOME/logs/catalina.out,
tds.content.root.path/thredds/logs/serverStartup.log, catalogInit.log,
threddsServlet.log, etc.), try to access tomcat through your browser
(localhost:8080), and then try to access thredds (localhost:8080/thredds)

Hopefully between my war file and/or these build instructions, we can
get you up and running with 4.4.0.

Cheers!

Sean




On 11/13/13, 8:39 AM, H. Joe Lee wrote:
> Hi, Sean!
> 
> I'm using the same setup as yours but I always 'git pull' the latest
> TDS-4.4 and build one myself with MVN. I think that may cause the
> problem.
> 
> Thus, would you please send me the URL of TDS-4.4 thredds.war file
> that you've succeeded in running?
> I'd like to make sure that I can run it on my Mavericks as well.
> I'd appreciate if you can give the git clone address for the working
> TDS-4.4 source as well.
> 
> Regards,
> 
> --
> HDF: Software that Powers Science
> 
> 
> On Tue, Nov 12, 2013 at 2:00 PM, Sean Arms <sarms@xxxxxxxxxxxxxxxx> wrote:
>> Hello!
>>
>> I'm not sure what is going on here yet. I am able to run 4.4.0 under
>> tomcat 7 using java 7 on OSX Mavericks - is this the same setup you are
>> using as well, or do you have a different version of Java / Tomcat?
>>
>> Thanks!
>>
>> Sean
>>
>> On 11/12/13, 12:43 PM, H. Joe Lee wrote:
>>> Hi, Sean!
>>>
>>>    Thanks for your tip. I tried it but it doesn't help. I'm getting
>>> the following error in 'content/logs/serverStartup.log':
>>>
>>> 2013-11-12T13:36:58.767-0600 [      7110][        ] ERROR
>>> org.springframework.web.context.ContextLoader: Context initialization
>>> failed
>>> org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'collectionController': Injection of autowired
>>> dependencies failed; nested exception is
>>> org.springframework.beans.factory.BeanCreationException: Could not
>>> autowire field: private thredds.server.config.TdsContext
>>> thredds.server.admin.CollectionController.tdsContext; nested exception
>>> is org.springframework.beans.factory.BeanCreationException: Error
>>> creating bean with name 'tdsContext' defined in file
>>> [/hdfdap/tomcat2/webapps/thredds/WEB-INF/classes/thredds/server/config/TdsContext.class]:
>>> Invocation of init method failed; nested exception is
>>> java.lang.NullPointerException
>>>
>>>   Is there something peculiar in Mac OS X Mavericks Java?
>>>
>>> --
>>> HDF: Software that Powers Science
>>>
>>>
>>> On Fri, Nov 8, 2013 at 5:13 PM, Sean Arms <sarms@xxxxxxxxxxxxxxxx> wrote:
>>>> Greetings!
>>>>
>>>> It looks like the issue is that you haven't setup your content path, a
>>>> new requirement for TDS 4.4.0. In order to do this, you need to add the
>>>> following, with the proper path, to your setenv.sh script in
>>>> $CATALINA_BASE/bin (if the script does not exists, go ahead and create
>>>> it - catalina.sh will find and use it):
>>>>
>>>> =======
>>>>
>>>> export JAVA_OPTS=-Dtds.content.root.path=/path/to/contentDir
>>>>
>>>> =======
>>>>
>>>> Note that the content path used to be ${CATALINA_BASE}/content in
>>>> previous TDS versions.
>>>>
>>>> Give that a try and let us know if that fixes things on your end.
>>>>
>>>> Cheers!
>>>>
>>>> Sean
>>>>
>>>> On 11/6/13, 2:02 PM, H. Joe Lee wrote:
>>>>> Hi, John!
>>>>>
>>>>>   I got a strange error on Mac OS X Mavericks with TDS 4.4. I could
>>>>> build the 4.4 fine but I cannot start the sever with the following
>>>>> springframework error message:
>>>>>
>>>>> 2013-11-06T14:40:04.325-0600 [      7596][        ] ERROR
>>>>> org.springframework.web.context.ContextLoader: Context initialization
>>>>> failed
>>>>>
>>>>> org.springframework.beans.factory.BeanCreationException: Error
>>>>> creating bean wth name 'collectionController': Injection of autowired
>>>>> dependencies failed; nested exception is
>>>>> org.springframework.beans.factory.BeanCreationException: Could not
>>>>> autowire field: private thredds.server.config.TdsContext
>>>>> thredds.server.admin.CollectionController.tdsContext; nested exception
>>>>> is org.springframework.beans.factory.BeanCreationException: Error
>>>>> creating bean with name 'tdsContext' defined in file
>>>>> [/hdfdap/tomcat2/webapps/thredds/WEB-INF/classes/thredds/server/config/TdsContext.class]:
>>>>> Invocation of init method failed; nested exception is
>>>>> java.lang.IllegalStateException: Content root directory
>>>>> [/share/testdata/cdmUnitTest/it/content] not a directory.
>>>>>
>>>>>  I don't get such error message during initialization on my Windows 7
>>>>> build. I don't have any issue with TDS-4.3 on Mavericks either.
>>>>>
>>>>>  Is this related to the change you've documented on the wiki? If so,
>>>>> what could be wrong?
>>>>>
>>>>>  Please see the attached file for full error log.
>>>>>
>>>>> --
>>>>> HDF: Software that Powers Science
>>>>>
>>>>>
>>>>> On Thu, Oct 3, 2013 at 1:28 PM, John Caron <caron@xxxxxxxxxxxxxxxx> wrote:
>>>>>> We have been working in version 4.4 on using Spring annotations for 
>>>>>> developing custom services. Some early documentation is here:
>>>>>>
>>>>>>   
>>>>>> https://wiki.ucar.edu/display/unidata/TDS+Servlets+Configuration+%284.4.0-alpha%29
>>>>>>
>>>>>> feedback is appreciated.
>>>>>>
>>>>>> _______________________________________________
>>>>>> thredds mailing list
>>>>>> thredds@xxxxxxxxxxxxxxxx
>>>>>> For list information or to unsubscribe,  visit: 
>>>>>> http://www.unidata.ucar.edu/mailing_lists/
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> thredds mailing list
>>>>>> thredds@xxxxxxxxxxxxxxxx
>>>>>> For list information or to unsubscribe,  visit: 
>>>>>> http://www.unidata.ucar.edu/mailing_lists/
>>>>
>>>> _______________________________________________
>>>> thredds mailing list
>>>> thredds@xxxxxxxxxxxxxxxx
>>>> For list information or to unsubscribe,  visit: 
>>>> http://www.unidata.ucar.edu/mailing_lists/



  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: