Dust can't find component definition file?

611 views
Skip to first unread message

trak3r

unread,
Jul 7, 2008, 4:45:19 PM7/7/08
to ATG_Tech
Hello all.

I've just set up Dust for a project on 2006.3 and it seems to be
starting up just fine but when I call "resolveNucleusComponent" I get
a FileNotFoundException with the message "No or empty configuration
location is specified. Unable to continue." I have verified that
Dust is copying the properties and XML files from the source "config"
directory to the test directory, and in particular the file it's
claiming it can't find is there. Any suggestions on troubleshooting
are much appreciated. Thanks.

rob_ert

unread,
Jul 8, 2008, 6:20:16 PM7/8/08
to ATG_Tech
Hi all,

I'm currently working on this problem. The moment we have a solution
for trak3r problem I'll post it to this group. Stay tuned ;-)

gr,

--Robert

trak3r

unread,
Jul 11, 2008, 9:10:40 AM7/11/08
to ATG_Tech
Hello all. Robert has been a huge help in getting over a bunch of
speed bumps, but there's a handful of issues we've not yet been able
to resolve...

1)

log4j:WARN No appenders could be found for logger
(atg.test.AtgDustCase).
log4j:WARN Please initialize the log4j system properly.

2)

**** Error Thu Jul 10 14:32:28 GMT-05:00 2008 1215718348230 / Unable
to create class /atg/Initial for configuration /Initial
java.lang.ClassNotFoundException: /atg/Initial

3)

**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / Unable
to resolve component /atg/userprofiling/ProfileTools
java.lang.NullPointerException
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.userprofiling.ProfileTools.doStartService(ProfileTools.java:415)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.GenericService.startService(GenericService.java:495)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.NucleusNameResolver.startService(NucleusNameResolver.java:
1229)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:
1002)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:
705)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:
576)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:
368)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:
934)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357478 / at
atg.nucleus.ConfigurationRef.getValue(ConfigurationRef.java:83)
**** Error Thu Jul 10 14:32:37 GMT-05:00 2008
1215718357478 / ....stack trace CROPPED after 10 lines.

4)

**** Warning Thu Jul 10 14:32:37 GMT-05:00 2008 1215718357845 / An
attempt has been made to use ServletUtil.isDynamoJ2EEServer() before
this property has been set.

5)

**** Error Thu Jul 10 14:32:38 GMT-05:00 2008 1215718358576 / Unable
to set configured property "/spumco/store/order/util/
OrderUtilities.orderRepository" atg.nucleus.ConfigurationException:
Unable to resolve component /atg/commerce/order/OrderRepository
**** Error Thu Jul 10 14:32:38 GMT-05:00 2008 1215718358577 / Unable
to set configured property "/spumco/store/order/util/
OrderUtilities.productCatalog" atg.nucleus.ConfigurationException:
Unable to resolve component /atg/commerce/catalog/ProductCatalog
**** Error Thu Jul 10 14:32:38 GMT-05:00 2008 1215718358577 / Unable
to set configured property "/spumco/store/order/util/
OrderUtilities.orderStates" atg.nucleus.ConfigurationException: Unable
to resolve component /atg/commerce/states/OrderStates
**** Error Thu Jul 10 14:32:38 GMT-05:00 2008 1215718358577 / Unable
to set configured property "/spumco/store/order/util/
OrderUtilities.pricingTools" atg.nucleus.ConfigurationException:
Unable to resolve component /atg/commerce/pricing/PricingTools
**** Error Thu Jul 10 14:32:39 GMT-05:00 2008 1215718359800 / Unable
to set configured property "/spumco/store/mealdelivery/business/
MealDeliveryManager.orderRepository"
atg.nucleus.ConfigurationException: Unable to resolve component /atg/
commerce/order/OrderRepository
**** Error Thu Jul 10 14:32:39 GMT-05:00 2008 1215718359800 / Unable
to set configured property "/spumco/store/mealdelivery/business/
MealDeliveryManager.userRepository"
atg.nucleus.ConfigurationException: Unable to resolve component /atg/
userprofiling/ProfileAdapterRepository
**** Error Thu Jul 10 14:32:39 GMT-05:00 2008 1215718359800 / Unable
to set configured property "/spumco/store/mealdelivery/business/
MealDeliveryManager.productRepository"
atg.nucleus.ConfigurationException: Unable to resolve component /atg/
commerce/catalog/ProductCatalog
**** Error Thu Jul 10 14:32:39 GMT-05:00 2008 1215718359801 / Unable
to set configured property "/spumco/store/mealdelivery/business/
MealDeliveryManager.pricingTools" atg.nucleus.ConfigurationException:
Unable to resolve component /atg/commerce/pricing/PricingTools

Belmont, Adam

unread,
Jul 14, 2008, 10:33:12 AM7/14/08
to atg_...@googlegroups.com
I'm guessing, but that looks more like you have an Initial.properties file
with an incorrect $class line in it.
It might say?
$class=/atg/Initial

Drop that line since $class should refer to a java class not a nucleus
component path.

-- Adam

1)

2)

3)

4)

5)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ATG_Tech" group.
To post to this group, send email to atg_...@googlegroups.com
To unsubscribe from this group, send email to
atg_tech-u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/atg_tech?hl=en
-~----------~----~----~----~------~----~------~--~---

trak3r

unread,
Jul 14, 2008, 10:58:36 AM7/14/08
to ATG_Tech
Nope, there's no $class defined in the properties file. We looked up
the proper class in the documents and tried it (last week, sorry I
don't remember the class) and set it but that didn't help :-\
>  smime.p7s
> 4KDownload

trak3r

unread,
Jul 14, 2008, 11:11:07 AM7/14/08
to ATG_Tech
Am I nuts or is this stack trace indicating that the component that
can't be found is the one that can't find itself!?

atg.userprofiling.ProfileTools.doStartService() is complaining that is
can't resolve "/atg/userprofiling/ProfileTools"


**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / Unable
to resolve component /atg/userprofiling/ProfileTools
java.lang.NullPointerException
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.userprofiling.ProfileTools.doStartService(ProfileTools.java:415)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.GenericService.startService(GenericService.java:495)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.NucleusNameResolver.startService(NucleusNameResolver.java:
1229)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.NucleusNameResolver.configureAndStartService(NucleusNameResolver.java:
1002)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:
705)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.NucleusNameResolver.createFromName(NucleusNameResolver.java:
576)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:
368)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.NucleusNameResolver.resolveName(NucleusNameResolver.java:
934)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008 1216048137783 / at
atg.nucleus.ConfigurationRef.getValue(ConfigurationRef.java:83)
**** Error Mon Jul 14 10:08:57 GMT-05:00 2008
1216048137783 / ....stack trace CROPPED after 10 lines.

trak3r

unread,
Jul 14, 2008, 11:46:41 AM7/14/08
to ATG_Tech
BTW it was atg.nucleus.InitialService

Belmont, Adam

unread,
Jul 14, 2008, 4:27:16 PM7/14/08
to atg_...@googlegroups.com
Well below I see that you have code trying to resolve lots of different
Nucleus components.
In general you don't want *everything* to be in the configpath of your unit
test because you'll start crossing the line into a test that takes a long
time to startup.

If you use a subclass of ATgDustCase then the following snippet copies
.propertes files from your "source" configpath (typically your module) into
the configpath of the test.

@Override
public void setUp() throws Exception {
super.setUp();
File configDir = NucleusTestUtils.getConfigpath(this.getClass(),
"config");
// make sure all needed files are at the config location.
// "target/test-classes/config" is then prompoted to the configuration
// directory.
copyConfigurationFiles(new String[] {
"C:/ATG/ATG2007.1/MyModule/config/"
}, configDir.getAbsolutePath(), new String[] {
".svn"
});
}


Let's say you need ProfileTools, and ProductCatalog. You'll also need those
.properties files and their dependencies to be in your configpath.


In my example above, the "configpath" for my test is returned by the method:
NucleusTestUtils.getConfigpath(this.getClass(), "config");
In your case, that directory would have to include
atg/userprofiling/ProfileTools, atg/commerce/catalog/ProductCatalog etc...
Do you have those files setup to be copied?

Can your MealDeliveryManager component be broken down into smaller chunks
that could be tested without as many dependencies?


BTW it was atg.nucleus.InitialService

trak3r

unread,
Jul 15, 2008, 10:30:41 AM7/15/08
to ATG_Tech


On Jul 14, 4:27 pm, "Belmont, Adam" <ad...@atg.com> wrote:
> In general you don't want *everything* to be in the configpath of your unit
> test because you'll start crossing the line into a test that takes a long
> time to startup.

I currently do have everything in there; I pass in the config root to
copyConfigurationFiles. If I read you right you're saying this could
be my problem?

Dust doesn't appear to clean the config directory before each run so
over time the more variety of tests you run the more and more copies
of seemingly unecessary properties files you're going to get in that
tree. Should I be making an effort to clean that tree before each
test run?

Thanks for the help.

Belmont, Adam

unread,
Jul 15, 2008, 2:18:29 PM7/15/08
to atg_...@googlegroups.com
Well I was thinking that your configpath just didn't include the properties
files for the components used by your test.

Also I typically have a different "configpath" for each test class:


File configDir = NucleusTestUtils.getConfigpath(this.getClass(),
"config");

The "Class" passed as the first argument should be used to construct the
directory name. That way you don't have multiple tests stepping on each
other.
You're right though it doesn't clean up the configpath dir. You could do
that in the tearDown() method in junit.

Maybe try a really simple test just to confirm that you can resolve some of
those components you need.
For example:

public class MyDustCaseTest extends AtgDustCase {

private File mConfigDir = null;

@Override
public void setUp() throws Exception {
super.setUp();

mConfigDir = NucleusTestUtils.getConfigpath(this.getClass(), "config");


// make sure all needed files are at the config location.

copyConfigurationFiles(new String[] {
"C:/ATG/ATG2007.1/MyModule/config/"
}, mConfigDir.getAbsolutePath(), new String[] {
".svn"
});

}

@Override
public void tearDown() throws Exception {
super.tearDown();
}

public void testComponentResolution() throws Exception {
ProfileTools ptools =
resolveNucleusComponent("/atg/userprofiling/ProfileTools");
assertNotNull(ptools);
}

-----Original Message-----
From: atg_...@googlegroups.com [mailto:atg_...@googlegroups.com] On Behalf
Of trak3r
Sent: Tuesday, July 15, 2008 10:31 AM
To: ATG_Tech

Thanks for the help.

--~--~---------~--~----~------------~-------~--~----~

Gautam

unread,
Jul 16, 2008, 4:55:56 PM7/16/08
to ATG_Tech
I have the similar problem where I was using single directory for
multiple testcases.
I used to cleaned up the terget config directory by extending the
tearDown() method.
Here's what I do:

protected void tearDown() throws Exception {
super.tearDown();
cleanConfigDir();
}

private void cleanConfigDir() {
if (configpath != null) {
File configDir = new File(configpath);
if (configDir.exists()) {
deleteDirectory(configDir);
}
}
}

public boolean deleteDirectory(File path) {
if (path.exists()) {
File[] files = path.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
deleteDirectory(files[i]);
} else {
files[i].delete();
}
}
}

return (path.delete());
}

Thanks,
-Gautam
Reply all
Reply to author
Forward
0 new messages