I have a project with following POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
I then compile and install with mvn clean install. I can see artefact installed in my .m2 dir:
lukasz#lukasz-XPS-L701X:~$ ls .m2/repository/com/example/demo/
0.0.1-SNAPSHOT maven-metadata-local.xml
I can use this file in other project when calling javac directly:
javac -cp .m2/repository/com/example/demo/0.0.1-SNAPSHOT/demo-0.0.1-SNAPSHOT.jar
However, when I have another Maven project that has demo as dependency, Maven says it can't find it.
demo2 POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo2</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
When I run mvn clean compile in demo2, I get:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building demo2 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # demo2 ---
[INFO] Deleting /home/lukasz/parent/demo2/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # demo2 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # demo2 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/lukasz/parent/demo2/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/lukasz/parent/demo2/src/main/java/com/example/Demo2Application.java:[11,17] cannot find symbol
symbol: class Aclass
location: class com.example.Demo2Application
[ERROR] /home/lukasz/parent/demo2/src/main/java/com/example/Demo2Application.java:[11,32] cannot find symbol
symbol: class Aclass
location: class com.example.Demo2Application
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.053 s
[INFO] Finished at: 2017-02-19T10:45:57+01:00
[INFO] Final Memory: 22M/254M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project demo2: Compilation failure: Compilation failure:
[ERROR] /home/lukasz/parent/demo2/src/main/java/com/example/Demo2Application.java:[11,17] cannot find symbol
[ERROR] symbol: class Aclass
[ERROR] location: class com.example.Demo2Application
[ERROR] /home/lukasz/parent/demo2/src/main/java/com/example/Demo2Application.java:[11,32] cannot find symbol
[ERROR] symbol: class Aclass
[ERROR] location: class com.example.Demo2Application
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
EDIT:
This is output of ls -lR .m2/repository/com/example/demo/
.m2/repository/com/example/demo/:
total 8
drwxr-xr-x 5 lukasz lukasz 4096 Feb 19 07:12 0.0.1-SNAPSHOT
-rw-r--r-- 1 lukasz lukasz 275 Feb 19 07:07 maven-metadata-local.xml
.m2/repository/com/example/demo/0.0.1-SNAPSHOT:
total 6468
drwxr-xr-x 4 lukasz lukasz 4096 Feb 19 07:07 BOOT-INF
-rw-r--r-- 1 lukasz lukasz 6595868 Feb 19 07:07 demo-0.0.1-SNAPSHOT.jar
-rw-r--r-- 1 lukasz lukasz 1410 Feb 19 01:01 demo-0.0.1-SNAPSHOT.pom
-rw-r--r-- 1 lukasz lukasz 701 Feb 19 07:07 maven-metadata-local.xml
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 META-INF
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 org
-rw-r--r-- 1 lukasz lukasz 185 Feb 19 07:07 _remote.repositories
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/BOOT-INF:
total 8
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 classes
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 lib
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/BOOT-INF/classes:
total 4
-rw-r--r-- 1 lukasz lukasz 0 Feb 19 07:07 application.properties
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 com
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/BOOT-INF/classes/com:
total 4
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 example
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/BOOT-INF/classes/com/example:
total 8
-rw-r--r-- 1 lukasz lukasz 267 Feb 19 07:07 Aclass.class
-rw-r--r-- 1 lukasz lukasz 694 Feb 19 07:07 DemoApplication.class
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/BOOT-INF/lib:
total 6384
-rw-r--r-- 1 lukasz lukasz 16521 Dec 13 18:09 jcl-over-slf4j-1.7.22.jar
-rw-r--r-- 1 lukasz lukasz 4596 Dec 13 18:09 jul-to-slf4j-1.7.22.jar
-rw-r--r-- 1 lukasz lukasz 23647 Dec 13 18:09 log4j-over-slf4j-1.7.22.jar
-rw-r--r-- 1 lukasz lukasz 305150 Jan 20 19:58 logback-classic-1.1.9.jar
-rw-r--r-- 1 lukasz lukasz 472639 Jan 20 19:57 logback-core-1.1.9.jar
-rw-r--r-- 1 lukasz lukasz 41077 Dec 13 18:07 slf4j-api-1.7.22.jar
-rw-r--r-- 1 lukasz lukasz 273599 Feb 19 2016 snakeyaml-1.17.jar
-rw-r--r-- 1 lukasz lukasz 379905 Jan 25 13:13 spring-aop-4.3.6.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 762701 Jan 25 13:13 spring-beans-4.3.6.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 662119 Jan 30 19:31 spring-boot-1.5.1.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 1038200 Jan 30 19:39 spring-boot-autoconfigure-1.5.1.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 2290 Jan 30 19:45 spring-boot-starter-1.5.1.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 2309 Jan 30 19:45 spring-boot-starter-logging-1.5.1.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 1136805 Jan 25 13:14 spring-context-4.3.6.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 1117842 Jan 25 13:13 spring-core-4.3.6.RELEASE.jar
-rw-r--r-- 1 lukasz lukasz 263304 Jan 25 13:14 spring-expression-4.3.6.RELEASE.jar
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/META-INF:
total 8
-rw-r--r-- 1 lukasz lukasz 558 Feb 19 07:07 MANIFEST.MF
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 maven
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/META-INF/maven:
total 4
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 com.example
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/META-INF/maven/com.example:
total 4
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 demo
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/META-INF/maven/com.example/demo:
total 8
-rw-r--r-- 1 lukasz lukasz 116 Feb 19 07:07 pom.properties
-rw-r--r-- 1 lukasz lukasz 1410 Feb 19 01:01 pom.xml
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org:
total 4
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 springframework
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework:
total 4
drwxr-xr-x 3 lukasz lukasz 4096 Feb 19 07:07 boot
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework/boot:
total 4
drwxr-xr-x 6 lukasz lukasz 4096 Feb 19 07:07 loader
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework/boot/loader:
total 92
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 archive
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 data
-rw-r--r-- 1 lukasz lukasz 1165 Jan 30 19:26 ExecutableArchiveLauncher$1.class
-rw-r--r-- 1 lukasz lukasz 3128 Jan 30 19:26 ExecutableArchiveLauncher.class
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 jar
-rw-r--r-- 1 lukasz lukasz 1533 Jan 30 19:26 JarLauncher.class
-rw-r--r-- 1 lukasz lukasz 2415 Jan 30 19:26 LaunchedURLClassLoader$1.class
-rw-r--r-- 1 lukasz lukasz 4698 Jan 30 19:26 LaunchedURLClassLoader.class
-rw-r--r-- 1 lukasz lukasz 4599 Jan 30 19:26 Launcher.class
-rw-r--r-- 1 lukasz lukasz 1468 Jan 30 19:26 MainMethodRunner.class
-rw-r--r-- 1 lukasz lukasz 1382 Jan 30 19:26 PropertiesLauncher$1.class
-rw-r--r-- 1 lukasz lukasz 1454 Jan 30 19:26 PropertiesLauncher$ArchiveEntryFilter.class
-rw-r--r-- 1 lukasz lukasz 16109 Jan 30 19:26 PropertiesLauncher.class
-rw-r--r-- 1 lukasz lukasz 1704 Jan 30 19:26 PropertiesLauncher$FilteredArchive$1.class
-rw-r--r-- 1 lukasz lukasz 2382 Jan 30 19:26 PropertiesLauncher$FilteredArchive.class
-rw-r--r-- 1 lukasz lukasz 1807 Jan 30 19:26 PropertiesLauncher$PrefixMatchingArchiveFilter.class
drwxr-xr-x 2 lukasz lukasz 4096 Feb 19 07:07 util
-rw-r--r-- 1 lukasz lukasz 1669 Jan 30 19:26 WarLauncher.class
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework/boot/loader/archive:
total 52
-rw-r--r-- 1 lukasz lukasz 906 Jan 30 19:26 Archive.class
-rw-r--r-- 1 lukasz lukasz 302 Jan 30 19:26 Archive$Entry.class
-rw-r--r-- 1 lukasz lukasz 399 Jan 30 19:26 Archive$EntryFilter.class
-rw-r--r-- 1 lukasz lukasz 273 Jan 30 19:26 ExplodedArchive$1.class
-rw-r--r-- 1 lukasz lukasz 4974 Jan 30 19:26 ExplodedArchive.class
-rw-r--r-- 1 lukasz lukasz 1068 Jan 30 19:26 ExplodedArchive$FileEntry.class
-rw-r--r-- 1 lukasz lukasz 3792 Jan 30 19:26 ExplodedArchive$FileEntryIterator.class
-rw-r--r-- 1 lukasz lukasz 1438 Jan 30 19:26 ExplodedArchive$FileEntryIterator$EntryComparator.class
-rw-r--r-- 1 lukasz lukasz 7016 Jan 30 19:26 JarFileArchive.class
-rw-r--r-- 1 lukasz lukasz 1749 Jan 30 19:26 JarFileArchive$EntryIterator.class
-rw-r--r-- 1 lukasz lukasz 1051 Jan 30 19:26 JarFileArchive$JarFileEntry.class
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework/boot/loader/data:
total 24
-rw-r--r-- 1 lukasz lukasz 1531 Jan 30 19:26 ByteArrayRandomAccessData.class
-rw-r--r-- 1 lukasz lukasz 551 Jan 30 19:26 RandomAccessData.class
-rw-r--r-- 1 lukasz lukasz 3390 Jan 30 19:26 RandomAccessDataFile.class
-rw-r--r-- 1 lukasz lukasz 3534 Jan 30 19:26 RandomAccessDataFile$DataInputStream.class
-rw-r--r-- 1 lukasz lukasz 2051 Jan 30 19:26 RandomAccessDataFile$FilePool.class
-rw-r--r-- 1 lukasz lukasz 1341 Jan 30 19:26 RandomAccessData$ResourceAccess.class
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework/boot/loader/jar:
total 136
-rw-r--r-- 1 lukasz lukasz 4457 Jan 30 19:26 AsciiBytes.class
-rw-r--r-- 1 lukasz lukasz 2169 Jan 30 19:26 Bytes.class
-rw-r--r-- 1 lukasz lukasz 2943 Jan 30 19:26 CentralDirectoryEndRecord.class
-rw-r--r-- 1 lukasz lukasz 5449 Jan 30 19:26 CentralDirectoryFileHeader.class
-rw-r--r-- 1 lukasz lukasz 4602 Jan 30 19:26 CentralDirectoryParser.class
-rw-r--r-- 1 lukasz lukasz 430 Jan 30 19:26 CentralDirectoryVisitor.class
-rw-r--r-- 1 lukasz lukasz 306 Jan 30 19:26 FileHeader.class
-rw-r--r-- 1 lukasz lukasz 9657 Jan 30 19:26 Handler.class
-rw-r--r-- 1 lukasz lukasz 3350 Jan 30 19:26 JarEntry.class
-rw-r--r-- 1 lukasz lukasz 262 Jan 30 19:26 JarEntryFilter.class
-rw-r--r-- 1 lukasz lukasz 2002 Jan 30 19:26 JarFile$1.class
-rw-r--r-- 1 lukasz lukasz 1199 Jan 30 19:26 JarFile$2.class
-rw-r--r-- 1 lukasz lukasz 1427 Jan 30 19:26 JarFile$3.class
-rw-r--r-- 1 lukasz lukasz 12697 Jan 30 19:26 JarFile.class
-rw-r--r-- 1 lukasz lukasz 1540 Jan 30 19:26 JarFileEntries$1.class
-rw-r--r-- 1 lukasz lukasz 10924 Jan 30 19:26 JarFileEntries.class
-rw-r--r-- 1 lukasz lukasz 1967 Jan 30 19:26 JarFileEntries$EntryIterator.class
-rw-r--r-- 1 lukasz lukasz 1300 Jan 30 19:26 JarFile$JarFileType.class
-rw-r--r-- 1 lukasz lukasz 672 Jan 30 19:26 JarURLConnection$1.class
-rw-r--r-- 1 lukasz lukasz 9111 Jan 30 19:26 JarURLConnection.class
-rw-r--r-- 1 lukasz lukasz 3641 Jan 30 19:26 JarURLConnection$JarEntryName.class
-rw-r--r-- 1 lukasz lukasz 1629 Jan 30 19:26 ZipInflaterInputStream.class
.m2/repository/com/example/demo/0.0.1-SNAPSHOT/org/springframework/boot/loader/util:
total 8
-rw-r--r-- 1 lukasz lukasz 4887 Jan 30 19:26 SystemPropertyUtils.class
Please note that I did say I can use this jar (and Aclass) when calling javac directly with -cp.
EDIT:
Source for Demo2Application.java:
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class Demo2Application {
public static void main(String[] args) {
SpringApplication.run(Demo2Application.class, args);
Aclass c = new Aclass();
}
}
Output of jat tvf on jar:
lukasz#lukasz-XPS-L701X:~/.m2/repository/com/example/demo/0.0.1-SNAPSHOT$ jar tvf demo-0.0.1-SNAPSHOT.jar
0 Sun Feb 19 07:07:38 CET 2017 META-INF/
558 Sun Feb 19 07:07:38 CET 2017 META-INF/MANIFEST.MF
0 Sun Feb 19 07:07:38 CET 2017 BOOT-INF/
0 Sun Feb 19 07:07:38 CET 2017 BOOT-INF/classes/
0 Sun Feb 19 07:07:34 CET 2017 BOOT-INF/classes/com/
0 Sun Feb 19 07:07:34 CET 2017 BOOT-INF/classes/com/example/
267 Sun Feb 19 07:07:34 CET 2017 BOOT-INF/classes/com/example/Aclass.class
694 Sun Feb 19 07:07:34 CET 2017 BOOT-INF/classes/com/example/DemoApplication.class
0 Sun Feb 19 07:07:30 CET 2017 BOOT-INF/classes/application.properties
0 Sun Feb 19 07:07:38 CET 2017 META-INF/maven/
0 Sun Feb 19 07:07:38 CET 2017 META-INF/maven/com.example/
0 Sun Feb 19 07:07:38 CET 2017 META-INF/maven/com.example/demo/
1410 Sun Feb 19 01:01:32 CET 2017 META-INF/maven/com.example/demo/pom.xml
116 Sun Feb 19 07:07:38 CET 2017 META-INF/maven/com.example/demo/pom.properties
0 Sun Feb 19 07:07:38 CET 2017 BOOT-INF/lib/
41077 Tue Dec 13 18:07:58 CET 2016 BOOT-INF/lib/slf4j-api-1.7.22.jar
2309 Mon Jan 30 19:45:02 CET 2017 BOOT-INF/lib/spring-boot-starter-logging-1.5.1.RELEASE.jar
2290 Mon Jan 30 19:45:02 CET 2017 BOOT-INF/lib/spring-boot-starter-1.5.1.RELEASE.jar
662119 Mon Jan 30 19:31:36 CET 2017 BOOT-INF/lib/spring-boot-1.5.1.RELEASE.jar
472639 Fri Jan 20 19:57:20 CET 2017 BOOT-INF/lib/logback-core-1.1.9.jar
4596 Tue Dec 13 18:09:14 CET 2016 BOOT-INF/lib/jul-to-slf4j-1.7.22.jar
762701 Wed Jan 25 13:13:50 CET 2017 BOOT-INF/lib/spring-beans-4.3.6.RELEASE.jar
379905 Wed Jan 25 13:13:54 CET 2017 BOOT-INF/lib/spring-aop-4.3.6.RELEASE.jar
16521 Tue Dec 13 18:09:00 CET 2016 BOOT-INF/lib/jcl-over-slf4j-1.7.22.jar
263304 Wed Jan 25 13:14:04 CET 2017 BOOT-INF/lib/spring-expression-4.3.6.RELEASE.jar
23647 Tue Dec 13 18:09:06 CET 2016 BOOT-INF/lib/log4j-over-slf4j-1.7.22.jar
1136805 Wed Jan 25 13:14:18 CET 2017 BOOT-INF/lib/spring-context-4.3.6.RELEASE.jar
1117842 Wed Jan 25 13:13:44 CET 2017 BOOT-INF/lib/spring-core-4.3.6.RELEASE.jar
1038200 Mon Jan 30 19:39:22 CET 2017 BOOT-INF/lib/spring-boot-autoconfigure-1.5.1.RELEASE.jar
305150 Fri Jan 20 19:58:16 CET 2017 BOOT-INF/lib/logback-classic-1.1.9.jar
273599 Fri Feb 19 13:13:32 CET 2016 BOOT-INF/lib/snakeyaml-1.17.jar
0 Sun Feb 19 07:07:38 CET 2017 org/
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/boot/
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/boot/loader/
2415 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/LaunchedURLClassLoader$1.class
1454 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class
1807 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class
4599 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/Launcher.class
1165 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/ExecutableArchiveLauncher$1.class
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/boot/loader/jar/
2002 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFile$1.class
9657 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/Handler.class
3350 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarEntry.class
1427 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFile$3.class
2943 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class
430 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/CentralDirectoryVisitor.class
1300 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFile$JarFileType.class
10924 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFileEntries.class
12697 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFile.class
1540 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFileEntries$1.class
672 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarURLConnection$1.class
1199 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFile$2.class
262 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarEntryFilter.class
4457 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/AsciiBytes.class
4602 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/CentralDirectoryParser.class
2169 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/Bytes.class
1629 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/ZipInflaterInputStream.class
1967 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class
306 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/FileHeader.class
3641 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class
9111 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/JarURLConnection.class
5449 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class
1704 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/PropertiesLauncher$FilteredArchive$1.class
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/boot/loader/data/
1531 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/data/ByteArrayRandomAccessData.class
3534 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class
2051 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/data/RandomAccessDataFile$FilePool.class
1341 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/data/RandomAccessData$ResourceAccess.class
3390 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/data/RandomAccessDataFile.class
551 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/data/RandomAccessData.class
4698 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/LaunchedURLClassLoader.class
1533 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/JarLauncher.class
1468 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/MainMethodRunner.class
2382 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/PropertiesLauncher$FilteredArchive.class
1382 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/PropertiesLauncher$1.class
3128 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/ExecutableArchiveLauncher.class
1669 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/WarLauncher.class
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/boot/loader/archive/
1749 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class
3792 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class
1068 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class
1051 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class
302 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/Archive$Entry.class
7016 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/JarFileArchive.class
4974 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/ExplodedArchive.class
906 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/Archive.class
1438 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class
399 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/Archive$EntryFilter.class
273 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/archive/ExplodedArchive$1.class
16109 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/PropertiesLauncher.class
0 Sun Feb 19 07:07:38 CET 2017 org/springframework/boot/loader/util/
4887 Mon Jan 30 19:26:16 CET 2017 org/springframework/boot/loader/util/SystemPropertyUtils.class
Your class is not in the jar. Or rather, it's under the BOOT-INF/classes/com/example directory instead of being under the com/example directory.
This jar file is not a jar file that can be used as a library. It's an uber jar file that has been created by the Spring-Boot plugin to contain all the dependencies and classes of your first app, along with a spring boot loader that uses a custom classloader to load the application classes and the dependencies from the uber jar.
If the jar shouldn't be a Spring boot app, but a simple library, then just don't use the Spring-Boot plugin in that project.
If it's supposed to be a library and a Spring Boot app at the same time (which is strange), then split it into two projects: one that produces a library, and a second one which is a Spring Boot app, contains just the main class of the app (and the other classes that shouldn't be in the library), and has the library as dependency.
Related
I am getting this error while i have added the dependecies required commons-codec.
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getPassword' in class com.soft.DbGenUtl threw exception class java.lang.NoClassDefFoundError : org.apache.commons.codec.binary.Base64
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:70)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
at org.apache.velocity.Template.merge(Template.java:256)
at com.cwsoft.tools.filegenerator.VelocityTemplateProcessor.process(VelocityTemplateProcessor.java:63)
at com.cwsoft.tools.filegenerator.FileGenerator.execute(FileGenerator.java:121)
at com.cwsoft.tools.filegenerator.ant.FileGenerateTask.execute(FileGenerateTask.java:41)
... 46 more
maven2/repository/local/org/apache/commons/codec/binary] ls -lrt
total 144
-rw-r----- 1 ppk ppkgroup 3119 Dec 20 2013 StringUtils.class
-rw-r----- 1 ppk ppkgroup 4356 Dec 20 2013 Hex.class
-rw-r----- 1 ppk ppkgroup 3252 Dec 20 2013 BinaryCodec.class
-rw-r----- 1 ppk ppkgroup 2372 Dec 20 2013 BaseNCodecOutputStream.class
-rw-r----- 1 ppk ppkgroup 3127 Dec 20 2013 BaseNCodecInputStream.class
-rw-r----- 1 ppk ppkgroup 5348 Dec 20 2013 BaseNCodec.class
-rw-r----- 1 ppk ppkgroup 1409 Dec 20 2013 BaseNCodec$Context.class
-rw-r----- 1 ppk ppkgroup 939 Dec 20 2013 Base64OutputStream.class
-rw-r----- 1 ppk ppkgroup 929 Dec 20 2013 Base64InputStream.class
-rw-r----- 1 ppk ppkgroup 9201 Dec 20 2013 Base64.class
-rw-r----- 1 ppk ppkgroup 939 Dec 20 2013 Base32OutputStream.class
-rw-r----- 1 ppk ppkgroup 929 Dec 20 2013 Base32InputStream.class
-rw-r----- 1 ppk ppkgroup 7605 Dec 20 2013 Base32.class
Could you please suggest what am I missing here?
Thanks.
I've been reading all similar problems with maven but I cannot seem to be able to fix it. The issue is the classic "Cannot resolve symbol 'pippo'", in which case pippo is part of
import com.pippo.device.manager.data.model.Device;
This class Device comes from this artifact that I have in my local repo
<dependency>
<groupId>com.pippo</groupId>
<artifactId>device.manager</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
Evidence that it is in the local repository
/mnt/c/Users/sanvegeta/.m2/repository$ find . -type f -name "*device.manager*" -ls
38228 -rwxrwxrwx 1 sanvegeta sanvegeta 39142700 Oct 1 09:00 ./com/pippo/device.manager/0.0.1-SNAPSHOT/device.manager-0.0.1-SNAPSHOT.jar
4 -rwxrwxrwx 1 sanvegeta sanvegeta 1969 Oct 1 08:47 ./com/pippo/device.manager/0.0.1-SNAPSHOT/device.manager-0.0.1-SNAPSHOT.pom
and evidence that this is the correct local repository
mvn help:evaluate -Dexpression=settings.localRepository | grep -v '\[INFO\]'
/mnt/c/Users/sanvegeta/.m2/repository
Just to give you a little bit of context: I'm working on a lab exercise and I created 2 microservices: com.pluto.user.manager and com.pippo.device.manager. They both expose CRUD REST API to work respectively on User and Device. Part of my exercise is to refer to the entity Device from another service (in this case from com.pluto.user.manager) so, in the user.manager, I created an API that is supposed to link the device to the user (it's just adding an id to the user, nothing serious). And the compiler complains. I even tried to create a docker container with jdk, maven and git, and tried to compile there: same problem.
The class where the error appears is the following
package com.pluto.user.manager.controller;
import com.pippo.device.manager.data.model.Device; // problem here
import com.pluto.user.manager.data.model.User;
import com.pluto.user.manager.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
#RestController
#RequestMapping("/users")
public class UserController {
#Autowired
private UserService userService;
// various CRUD API here
// ...
#PostMapping(path = "/{id}/link", consumes = "application/json", produces = "application/json")
public User link(#PathVariable String id, #RequestBody Device device) {
return userService.linkToDevice(id, device.getId());
}
}
Please, can you help me understand what am I doing wrong?
Edit 1: adding pom.xml of user.manager as requested
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.pluto</groupId>
<artifactId>user.manager</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>user.manager</name>
<description>User Manager Service</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.pippo</groupId>
<artifactId>device.manager</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${project.parent.version}</version>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
and the output of "mvn clean package"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building user.manager 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # user.manager ---
[INFO] Deleting /mnt/e/Repository/GCP/exercise1/user.manager/target
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # user.manager ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # user.manager ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to /mnt/e/Repository/GCP/exercise1/user.manager/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /mnt/e/Repository/GCP/exercise1/user.manager/src/main/java/com/pluto/user/manager/controller/UserController.java:[3,43] package com.pippo.device.manager.data.model does not exist
[ERROR] /mnt/e/Repository/GCP/exercise1/user.manager/src/main/java/com/pluto/user/manager/controller/UserController.java:[40,99] package com.pippo.device.manager.data.model does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.983 s
[INFO] Finished at: 2021-10-01T23:01:35+02:00
[INFO] Final Memory: 28M/100M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project user.manager: Compilation failure: Compilation failure:
[ERROR] /mnt/e/Repository/GCP/exercise1/user.manager/src/main/java/com/pluto/user/manager/controller/UserController.java:[3,43] package com.pippo.device.manager.data.model does not exist
[ERROR] /mnt/e/Repository/GCP/exercise1/user.manager/src/main/java/com/pluto/user/manager/controller/UserController.java:[40,99] package com.pippo.device.manager.data.model does not exist
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
and output of jar -tvf /mnt/c/Users/sanvegeta/.m2/repository/com/pippo/device.manager/0.0.1-SNAPSHOT/device.manager-0.0.1-SNAPSHOT.jar
0 Fri Oct 01 08:59:58 CEST 2021 META-INF/
467 Fri Oct 01 08:59:58 CEST 2021 META-INF/MANIFEST.MF
0 Fri Feb 01 00:00:00 CET 1980 org/
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/
5871 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/ClassPathIndexFile.class
6806 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/ExecutableArchiveLauncher.class
3966 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/JarLauncher.class
1483 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/LaunchedURLClassLoader$DefinePackageCallType.class
1535 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/LaunchedURLClassLoader$UseFastConnectionExceptionsEnumeration.class
11154 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/LaunchedURLClassLoader.class
5932 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/Launcher.class
1536 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/MainMethodRunner.class
266 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/PropertiesLauncher$1.class
1484 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class
8128 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/PropertiesLauncher$ClassPathArchives.class
1953 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class
18267 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/PropertiesLauncher.class
1750 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/WarLauncher.class
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/
302 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/Archive$Entry.class
511 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/Archive$EntryFilter.class
4745 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/Archive.class
6093 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/ExplodedArchive$AbstractIterator.class
2180 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/ExplodedArchive$ArchiveIterator.class
1857 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/ExplodedArchive$EntryIterator.class
1269 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class
2527 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/ExplodedArchive$SimpleJarFileArchive.class
5346 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/ExplodedArchive.class
2884 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/JarFileArchive$AbstractIterator.class
1981 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class
1081 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class
2528 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/JarFileArchive$NestedArchiveIterator.class
10349 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/archive/JarFileArchive.class
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/data/
485 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/data/RandomAccessData.class
282 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/data/RandomAccessDataFile$1.class
2680 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class
3259 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/data/RandomAccessDataFile$FileAccess.class
4015 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/data/RandomAccessDataFile.class
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/
1438 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/AbstractJarFile$JarFileType.class
878 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/AbstractJarFile.class
4976 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/AsciiBytes.class
616 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/Bytes.class
295 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryEndRecord$1.class
3319 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryEndRecord$Zip64End.class
2039 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryEndRecord$Zip64Locator.class
5029 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class
6889 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class
4624 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryParser.class
540 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/CentralDirectoryVisitor.class
345 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/FileHeader.class
13649 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/Handler.class
3885 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarEntry.class
1458 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarEntryCertification.class
299 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarEntryFilter.class
2299 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFile$1.class
1299 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFile$JarEntryEnumeration.class
16312 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFile.class
1368 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileEntries$1.class
2258 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class
1281 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileEntries$Offsets.class
1338 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileEntries$Zip64Offsets.class
1334 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileEntries$ZipOffsets.class
17280 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileEntries.class
3512 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarFileWrapper.class
702 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarURLConnection$1.class
4302 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class
9440 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/JarURLConnection.class
3559 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/StringSequence.class
1813 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jar/ZipInflaterInputStream.class
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jarmode/
293 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jarmode/JarMode.class
2201 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jarmode/JarModeLauncher.class
1292 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/jarmode/TestJarMode.class
0 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/util/
5174 Fri Feb 01 00:00:00 CET 1980 org/springframework/boot/loader/util/SystemPropertyUtils.class
0 Fri Oct 01 08:59:58 CEST 2021 BOOT-INF/
0 Fri Oct 01 08:59:58 CEST 2021 BOOT-INF/classes/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/controller/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/data/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/data/model/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/repository/
0 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/service/
0 Fri Oct 01 08:59:56 CEST 2021 META-INF/maven/
0 Fri Oct 01 08:59:56 CEST 2021 META-INF/maven/com.pippo/
0 Fri Oct 01 08:59:56 CEST 2021 META-INF/maven/com.pippo/device.manager/
804 Fri Oct 01 08:59:36 CEST 2021 BOOT-INF/classes/application.properties
737 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/Application.class
2433 Fri Oct 01 08:59:48 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/controller/DeviceController.class
1617 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/data/model/Device.class
364 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/repository/DeviceRepository.class
3530 Fri Oct 01 08:59:46 CEST 2021 BOOT-INF/classes/com/pippo/device/manager/service/DeviceService.class
1969 Fri Oct 01 08:47:32 CEST 2021 META-INF/maven/com.pippo/device.manager/pom.xml
67 Fri Oct 01 08:59:56 CEST 2021 META-INF/maven/com.pippo/device.manager/pom.properties
0 Fri Oct 01 08:59:58 CEST 2021 BOOT-INF/lib/
382204 Wed Sep 15 07:22:06 CEST 2021 BOOT-INF/lib/spring-aop-5.3.10.jar
2087074 Fri Feb 01 00:00:00 CET 1980 BOOT-INF/lib/aspectjweaver-1.9.7.jar
159222 Wed Mar 03 13:06:58 CET 2021 BOOT-INF/lib/HikariCP-4.0.3.jar
427946 Wed Sep 15 07:22:12 CEST 2021 BOOT-INF/lib/spring-jdbc-5.3.10.jar
15392 Fri Aug 02 22:14:54 CEST 2019 BOOT-INF/lib/jakarta.transaction-api-1.3.3.jar
164392 Fri Aug 02 16:59:46 CEST 2019 BOOT-INF/lib/jakarta.persistence-api-2.2.3.jar
7351256 Mon May 24 12:01:22 CEST 2021 BOOT-INF/lib/hibernate-core-5.4.32.Final.jar
60911 Tue May 25 13:11:32 CEST 2021 BOOT-INF/lib/jboss-logging-3.4.2.Final.jar
782774 Thu Mar 19 13:33:58 CET 2020 BOOT-INF/lib/javassist-3.27.0-GA.jar
3510658 Tue Mar 09 15:35:56 CET 2021 BOOT-INF/lib/byte-buddy-1.10.22.jar
445288 Wed Sep 06 11:15:04 CEST 2006 BOOT-INF/lib/antlr-2.7.7.jar
202552 Fri Jan 22 15:15:02 CET 2021 BOOT-INF/lib/jandex-2.2.3.Final.jar
67815 Sat Oct 19 22:46:30 CEST 2019 BOOT-INF/lib/classmate-1.5.1.jar
323630 Sun Apr 12 12:05:40 CEST 2020 BOOT-INF/lib/dom4j-2.1.3.jar
78948 Fri Oct 30 16:06:46 CET 2020 BOOT-INF/lib/hibernate-commons-annotations-5.1.2.Final.jar
1019255 Tue Jul 20 13:39:34 CEST 2021 BOOT-INF/lib/jaxb-runtime-2.3.5.jar
72008 Tue Jul 20 13:39:08 CEST 2021 BOOT-INF/lib/txw2-2.3.5.jar
29807 Thu Mar 18 15:25:56 CET 2021 BOOT-INF/lib/istack-commons-runtime-3.0.12.jar
68453 Thu Feb 20 18:37:08 CET 2020 BOOT-INF/lib/jakarta.activation-1.2.2.jar
375623 Fri Sep 17 09:20:56 CEST 2021 BOOT-INF/lib/spring-data-jpa-2.5.5.jar
1260499 Fri Sep 17 09:19:30 CEST 2021 BOOT-INF/lib/spring-data-commons-2.5.5.jar
204085 Wed Sep 15 07:22:22 CEST 2021 BOOT-INF/lib/spring-orm-5.3.10.jar
1267911 Wed Sep 15 07:22:10 CEST 2021 BOOT-INF/lib/spring-context-5.3.10.jar
333421 Wed Sep 15 07:22:10 CEST 2021 BOOT-INF/lib/spring-tx-5.3.10.jar
696648 Wed Sep 15 07:22:04 CEST 2021 BOOT-INF/lib/spring-beans-5.3.10.jar
41513 Tue Jul 20 13:56:20 CEST 2021 BOOT-INF/lib/slf4j-api-1.7.32.jar
47229 Wed Sep 15 07:22:24 CEST 2021 BOOT-INF/lib/spring-aspects-5.3.10.jar
1392938 Thu Sep 23 07:11:26 CEST 2021 BOOT-INF/lib/spring-boot-2.5.5.jar
1564860 Thu Sep 23 07:10:20 CEST 2021 BOOT-INF/lib/spring-boot-autoconfigure-2.5.5.jar
292027 Fri Sep 10 00:27:02 CEST 2021 BOOT-INF/lib/logback-classic-1.2.6.jar
472431 Fri Sep 10 00:15:50 CEST 2021 BOOT-INF/lib/logback-core-1.2.6.jar
17762 Sat Mar 06 22:13:24 CET 2021 BOOT-INF/lib/log4j-to-slf4j-2.14.1.jar
300365 Sat Mar 06 22:11:34 CET 2021 BOOT-INF/lib/log4j-api-2.14.1.jar
4589 Tue Jul 20 13:55:30 CEST 2021 BOOT-INF/lib/jul-to-slf4j-1.7.32.jar
25058 Fri Aug 02 11:08:52 CEST 2019 BOOT-INF/lib/jakarta.annotation-api-1.3.5.jar
326914 Mon Feb 22 05:55:56 CET 2021 BOOT-INF/lib/snakeyaml-1.28.jar
1515991 Fri Aug 27 00:33:48 CEST 2021 BOOT-INF/lib/jackson-databind-2.12.5.jar
75704 Thu Aug 26 23:31:22 CEST 2021 BOOT-INF/lib/jackson-annotations-2.12.5.jar
365536 Thu Aug 26 23:57:50 CEST 2021 BOOT-INF/lib/jackson-core-2.12.5.jar
34438 Fri Aug 27 01:10:42 CEST 2021 BOOT-INF/lib/jackson-datatype-jdk8-2.12.5.jar
120362 Fri Aug 27 01:10:24 CEST 2021 BOOT-INF/lib/jackson-datatype-jsr310-2.12.5.jar
9440 Fri Aug 27 01:10:34 CEST 2021 BOOT-INF/lib/jackson-module-parameter-names-2.12.5.jar
3429357 Mon Sep 06 23:09:00 CEST 2021 BOOT-INF/lib/tomcat-embed-core-9.0.53.jar
255802 Mon Sep 06 23:09:00 CEST 2021 BOOT-INF/lib/tomcat-embed-el-9.0.53.jar
277386 Mon Sep 06 23:09:00 CEST 2021 BOOT-INF/lib/tomcat-embed-websocket-9.0.53.jar
1633568 Wed Sep 15 07:22:16 CEST 2021 BOOT-INF/lib/spring-web-5.3.10.jar
1027620 Wed Sep 15 07:22:26 CEST 2021 BOOT-INF/lib/spring-webmvc-5.3.10.jar
288281 Wed Sep 15 07:22:04 CEST 2021 BOOT-INF/lib/spring-expression-5.3.10.jar
93107 Tue Dec 19 16:23:24 CET 2017 BOOT-INF/lib/validation-api-2.0.1.Final.jar
2303679 Mon Oct 14 09:19:50 CEST 2019 BOOT-INF/lib/h2-1.4.200.jar
115638 Mon Jan 27 09:34:38 CET 2020 BOOT-INF/lib/jakarta.xml.bind-api-2.3.3.jar
46613 Thu Feb 20 18:37:30 CET 2020 BOOT-INF/lib/jakarta.activation-api-1.2.2.jar
1479606 Fri Feb 01 00:00:00 CET 1980 BOOT-INF/lib/spring-core-5.3.10.jar
24436 Wed Sep 15 07:21:48 CEST 2021 BOOT-INF/lib/spring-jcl-5.3.10.jar
29277 Fri Feb 01 00:00:00 CET 1980 BOOT-INF/lib/spring-boot-jarmode-layertools-2.5.5.jar
2403 Fri Oct 01 09:00:00 CEST 2021 BOOT-INF/classpath.idx
212 Fri Oct 01 09:00:00 CEST 2021 BOOT-INF/layers.idx
Edit 2 (closer to the resolution)
As Stephen suggested, the internal structure of the generated jar file seems wrong. I crafted an alternative jar file with the paths that don't start with BOOT-INF/classes, and the user.manager service compiles and runs just fine.
Now the question is: how do I instruct spring boot to either generate the correct structure or to "see" the classes?
I think you have the wrong dependency. By my reading of the jar -tf output, that looks like a SpringBoot executable JAR file. The Device.class file is there, but its path is not right ... for a normal Java compiler to resolve it:
This:
BOOT-INF/classes/com/pippo/device/manager/data/model/Device.class
needs to be this:
com/pippo/device/manager/data/model/Device.class
I can't find any trace of "com.pippo.*" using Google, so I am guessing that this is a private project.
But if you want use the com.pippo.device.manager classes in other modules, you need to modify its POM file to generate a regular JAR, and use that as the dependency.
One suggestion would be to refactor the existing com.pippo / device.manager project into a SpringBoot project and a (new) regular "library" JAR project, with the former depending on the latter. Put the classes that you want to reuse in com.pluto / project.manager into the "library" project.
How do you run beeline on local machine once you've downloaded the jar files?
According to this answer (for Ubuntu), you don't need to do a complete install of Hive to run the beeline CLI. You just need to download the relevant jars.
To determine the files to download for the beeline CLI, I've followed the instructions here, and created a script to run in Git Bash:
https://learn.microsoft.com/en-in/azure/hdinsight/hadoop/apache-hadoop-connect-hive-jdbc-driver#connect-with-squirrel-sql-client
#!/bin/bash
# References:
# -----------
#
# Insert multi-line string into a file
# https://stackoverflow.com/a/23929367/893766
#
# Setup ssh programatically
# https://stackoverflow.com/a/3659691/893766
# https://superuser.com/a/411991/174619
# https://www.digitalocean.com/community/questions/new-ssh-key-for-a-new-different-user?answer=38759
# https://superuser.com/a/1052675/174619
#
# Relevant files to copy from cluster for hive drivers
# https://learn.microsoft.com/en-in/azure/hdinsight/hadoop/apache-hadoop-connect-hive-jdbc-driver#connect-with-squirrel-sql-client
#
# Loop through array of strings
# https://stackoverflow.com/a/8880633/893766
#
#
# Helpful commands
# ----------------
#
# Copy and paste into terminal and run to generate removal command
# echo "ssh hive ${SSH_HOSTNAME} \"sed -i.bak '/${USERNAME}#${HOSTNAME}/d' ~/.ssh/authorized_keys\""
# control variables
echo "------------------------------------------------------------------------"
echo "SETTING CONTROL VARIABLES"
echo
echo "..."
HDINSIGHT_CLUSTER_NAME="<CLUSTERNAME>.azurehdinsight.net"
HDINSIGHT_USER_NAME="sshuser"
SSH_HOST_NAME="hive"
SSH_KEY_PATH=~/.ssh/"${SSH_HOST_NAME}"
LOCAL_HIVE_DIR="/c/ProgramData/hive"
SSH_CONFIG_PATH=~/.ssh/config
SSH_CONFIG="Host ${SSH_HOST_NAME}
Hostname ${HDINSIGHT_CLUSTER_NAME}
User ${HDINSIGHT_USER_NAME}
IdentityFile ${SSH_KEY_PATH}
"
declare -a FILE_GLOBS=(
"/usr/hdp/current/hadoop-client/hadoop-common.jar"
"/usr/hdp/current/hadoop-client/hadoop-auth.jar"
"/usr/hdp/current/hadoop-client/lib/log4j-*.jar"
"/usr/hdp/current/hadoop-client/lib/slf4j-*.jar"
"/usr/hdp/current/hive-client/lib/hive-*-1.2*.jar"
"/usr/hdp/current/hive-client/lib/httpclient-*.jar"
"/usr/hdp/current/hive-client/lib/httpcore-*.jar"
"/usr/hdp/current/hive-client/lib/libthrift-*.jar"
"/usr/hdp/current/hive-client/lib/libfb*.jar"
"/usr/hdp/current/hive-client/lib/commons-logging-*.jar"
)
echo
# create ssh key for hive access
echo "------------------------------------------------------------------------"
echo "CREATING SSH KEY"
echo
yes "y" | ssh-keygen -t rsa -N "" -f ${SSH_KEY_PATH}
echo
# add hive ssh config for easier use in the terminal
echo "------------------------------------------------------------------------"
echo "SETTING SSH CONFIG FOR NEW KEY"
echo
echo -e "${SSH_CONFIG}" | tee ${SSH_CONFIG_PATH}
echo
# copy ssh key to edge node
echo "------------------------------------------------------------------------"
echo "COPYING SSH KEY TO EDGE NODE FOR SECURE PASSWORD-LESS ACCESS"
echo
ssh-copy-id -i ${SSH_KEY_PATH} $HDINSIGHT_USER_NAME#$HDINSIGHT_CLUSTER_NAME
echo
# create local directory for hive drivers
echo "------------------------------------------------------------------------"
echo "CREATING DIRECTORY FOR HIVE DRIVERS"
echo
mkdir -p -v ${LOCAL_HIVE_DIR}
echo
# download hive drivers from edge node to local directory
echo "------------------------------------------------------------------------"
echo "DOWNLOADING HIVE DRIVERS TO:"
echo "\t${LOCAL_HIVE_DIR}"
echo
for glob in "${FILE_GLOBS[#]}"
do
echo "Processing glob: ${glob}"
echo -e "\tscp -p ${SSH_HOST_NAME}:${glob} ${LOCAL_HIVE_DIR}"
scp -p ${SSH_HOST_NAME}:"${glob}" ${LOCAL_HIVE_DIR}
echo
done
echo
# inform user of ssh usage
echo "------------------------------------------------------------------------"
echo "OUTPUT"
echo -e "
Command to connect to edge node:
ssh ${SSH_HOST_NAME}
Hive drivers installed at:
${LOCAL_HIVE_DIR}
To configure JDBC clients visit:
https://learn.microsoft.com/en-us/azure/hdinsight/hadoop/apache-hadoop-connect-hive-jdbc-driver
Use the 'beeline' commandline client for submitting and debugging scripts:
https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Beeline%E2%80%93CommandLineShell!quit
ssh key location:
${SSH_KEY_PATH}
ssh config location:
${SSH_CONFIG_PATH}
view authorised ssh keys on the edge node with the following command:
ssh ${SSH_HOST_NAME} \"cat ~/.ssh/authorized_keys\"
you can remove your ssh key from the edge node with the following command:
ssh ${SSH_HOST_NAME} \"sed -i.bak '/${USERNAME}#${HOSTNAME}/d' ~/.ssh/authorized_keys\"
"
echo
echo "Driver installation script has finished running"
This downloaded the following files:
$ ls -la /c/ProgramData/hive
total 56204
drwxr-xr-x 1 adria 197609 0 Feb 26 15:01 .
drwxr-xr-x 1 adria 197609 0 Feb 26 16:20 ..
-rw-r--r-- 1 adria 197609 62050 Apr 3 2017 commons-logging-1.1.3.jar
-rw-r--r-- 1 adria 197609 79075 Apr 4 2017 hadoop-auth.jar
-rw-r--r-- 1 adria 197609 3604047 Apr 4 2017 hadoop-common.jar
-rw-r--r-- 1 adria 197609 122837 Apr 4 2017 hive-accumulo-handler-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 49706 Apr 4 2017 hive-ant-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 144508 Apr 4 2017 hive-beeline-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 40077 Apr 4 2017 hive-cli-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 342718 Apr 4 2017 hive-common-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 122723 Apr 4 2017 hive-contrib-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 21703871 Apr 4 2017 hive-exec-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 118706 Apr 4 2017 hive-hbase-handler-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 29113 Apr 4 2017 hive-hwi-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 106388 Apr 4 2017 hive-jdbc-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 19636098 Apr 4 2017 hive-jdbc-1.2.1000.2.5.4.2-7-standalone.jar
-rw-r--r-- 1 adria 197609 6057211 Apr 4 2017 hive-metastore-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 924634 Apr 4 2017 hive-serde-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 1983806 Apr 4 2017 hive-service-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 32386 Apr 4 2017 hive-shims-0.20S-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 62039 Apr 4 2017 hive-shims-0.23-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 10419 Apr 4 2017 hive-shims-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 112764 Apr 4 2017 hive-shims-common-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 13562 Apr 4 2017 hive-shims-scheduler-1.2.1000.2.5.4.2-7.jar
-rw-r--r-- 1 adria 197609 719304 Apr 3 2017 httpclient-4.4.jar
-rw-r--r-- 1 adria 197609 321639 Apr 3 2017 httpcore-4.4.jar
-rw-r--r-- 1 adria 197609 313702 Apr 3 2017 libfb303-0.9.3.jar
-rw-r--r-- 1 adria 197609 234201 Apr 3 2017 libthrift-0.9.3.jar
-rw-r--r-- 1 adria 197609 489884 Apr 4 2017 log4j-1.2.17.jar
-rw-r--r-- 1 adria 197609 32119 Apr 4 2017 slf4j-api-1.7.10.jar
-rw-r--r-- 1 adria 197609 8866 Apr 4 2017 slf4j-log4j12-1.7.10.jar
Java info:
$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode, sharing)
$ which java
/c/ProgramData/Oracle/Java/javapath/java
Now comes the part I have no idea about...
How do you run beeline on local machine once you've downloaded the jar files?
What I've tried
$ cd /c/ProgramData/hive
$ java hive-beeline-1.2.1000.2.5.4.2-7.jar
Error: Could not find or load main class hive-beeline-1.2.1000.2.5.4.2-7.jar
$ java -jar hive-beeline-1.2.1000.2.5.4.2-7.jar
no main manifest attribute, in hive-beeline-1.2.1000.2.5.4.2-7.jar
$ java -cp /c/ProgramData/hive -jar hive-beeline-1.2.1000.2.5.4.2-7.jar
no main manifest attribute, in hive-beeline-1.2.1000.2.5.4.2-7.jar
UPDATE #1
I've uninstalled the JRE 8 and installed JDK 9
$ echo $JAVA_HOME
C:\Program Files\Java\jdk-9.0.4\bin
$ java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
$ which java
/c/Program Files/Java/jdk-9.0.4/bin/java
$ javac -version
javac 9.0.4
Contents of the beeline jar are as follows:
$ jar tvf hive-beeline-1.2.1000.2.5.4.2-7.jar
0 Tue Apr 04 12:16:28 AEST 2017 META-INF/
436 Tue Apr 04 12:16:26 AEST 2017 META-INF/MANIFEST.MF
0 Tue Apr 04 12:16:26 AEST 2017 org/
0 Tue Apr 04 12:16:26 AEST 2017 org/apache/
0 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/
0 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/
0 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/util/
9839 Tue Apr 04 12:16:26 AEST 2017 BeeLine.properties
1139 Tue Apr 04 12:16:26 AEST 2017 beeline-log4j.properties
164 Tue Apr 04 12:16:26 AEST 2017 META-INF/NOTICE
11358 Tue Apr 04 12:16:26 AEST 2017 META-INF/LICENSE
27286 Tue Apr 04 12:16:26 AEST 2017 META-INF/DEPENDENCIES
2308 Tue Apr 04 12:16:26 AEST 2017 sql-keywords.properties
4658 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/Reflector.class
2767 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/AbstractCommandHandler.class
1196 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineCompleter.class
38069 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/Commands.class
5901 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/ColorBuffer.class
1790 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/XMLElementOutputFormat.class
1007 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DatabaseConnection$Schema$Table.class
2309 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineCommandCompleter.class
1973 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/ReflectiveCommandHandler.class
264 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineOpts$Env.class
2026 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/Commands$1.class
894 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DriverInfo.class
4785 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper.class
181 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/OutputFormat.class
2382 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$OracleCommandParser.class
1522 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$NestedScriptParser$CommandType.class
669 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/Commands$2.class
4188 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/SeparatedValuesOutputFormat.class
2671 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DatabaseConnection$Schema.class
902 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$NestedScriptParser.class
2532 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/Rows$Row.class
1128 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/AbstractOutputFormat.class
1219 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLine$1.class
194 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineSignalHandler.class
17720 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaTool.class
16547 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineOpts.class
395 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineOpts$Ignore.class
2490 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/IncrementalRows.class
3181 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/Rows.class
2599 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$DerbyCommandParser.class
4112 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/TableOutputFormat.class
2289 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DeprecatedSeparatedValuesOutputFormat.class
1209 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/OutputFile.class
1075 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/TableNameCompletor.class
2207 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/util/QFileClient$RegexFilterSet.class
242 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/util/QFileClient$1.class
9552 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/util/QFileClient.class
1059 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/SunSignalHandler.class
1912 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/XMLAttributeOutputFormat.class
431 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BooleanCompleter.class
1289 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DatabaseConnection$1.class
2928 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$PostgresCommandParser.class
1792 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLine$BeelineParser.class
4068 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$AbstractCommandParser.class
598 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/ColorBuffer$ColorAttr.class
2220 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/VerticalOutputFormat.class
4011 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/SQLCompleter.class
2279 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BufferedRows.class
9246 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DatabaseConnection.class
1807 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DatabaseConnections.class
2370 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$MSSQLCommandParser.class
873 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/DatabaseConnection$Schema$Table$Column.class
663 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLineOpts$1.class
2195 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$AzureDBCommandParser.class
2792 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/HiveSchemaHelper$MySqlCommandParser.class
6656 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/ClassNameCompleter.class
47773 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/BeeLine.class
467 Tue Apr 04 12:16:26 AEST 2017 org/apache/hive/beeline/CommandHandler.class
0 Tue Apr 04 12:16:28 AEST 2017 META-INF/maven/
0 Tue Apr 04 12:16:28 AEST 2017 META-INF/maven/org.apache.hive/
0 Tue Apr 04 12:16:28 AEST 2017 META-INF/maven/org.apache.hive/hive-beeline/
5422 Tue Apr 04 12:08:16 AEST 2017 META-INF/maven/org.apache.hive/hive-beeline/pom.xml
125 Tue Apr 04 12:16:26 AEST 2017 META-INF/maven/org.apache.hive/hive-beeline/pom.properties
I have zmq.jar built by someone else long time ago. How can I find out which version it corresponds to?
Not much in the MANIFEST:
$ cat MANIFEST.MF
Manifest-Version: 1.0
Created-By: 1.6.0_14 (Sun Microsystems Inc.)
Here's the contents. Would someone be able to tell whether it's 2.x or 3.x?
$ jar tvf zmq.jar
0 Thu Feb 02 14:59:52 EST 2012 META-INF/
71 Thu Feb 02 14:59:52 EST 2012 META-INF/MANIFEST.MF
2429 Wed Feb 01 14:24:32 EST 2012 org/zeromq/App.class
4320 Tue Jan 24 14:40:32 EST 2012 org/zeromq/EmbeddedLibraryTools.class
2392 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZContext.class
3536 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZFrame.class
920 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQ$Context.class
2401 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQ$Error.class
3232 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQ$Poller.class
5613 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQ$Socket.class
2484 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQ.class
771 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQException.class
1468 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQForwarder.class
1663 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQQueue.class
424 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMQStreamer.class
9771 Tue Jan 24 14:40:32 EST 2012 org/zeromq/ZMsg.class
Just ask for the version!
import org.zeromq.ZMQ;
public class ZMQVersion {
public static void main (String[] args) {
System.out.println(
String.format("Version string: %s, Version int: %d",
ZMQ.getVersionString(),
ZMQ.getFullVersion()));
}
}
Naive question, but this is my first step in JSF, so forgive me ;-)
I am following all the steps of the first example from "Core JavaServerFaces" by David Geary, Cay S. Horstmann (the 3rd edition).
What works in general:
java works
glassfish works
I can compile the attached code
I can create .war file
The problem begins when I copy the war file into autodeploy subdirectory of GlassFish and try to show the appropriate page in GF. In return I get 404 error and in logs I find this:
Selecting file /opt/glassfish3/glassfish/domains/domain1/autodeploy/login.war for autodeployment.
Module type not recognized for module /opt/glassfish3/glassfish/domains/domain1/applications/login
There is no installed container capable of handling this application login
Autodeploy failed : /opt/glassfish3/glassfish/domains/domain1/autodeploy/login.war.
glassfish 3.1.2, java 1.6.0_29, opensuse 11.4.
The question is how to make this code work?
Updates
jar tvf login.war
0 Thu Apr 12 22:24:24 CEST 2012 META-INF/
71 Thu Apr 12 22:24:24 CEST 2012 META-INF/MANIFEST.MF
0 Mon Jun 27 10:13:54 CEST 2011 src/
0 Mon Jun 27 10:13:54 CEST 2011 src/java/
0 Mon Jun 27 10:13:54 CEST 2011 src/java/com/
0 Thu Apr 12 22:16:32 CEST 2012 src/java/com/corejsf/
603 Thu Apr 12 22:16:32 CEST 2012 src/java/com/corejsf/UserBean.java
0 Mon Jun 27 10:13:54 CEST 2011 web/
0 Thu Apr 12 21:24:56 CEST 2012 web/WEB-INF/
877 Mon Jun 27 10:13:54 CEST 2011 web/WEB-INF/web.xml
0 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/
0 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/com/
0 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/com/corejsf/
704 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/com/corejsf/UserBean.class
0 Mon Jun 27 10:13:54 CEST 2011 web/WEB-INF/beans.xml
786 Mon Jun 27 10:13:54 CEST 2011 web/index.xhtml
394 Mon Jun 27 10:13:54 CEST 2011 web/welcome.xhtml
Your WAR file is broken.
Package it up in the web folder instead. WEB-INF should be in the root.