Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.DetailedSerializationException


        try {
            return SpringContextElementsManager.getInstance().getElements();
        } catch ( IOException ex ) {
            log.error( "Error loading Spring Context Elements",
                       ex );
            throw new DetailedSerializationException( "Error loading Spring Context Elements",
                                                      "View server logs for more information" );
        }
    }
View Full Code Here


        try {
            return WorkitemDefinitionElementsManager.getInstance().getElements();
        } catch ( IOException ex ) {
            log.error( "Error loading Workitem Definition Elements",
                       ex );
            throw new DetailedSerializationException( "Error loading Workitem Definition Elements",
                                                      "View server logs for more information" );
        }
    }
View Full Code Here

                }
            }
        } catch ( Exception e ) {
            log.error( "Error loading Workitem Definitions for package [" + packageUUID + "]",
                       e );
            throw new DetailedSerializationException( "Error loading Workitem Definitions for package [" + packageUUID + "]",
                                                      "View server logs for more information" );
        }

        try {
            // - workitem-definitions.xml
            Map<String, org.drools.process.core.WorkDefinition> configuredWorkDefinitions = ConfigFileWorkDefinitionsLoader.getInstance().getWorkDefinitions();
            for ( Map.Entry<String, org.drools.process.core.WorkDefinition> entry : configuredWorkDefinitions.entrySet() ) {
                if ( !workDefinitions.containsKey( entry.getKey() ) ) {
                    workDefinitions.put( entry.getKey(),
                                         entry.getValue() );
                }
            }
        } catch ( Exception e ) {
            log.error( "Error loading Workitem Definitions from configuration file",
                       e );
            throw new DetailedSerializationException( "Error loading Workitem Definitions from configuration file",
                                                      "View server logs for more information" );
        }

        //Copy the Work Items into Structures suitable for GWT
        Set<PortableWorkDefinition> workItems = new HashSet<PortableWorkDefinition>();
View Full Code Here

                        snapName);
                BuilderResult builderResult = this.buildPackage(snap.getUUID(),
                        true);
                if (builderResult.hasLines()) {
                    StringBuilder stringBuilder = createStringBuilderFrom(builderResult);
                    throw new DetailedSerializationException("Unable to rebuild snapshot [" + snapName,
                            stringBuilder.toString() + "]");
                }
            }
        }
    }
View Full Code Here

                }
            }
            return res.toArray(new String[res.size()]);
        } catch (IOException e) {
            log.error("Unable to read the jar files in the package: " + e.getMessage());
            throw new DetailedSerializationException("Unable to read the jar files in the package.",
                    e.getMessage());
        } finally {
            IOUtils.closeQuietly(jis);
        }
View Full Code Here

            return runScenario( scenario,
                                this.rulesRepository.loadModule( packageName ),
                                coverage );
        } catch ( Exception e ) {
            if ( e instanceof DetailedSerializationException ) {
                DetailedSerializationException exception = (DetailedSerializationException) e;
                if ( exception.getErrs() != null ) {
                    //err.getErrs() returns a Collections$UnmodifiablerRandomAccessList that cannot be serialised
                    //by GWT. Hence we need to convert the errors into a List that can be serialised by GWT
                    List<BuilderResultLine> errors = new ArrayList<BuilderResultLine>();
                    for ( BuilderResultLine line : exception.getErrs() ) {
                        errors.add( line );
                    }
                    return new SingleScenarioResult( new ScenarioRunResult( errors ) );
                } else {
                    throw exception;
                }
            } else {
                throw new DetailedSerializationException( "Unable to run the scenario.",
                                                          e.getMessage() );
            }
        }
    }
View Full Code Here

                    RuleBase ruleBase = loadRuleBase(packageItem);
                    RuleBaseCache.getInstance().put(packageItem.getUUID(),
                            ruleBase);
                    return ruleBase;
                } else {
                    throw new DetailedSerializationException("Build error",
                            result.getLines());
                }
            }

        }
View Full Code Here

                    new ScenarioRunResult(scenario),
                    logger.buildReport());
        } catch (ClassNotFoundException e) {
            log.error("Unable to load a required class.",
                    e);
            throw new DetailedSerializationException("Unable to load a required class.",
                    e.getMessage());
        } catch (ConsequenceException e) {
            String messageShort = "There was an error executing the consequence of rule [" + e.getRule().getName() + "]";
            String messageLong = e.getMessage();
            if (e.getCause() != null) {
                messageLong += "\nCAUSED BY " + e.getCause().getMessage();
            }

            log.error(messageShort + ": " + messageLong,
                    e);
            throw new DetailedSerializationException(messageShort,
                    messageLong);
        } catch (Exception e) {
            log.error("Unable to run the scenario.",
                    e);
            throw new DetailedSerializationException("Unable to run the scenario.",
                    e.getMessage());
        }
    }
View Full Code Here

                    item,
                    createClassLoaderBuilder(item).buildClassLoader());
        } catch (ClassNotFoundException e) {
            log.error("Unable to load rule base.",
                    e);
            throw new DetailedSerializationException("A required class was not found.",
                    e.getMessage());
        } catch (Exception e) {
            log.error("Unable to load rule base.",
                    e);
            log.info("...but trying to rebuild binaries...");
            try {
                BuilderResult builderResult = repositoryModuleOperations.buildModule(
                        item,
                        true);
                if (builderResult != null && builderResult.getLines().size() > 0) {
                    log.error("There were errors when rebuilding the knowledgebase.");
                    throw new DetailedSerializationException("There were errors when rebuilding the knowledgebase.",
                            "");
                }
            } catch (Exception e1) {
                log.error("Unable to rebuild the rulebase: " + e.getMessage());
                throw new DetailedSerializationException("Unable to rebuild the rulebase.",
                        e.getMessage());
            }
            try {
                return deserKnowledgebase(
                        item,
                        createClassLoaderBuilder(item).buildClassLoader());
            } catch (Exception e2) {
                log.error("Unable to reload knowledgebase: " + e.getMessage());
                throw new DetailedSerializationException("Unable to reload knowledgebase.",
                        e.getMessage());
            }

        }
    }
View Full Code Here

                            categoryOperator,
                            category,
                            enableCategorySelector,
                            customSelectorName ) );
        } catch (NoClassDefFoundError e) {
            throw new DetailedSerializationException( "Unable to find a class that was needed when building the module  [" + e.getMessage() + "]",
                    "Perhaps you are missing them from the model jars, or from the BRMS itself (lib directory)." );
        } catch (UnsupportedClassVersionError e) {
            throw new DetailedSerializationException( "Can not build the module. One or more of the classes that are needed were compiled with an unsupported Java version.",
                    "For example the pojo classes were compiled with Java 1.6 and Guvnor is running on Java 1.5. [" + e.getMessage() + "]" );
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.DetailedSerializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.