I’ve found when using maven, in eclipse (doesn’t appear to happen in production, but the fix isn’t harmful either), that one must do something in Application.java like:

@Override
public void installPatches() {
super.installPatches();

// component classes
ERXPatcher.setClassForName(Main.class, Main.class.getSimpleName());
_NSUtilities.registerPackage(Main.class.getPackage().getName());

// action classes
ERXPatcher.setClassForName(DirectAction.class, DirectAction.class.getSimpleName());
_NSUtilities.registerPackage(DirectAction.class.getPackage().getName());
}

Otherwise, the components aren’t found properly. Also direct actions. 

And for the session class

/**
* Determines the WOSession class to instantiate.
* @see com.webobjects.appserver.WOApplication#_sessionClass()
*/
@Override
protected Class<? extends WOSession> _sessionClass() {
return Session.class;
}

And for resource request handling

@Override
public void finishInitialization() {
super.finishInitialization();

if (isDirectConnectEnabled()) {
registerRequestHandler(new JarResourceRequestHandler(), "_wr_");
if (ERXApplication.isWO54()) {
registerRequestHandler(new JarResourceRequestHandler(), "wr");
}
}
}

That request handler class is special sauce only available on the list AFAIK, so here’s a copy

Attachment: JarResourceRequestHandler.java
Description: Binary data




On May 19, 2016, at 5:21 AM, Ress, David A <[email protected]> wrote:

All,

I followed Sunil's advice for a new Mac OS X 10.11.4 development installation (Thank you Sunil!) and went with Java 1.8, the latest binary Wonder, Eclipse Mars 4.5.2 and WOLips 4.4.  I setup the directory environment by following the steps documented in Markus Ruggiero's Learning the Wonders (I like this directory structure much better than the older style with /Library and /System/Library).

But, I am hitting a runtime error now, as the subject line says. I researched this and found potential solution and tried:

Class mainClass = _NSUtilities.classWithName(Main.class, "Main");
NSLog.out.appendln("Main class is: " + mainClass.getClass() );
--> outputs:  "Main class is: com.gdit.elmpv.Main"  which is correct

I also tried the "patching" suggestion with ERXPatcher.setClassForName(), but that does not appear to be helping either.

From a verbal perspective, the error in the subject line is sort-of correct, as Main is defined as:

public class Main extends CSSComponent (located in main project)
where
public class CSSComponent extends WOComponent (located in an external framework)

Thus, I feel I am having path issues but I am not seeing any problems as the external framework is installed in /Development/Libraries/WOnder/Library/Frameworks/

I am also seeing a strange message in the console making me think the paths are wrong:

<main> Couldn't load properties file: /Users/daress/WebObjects.properties at path /Users/daress/

which puzzles me as I have wolips.properties at:
/Users/daress/Library/Application Support/WOLips/wolips.properties

Suggestions anyone as to what I have done wrong?  I know I am tired from working two jobs, but this getting down right embarrassing...

David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com

This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to