Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> RE: [OS: Windows] Could not find or load main class sqlline.SqlLine


Copy link to this message
-
Re: [OS: Windows] Could not find or load main class sqlline.SqlLine
Ravi,

sqlline.properties is included in sqlline-1.1.0.jar. You can get rid of
this message by extracting the file and copying it into your user folder
C:\Users\ravisankars\sqlline\. Anyway, this is not critical, you can work
without that file.

The real problem is the other error [No known driver to handle
"jdbc:drill:schema=parquet-local"]. It looks like the scan of the classes
does not work with jars included from the manifest file of an executable
jar (-jar option). If you specify the full class name for the driver by
appending "-d org.apache.drill.jdbc.Driver", then it finds the Driver class
but it fails loading it because of a deserialization error in Jackson:
com.fasterxml.jackson.databind.JsonMappingException: Could not resolve type
id 'parquet' into a subtype of [simple type, class
org.apache.drill.common.logical.StorageEngineConfig]
Basically, Jackson cannot find annotated classes in the external jars.

At this point I think the only other way to get this working is by copying
all the dependent jars in a "dependencies" folder. You can do this with
maven:
...
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>2.8</version>
  <executions>
    <execution>
      <id>copy-dependencies</id>
      <phase>package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>

<outputDirectory>${project.build.directory}/dependencies/</outputDirectory>
        <overWriteReleases>false</overWriteReleases>
        <overWriteSnapshots>false</overWriteSnapshots>
        <overWriteIfNewer>true</overWriteIfNewer>
      </configuration>
    </execution>
  </executions>
</plugin>
...

Then execute sqlline:
java -Xmx1G
-Dlogback.configurationFile=./sqlparser/src/test/resources/logback.xml -cp
"./contrib/sqlline/target/dependencies/*" sqlline.SqlLine --verbose=true -u
jdbc:drill:schema=parquet-local -n admin -p admin

Hope this will help.

Marco

On Sat, Dec 28, 2013 at 9:43 PM, Ravisankar Sivasubramaniam <
[EMAIL PROTECTED]> wrote:

> Marco,
> Thank you very much.  That worked for me as well.  Now I am getting the
> following error.  What is the deal on sqlline.properties?
> D:\workspace\incubator-drill>java -Xmx1G
> -Dlogback.configurationFile=.\sqlparser\src\test\resources\logback.xml -jar
> contrib\sqlline\target\drill-sqlline-1.0.0-
> m2-incubating-SNAPSHOT.jar --verbose=true -u
> jdbc:drill:schema=parquet-local -n admin -p admin
> Loaded singnal handler: SunSignalHandler
> C:\Users\ravisankars\sqlline\sqlline.properties (The system cannot find the
> file specified)
> issuing: !connect jdbc:drill:schema=parquet-local admin admin scan
> complete in 5ms scan complete in 7ms No known driver to handle
> "jdbc:drill:schema=parquet-local" sqlline version ??? by Marc Prud'hommeaux
> sqlline>
> Best Regards,Ravi> Date: Sat, 28 Dec 2013 12:04:42 -0800
> > Subject: Re: [OS: Windows] Could not find or load main class
> sqlline.SqlLine
> > From: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]
> >
> > Ravi,
> >
> > Can you try changing the classpathPrefix in your maven pom file from
> > <classpathPrefix>c:\Users\ravisankars\.m2\repository</classpathPrefix>
> > to
> > <classpathPrefix>/c:/Users/ravisankars/.m2/repository/</classpathPrefix>
> > Or better:
> > <classpathPrefix>/${settings.localRepository}/</classpathPrefix>
> >
> > Notice the '/' at the beginning and at the end of the path. This works
> for
> > me.
> >
> > Best Regards,
> > Marco
> >
> > On Sat, Dec 28, 2013 at 10:00 AM, Ravisankar Sivasubramaniam <
> > [EMAIL PROTECTED]> wrote:
> >
> > >  Progress so far
> > > -------------------
> > > Looks like apache-rat-plugin didn't like me logging the content to
> log.txt
> > > under incubator-drill.  Once I instructed mvn to log the output outside
> > > the folder, the build got completed without any error.
> > >
> > > Open issue
> > > ---------------
> > > The sqlline.bat looks as follows:
> > >
> > >
> > >
> > >
> > > *if not exist contrib\sqlline\target (    cd contrib\sqlline    mvn
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB