buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Odelya Holiday <ode...@alicanto.com>
Subject Java class is being compiled differently with buildr - java 1.6 than with javac command
Date Mon, 27 Aug 2012 14:11:43 GMT
Hi!

I have the following a java class with the following method:

public class HibernateCampaignDBImpl implements CampaignDB {
        private Filter getVIPClientsFilter(Campaign campaign) {
CampaignTarget campaignTarget =
CampaignTarget.lookup(Integer.valueOf(campaign.getClients()));
 switch (campaignTarget) {
case ALL:
return new Filter(); // empty filter (no effect)
case VIP:
return new Filter("vip", true);
case NON_VIP:
return new Filter("vip", false);
// TODO handle case LIST
default:
throw new IllegalArgumentException("Unknown campaign clients target value");
}
}
}
When using buildr, it compiles the method class, to another sub class:

HibernateCampaignDBImpl$1

and fails on:

HibernateCampaignDBImpl$1java.lang.NoClassDefFoundError:
HibernateCampaignDBImpl$1 at HibernateCampaignDBImpl.getVIPClientsFilter

However, if I do javac it doesn't compile an extra class - and there is one
class:  HibernateCampaignDBImpl for all the code.

1. Why is the compilation different with buildr? are you using javac?

2. How come it doesn't find the class if it's located in the same folder?

You can see the full code of the class here:

https://github.com/Odelya/Code-sample/blob/master/HibernateCampaignDBImpl.java


The exception is:


Error processing direct channel #28335
com/grroo/engine/db/impl/HibernateCampaignDBImpl$1java.lang.NoClassDefFoundError:
com/grroo/engine/db/impl/HibernateCampaignDBImpl$1
 at
com.grroo.engine.db.impl.HibernateCampaignDBImpl.getVIPClientsFilter(HibernateCampaignDBImpl.java:187)




-- 
Odelya

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message