• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Query - Path to WebServerResources
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Query - Path to WebServerResources


  • Subject: RE: Query - Path to WebServerResources
  • From: "Peter Thompson" <email@hidden>
  • Date: Fri, 29 May 2009 15:51:57 +1200

Lachlan,

Thanks.

We have been playing with 5.4 frameworks (currently looking at migration
from Tiger to Leopard) but have re-checked and am sure we are using 5.3
frameworks currently.  We have 4 separate applications that we build (from
same environment using same frameworks) and deploy into the same server - 3
work fine, 1 does not.  For the one that does not we have an earlier
deployment that if we re-deploy into the same application "container" it
works OK.

We do not have logging turned on - how do you get the start-up logs
(WOApplicationBaseURL / WOFrameworksBaseURL)?

I have re-deployed (application that was & is still is failing) printing
these (and more) from the Application constructor, as:

  adaptor()=WODefaultAdaptor
  applicationBaseURL()=/WebObjects
  baseURL()=/WebObjects
  cgiAdaptorURL()=http://server.txt2get.co.nz/cgi-bin/WebObjects
  directActionRequestHandlerKey()=wa
  frameworksBaseURL()=/WebObjects/Frameworks
  host()=server.txt2get.co.nz
  name()=TXT2GET-TESTING
  outputPath()=/Users/Shared/Logs/TXT2GET-TESTING-1
  path()=/Library/WebObjects/Applications/TXT2Get.woa/Contents
  port()=2001

webserverConnectURL()=http://server.txt2get.co.nz/cgi-bin/WebObjects/TXT2GET
-TESTING.woa/-2001

We are building and deploying directly from Eclipse on Windows using 5.3
frameworks, not using Wonder.

No properties have changed in JavaMonitor or the app.

I guess what we are trying to work out is how the URL for webserver served
up content is determined - what of the above parameters are used and how?
And what could have changed to make this work differently?

We also have another problem with this application (and we are assuming that
it is related to the same issue - and might help in identifying the
problem)... our logout functionality uses a WORedirect as follows:

    	WORedirect redirectToLoseSessionID
=(WORedirect)pageWithName("WORedirect");
	NSDictionary parms = new NSDictionary(new Object[] {Boolean.FALSE},
new Object[] {"wosid"});
	context()._generateCompleteURLs();
    	String homeURL = context().directActionURLForActionNamed("default",
parms);
    	redirectToLoseSessionID.setUrl(homeURL); // entry point
    	session().terminate();

But now the initial statement (...pageWithName("WORedirect")] we now get an
exception, as:

	com.txt2get.common.Header |java.lang.IllegalStateException: Unable
to find framework named "TXT2Get".
        at
com.webobjects.appserver._private.WOComponentDefinition.<init>(WOComponentDe
finition.java:179)
        at
com.webobjects.appserver.WOApplication._componentDefinitionFromClassNamed(WO
Application.java:2353)
        at
com.webobjects.appserver.WOApplication._componentDefinition(WOApplication.ja
va:2448)
        at
com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:1943)
        at
com.webobjects.appserver.WOComponent.pageWithName(WOComponent.java:1200)
        at com.txt2get.common.Header.goLogout(Header.java:231)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(NSKey
ValueCoding.java:684)
        at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKe
yValueCoding.java:1160)
        at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey
(NSKeyValueCoding.java:1268)

Again appreciate all the help you can offer.

Many thanks,

-----Original Message-----
From: Lachlan Deck [mailto:email@hidden]
Sent: Thursday, 28 May 2009 7:39 p.m.
To: Peter Thompson
Cc: email@hidden
Subject: Re: Query - Path to WebServerResources
Importance: High

Hi Peter,

On 28/05/2009, at 12:58 PM, Peter Thompson wrote:

> We have just re-deployed to our current development server,

Any change in versions of frameworks along the way?

> and the
> application is now resolving URL's to the Web Server (i.e.
> WebServerResources) differently.

Check the start up logs for WOApplicationBaseURL / WOFrameworksBaseURL.

How are you building btw? What frameworks are you using? Using Wonder?

> We are getting URLs like ..../app.woa/WebServerResources/... when we
> expect
> (and have previously got) .../app.woa/Contents/
> WebServerResources/... so it
> is no longer expecting a Contents directory (so now our images
> etc... do not
> resolve - they do if we copy the whole WebServerResources folder
> directly
> under the WOA folder)

Have you changed any properties in JavaMonitor or the app?

> Can someone shed some light on this - particularly how is the URL
> determined?

If the aforementioned properties aren't correct (or not set correctly)
you can enforce at runtime what you want. For example I do the
following during initialisation:

// fix applicationBaseURL
String applicationBaseURL = applicationBaseURL();
{
	LOG.info( "WOApplicationBaseURL:" + applicationBaseURL() );
	String applicationBaseURLProperty =
ERXProperties.stringForKey( "WOApplicationBaseURL" );
	if ( !ERXStringUtilities.stringEqualsString( applicationBaseURL,
applicationBaseURLProperty ) && applicationBaseURLProperty != null )
	{
		setApplicationBaseURL( applicationBaseURLProperty );
	}
	LOG.info( "WOApplicationBaseURL (fixed):" + applicationBaseURL() );
}

// fix frameworks/app webserver resources url.
if
( ERXProperties
.booleanForKeyWithDefault
( "ISHFrameworksBaseURL.relativeToApplicationBaseURL", true ) )
{
	String realAppName = NSPathUtilities.lastPathComponent( path() );
	NSArray< String > components = new NSArray< String >( new String[] {
	    realAppName, "Contents", "Frameworks"
	} );
	String newBaseURL = applicationBaseURL();
	for ( Enumeration< String > en = components.objectEnumerator();
en.hasMoreElements(); )
	{
		newBaseURL =
NSPathUtilities.stringByAppendingPathComponent( newBaseURL,
en.nextElement() );
	}
	ERXProperties.setStringForKey( newBaseURL, "WOFrameworksBaseURL" );
	setFrameworksBaseURL( newBaseURL );
}
LOG.info( "WOFrameworksBaseURL:" + frameworksBaseURL() );

with regards,
--

Lachlan Deck


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Query - Path to WebServerResources (From: "Peter Thompson" <email@hidden>)
 >Re: Query - Path to WebServerResources (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Mootools Ajax Backtrack Limit Exceeded
  • Next by Date: Re: Is there a Webobjects Adaptor for windows?
  • Previous by thread: Re: Query - Path to WebServerResources
  • Next by thread: Stable Installer Update (5744)
  • Index(es):
    • Date
    • Thread