Package org.hibernate

Examples of org.hibernate.MappingNotFoundException


    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

    LOG.readingMappingsFromFile( xmlFile.getPath() );
    XmlDocument metadataXml = add( inputSource, "file", name );
View Full Code Here


   */
  public Configuration addResource(String resourceName, ClassLoader classLoader) throws MappingException {
    LOG.readingMappingsFromResource( resourceName );
    InputStream resourceInputStream = classLoader.getResourceAsStream( resourceName );
    if ( resourceInputStream == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    add( resourceInputStream, "resource", resourceName );
    return this;
  }
View Full Code Here

    }
    if ( resourceInputStream == null ) {
      resourceInputStream = Environment.class.getClassLoader().getResourceAsStream( resourceName );
    }
    if ( resourceInputStream == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    add( resourceInputStream, "resource", resourceName );
    return this;
  }
View Full Code Here

    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }
    add( inputSource, "file", name );
    return this;
  }
View Full Code Here

    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

    LOG.readingMappingsFromFile( xmlFile.getPath() );
    XmlDocument metadataXml = add( inputSource, "file", name );
View Full Code Here

   */
  public Configuration addResource(String resourceName, ClassLoader classLoader) throws MappingException {
    LOG.readingMappingsFromResource( resourceName );
    InputStream resourceInputStream = classLoader.getResourceAsStream( resourceName );
    if ( resourceInputStream == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    add( resourceInputStream, "resource", resourceName );
    return this;
  }
View Full Code Here

    }
    if ( resourceInputStream == null ) {
      resourceInputStream = Environment.class.getClassLoader().getResourceAsStream( resourceName );
    }
    if ( resourceInputStream == null ) {
      throw new MappingNotFoundException( "resource", resourceName );
    }
    add( resourceInputStream, "resource", resourceName );
    return this;
  }
View Full Code Here

  private String getProbableSolutionOrCause(Throwable re) {
    if(re==null) return null;
   
    if(re instanceof MappingNotFoundException) {
      MappingNotFoundException mnf = (MappingNotFoundException)re;
      if("resource".equals(mnf.getType())) {
        return "A " + mnf.getType() + " located at " + mnf.getPath() + " was not found.\n" +
            "Check the following:\n" +
            "\n" +
            "1) Is the spelling/casing correct ?\n" +
            "2)  Is " + mnf.getPath() + " available via the classpath ?\n" +
            "3) Does it actually exist ?\n";           
      } else {
        return "A " + mnf.getType() + " located at " + mnf.getPath() + " was not found.\n" +
        "Check the following:\n" +
        "\n" +
        "1) Is the spelling/casing correct ?\n" +
        "2)  Do you permission to access " + mnf.getPath() + " ?\n" +
        "3) Does it actually exist ?\n"
      }
    }

    if(re instanceof ClassNotFoundException || re instanceof NoClassDefFoundError) {
View Full Code Here

    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }
    add( inputSource, "file", name );
    return this;
  }
View Full Code Here

    final InputSource inputSource;
    try {
      inputSource = new InputSource( new FileInputStream( xmlFile ) );
    }
    catch ( FileNotFoundException e ) {
      throw new MappingNotFoundException( "file", xmlFile.toString() );
    }

    LOG.readingMappingsFromFile( xmlFile.getPath() );
    XmlDocument metadataXml = add( inputSource, "file", name );
View Full Code Here

TOP

Related Classes of org.hibernate.MappingNotFoundException

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.