Thanks Mark. I did that manually and it worked.
I have a follow up question though. I have automated the process of
updating/creating a package and its assocaited models, enums, import
section, etc. I saw that how the header was stored has changed from on the
package node to a sud-node, but it *appears *that the validate/create
snapshot process may have changed. I used to do the following
1. Validate the package after modification/creation
private void validatePackage(PackageItem rulesPackage) {
SuggestionCompletionLoader loader = new
SuggestionCompletionLoader();
List<JarInputStream> jars = getJars(rulesPackage);
List<String> enums = getEnumerations(rulesPackage);
String importSection = getImportSection(rulesPackage);
loader.getSuggestionEngine(importSection, jars, new ArrayList(),
enums);
if (loader.hasErrors()) {
StringBuilder sb = new StringBuilder();
for (Iterator iter = loader.getErrors().iterator();
iter.hasNext();) {
sb.append((String) iter.next());
if (iter.hasNext()) {
sb.append("\n");
}
}
throw new IllegalStateException("Invalid Package! " +
sb.toString());
}
}
2. then create the snapshot
private void createPackageSnapshot() {
String snapshots[] =
rulesRepository.listPackageSnapshots(RULE_PACKAGE_NAME);
// the repo doesn't have an overwrite, so if this snapshot already
exists, we need to remove it before
// creating it again
for (String snapshot : snapshots) {
if (snapshot.equals(cmdbVersion)) {
rulesRepository.removePackageSnapshot(RULE_PACKAGE_NAME,
cmdbVersion);
break;
}
}
// create snapshot for this version
rulesRepository.createPackageSnapshot(RULE_PACKAGE_NAME,
cmdbVersion);
PackageItem snapshot =
rulesRepository.loadPackageSnapshot(RULE_PACKAGE_NAME, cmdbVersion);
snapshot.updateCheckinComment("Updated for CMDB Version " +
cmdbVersion);
}
This used to work fine, i.e.it would result in the binary content of the
package being available.
So, back to my original question, did this change?
thanks much
dave
ps - I have modified my code to now build the compiled package too
On Wed, Oct 1, 2008 at 1:44 PM, Mark Proctor <mproctor(a)codehaus.org> wrote:
When migrating to new versions of Drools you need to rebuild your
packages, PackageCompilationData does not exist any more.
Mark
David Sinclair wrote:
Please not that this was a migrated package, so that may be the underlying
problem
On Wed, Oct 1, 2008 at 12:05 PM, David Sinclair <
dsinclair(a)chariotsolutions.com> wrote:
> I have upgrade my application to use the milestone 2 code and am having a
> problem loading a package from guvnor via the rule agent. I am getting a
> class not found exception for org.drools.rule.PackageCompilationData. Here
> is the stack from the app. Looking at the code it appears the
> PackageCompilationData has been removed.
>
> RuleAgent(Drools) INFO (Wed Oct 01 11:55:19 EDT 2008): Configuring with
> newInstance=false, secondsToRefresh=60
> RuleAgent(Drools) INFO (Wed Oct 01 11:55:19 EDT 2008): Configuring package
> provider : URLScanner monitoring URLs:
>
http://localhost:8080/drools-guvnor
> /org.drools.guvnor.Guvnor/package/com.sungard.cmdb.rules/0.7-SNAPSHOT
> PackageName: com.sungard.cmdb.rules
> PackageVersion: 0.7-SNAPSHOT
> PackageIsLatest: false
> PackageIsSource: false
> RuleAgent(Drools) EXCEPTION (Wed Oct 01 11:55:22 EDT 2008):
> org.drools.rule.PackageCompilationData. Stack trace should follow.
> java.lang.ClassNotFoundException: org.drools.rule.PackageCompilationData
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
>
org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:85)
> at
>
org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:97)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
> at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
> at org.drools.rule.Package.readExternal(Package.java:198)
> at
> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
> at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
> at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
> at
> org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:185)
> at
> org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:154)
> at
> org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:47)
> at org.drools.agent.URLScanner.readPackage(URLScanner.java:142)
> at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:114)
> at
> org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:90)
> at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:393)
> at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:345)
> at org.drools.agent.RuleAgent.configure(RuleAgent.java:330)
> at org.drools.agent.RuleAgent.init(RuleAgent.java:246)
> at org.drools.agent.RuleAgent.init(RuleAgent.java:195)
> at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:188)
> at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:156)
>
> thanks
>
> dave
>
------------------------------
_______________________________________________
rules-dev mailing
listrules-dev@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________
rules-dev mailing list
rules-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev