Mailing List webobjects-dev@wocommunity.org Message #416
From: Ramsey Gurley <Ramsey.Gurley@practicemojo.com>
Subject: Re: [WO-DEV] Maven Components subfolders incompatibility?
Date: Mon, 30 Jan 2023 23:18:12 +0000
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Try something like this in your Application's installPatches() and see if it works,

@Override

public void installPatches() {

super.installPatches();

ERXPatcher.setClassForName(MyComponent.class, MyComponent.class.getSimpleName());

_NSUtilities.registerPackage(MyComponent.class.getPackage().getName());

}


I've run into cases where for whatever reason WO can't find my component classes (I'm fairly sure this happened even with Ant builds for me) and doing this helped it out. Strangely enough, I didn't need to do it for all my components, just a few troublemakers. After I got it working, I never did any deep digging on it, so I haven't any idea why it is broken.

From: WebObjects & WOnder Development <webobjects-dev@wocommunity.org> on behalf of Aaron Rosenzweig <aaron@chatnbike.com>
Sent: Tuesday, January 31, 2023 4:12 AM
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Subject: [WO-DEV] Maven Components subfolders incompatibility?
 
I’m trying to convert my Eclipse workspace front ANT -> Maven builds but I’ve run into a snag. Hoping a kind WOrrior can lend me their axe

When I launch the app it cannot find some WOComponents. I get errors like:

WOBundle.lookForClassInAllBundles(UserSwitcher) failed!

<com.webobjects.appserver._private.WOComponentDefinition> WARNING: Unable to find component class named "UserSwitcher".  If this is not intended to be a classless component, check your framework settings and the contents of your classpath file (in the .woa's Contents/<PLATFORM_NAME> subdirectory).



“UserSwitcher.wo” is a component in this app, not an included framework.

It lives in: Components/Permissions/UserSwitcher.wo

It seems that the “Permissions” subfolder is causing issues as components defined directly under Components are discovered and work properly.

I would rather continue to keep subfolders in Components if possible… while using Maven.

What I think is the relevant part of the POM looks like:
<resources>
  <resource>
      <targetPath>Resources</targetPath>
      <filtering>false</filtering>
      <directory>Components</directory>
  </resource>
  <resource>
      <targetPath>Resources</targetPath>
      <filtering>false</filtering>
      <directory>Components/Permissions</directory>
  </resource>
</resources>

When I check the “target” directory… which I think is where the Maven temporary files live… I do find the following intact:
target/classes/Resources/Permissions/UserSwitcher.wo

So it sort of looks like it is working but the running app in Eclipse cannot find this component. How does Eclipse launch it from here? Is it a type of bundle-less build? Where is the next step to debug to figure out how UserSwitcher.wo is not getting put into the right location?

Any help appreciated, thank you :-)
— Aaron
#############################################################
This message is sent to you because you are subscribed to
  the mailing list <webobjects-dev@wocommunity.org>.
To unsubscribe, E-mail to: <webobjects-dev-off@wocommunity.org>
To switch to the DIGEST mode, E-mail to <webobjects-dev-digest@wocommunity.org>
To switch to the INDEX mode, E-mail to <webobjects-dev-index@wocommunity.org>
Send administrative queries to  <webobjects-dev-request@wocommunity.org>


Confidentiality Notice: This email, including all attachments and replies thereto, are covered by the Electronic Communications Privacy Act, 18 U.S.C. Sections 2510-2521 and are legally privileged. This information is confidential, and intended only for the use of the individuals or entities named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this transmitted information is strictly prohibited. Please notify us if you have received this transmission in error. Thank you.
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster