Package org.drools.guvnor.client.rpc

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


                    scenario,
                    this.rulesRepository.loadModule(packageName),
                    coverage);
        } catch (Exception e) {
            if (e instanceof DetailedSerializationException) {
                DetailedSerializationException exception = (DetailedSerializationException) e;
                if (exception.getErrs() != null) {
                    return new SingleScenarioResult(new ScenarioRunResult(exception.getErrs()));
                } else {
                    throw exception;
                }
            } else {
                throw new DetailedSerializationException("Unable to run the scenario.",
                        e.getMessage());
            }
        }
    }
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

                                      int skip,
                                      int numRows,
                                      String tableConfig) throws SerializationException {
        log.debug("Loading asset list for [" + packageUuid + "]");
        if (numRows == 0) {
            throw new DetailedSerializationException("Unable to return zero results (bug)",
                    "probably have the parameters around the wrong way, sigh...");
        }
        return repositoryAssetOperations.listAssets(packageUuid,
                formats,
                skip,
View Full Code Here

    public TableDataResult queryFullText(String text,
                                         boolean seekArchived,
                                         int skip,
                                         int numRows) throws SerializationException {
        if (numRows == 0) {
            throw new DetailedSerializationException("Unable to return zero results (bug)",
                    "probably have the parameters around the wrong way, sigh...");
        }
        return repositoryAssetOperations.queryFullText(text,
                seekArchived,
                skip,
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

                    cl,
                    rb,
                    coverage );
        } catch (Exception e) {
            if ( e instanceof DetailedSerializationException ) {
                DetailedSerializationException err = (DetailedSerializationException) e;
                result = new SingleScenarioResult();
                if ( err.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 : err.getErrs()) {
                        errors.add( line );
                    }
                    result.result = new ScenarioRunResult( errors,
                                                           null );
                } else {
                    throw err;
                }
            } else {
                throw new DetailedSerializationException( "Unable to run the scenario.",
                        e.getMessage() );
            }
        } finally {
            Thread.currentThread().setContextClassLoader( originalCL );
        }
View Full Code Here

                if ( result == null || result.getLines().size() == 0 ) {
                    rb = loadRuleBase( packageItem,
                            buildCl );
                    RuleBaseCache.getInstance().put( packageItem.getUUID(),
                            rb );
                } else throw new DetailedSerializationException( "Build error",
                        result.getLines() );
            }

        }
        return rb;
View Full Code Here

            return deserKnowledgebase( item,
                    cl );
        } 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 res = repositoryPackageOperations.buildPackage( item,
                        true );
                if ( res != null && res.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,
                        cl );
            } catch (Exception e2) {
                log.error( "Unable to reload knowledgebase: " + e.getMessage() );
                throw new DetailedSerializationException( "Unable to reload knowledgebase.",
                        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.