Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoClassDefFoundError: joda... #706

Closed
tkruse opened this issue Feb 13, 2017 · 7 comments
Closed

NoClassDefFoundError: joda... #706

tkruse opened this issue Feb 13, 2017 · 7 comments

Comments

@tkruse
Copy link

tkruse commented Feb 13, 2017

Description

On mvn docker:run, tasks succeed, but output is:

# using d-m-p 1.17.1
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/joda/time/format/ISODateTimeFormat$Constants
        at org.joda.time.format.ISODateTimeFormat.dateTime(ISODateTimeFormat.java:773)
        at io.fabric8.maven.docker.util.Timestamp.<init>(Timestamp.java:60)
# using d-m-p 1.19.1
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/joda/time/format/DateTimeFormatterBuilder$Fraction
        at org.joda.time.format.DateTimeFormatterBuilder.appendFraction(DateTimeFormatterBuilder.java:579)

As my container is started, this might only happen when there is a problem with starting the given container.

Info

  • d-m-p version : 1.19.1 (also 1.17.1)
  • Maven version (mvn -v) : 3.3.9
  • Docker version : 1.12.5
<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<configuration>
					<verbose>true</verbose>
					<showLogs>true</showLogs>
					<images>
						<image>
							<name>%g/attributesetdb</name>
							<alias>attributesetdb</alias>
							<build>
<dockerFileDir>${project.basedir}/dockerfiles/mysql</dockerFileDir>
							</build>
							<run>
								<ports>
									<port>13306:3306</port>
									<port>20023:22</port>
								</ports>
							</run>
						</image>
					</images>
				</configuration>
			</plugin>

Dockerfile:

FROM mysql:5.7

Note that This docker definition is probably invalid, I am in the process of debugging it. This issue though is not about the failure to start a container, but about the joda-time exception.

@rhuss
Copy link
Collaborator

rhuss commented Feb 14, 2017

Could you check you local Maven repository ? I.e. the directory ~/.m2/repository/joda-time/joda-time/2.9.4 ?

It should look like

ls -l ~/.m2/repository/joda-time/joda-time/2.9.4
total 1320
-rw-r--r--  1 roland  staff     192 May 30  2016 _remote.repositories
-rw-r--r--  1 roland  staff  629506 May 30  2016 joda-time-2.9.4.jar
-rw-r--r--  1 roland  staff      40 May 30  2016 joda-time-2.9.4.jar.sha1
-rw-r--r--  1 roland  staff   30145 May 30  2016 joda-time-2.9.4.pom
-rw-r--r--  1 roland  staff      40 May 30  2016 joda-time-2.9.4.pom.sha1

I suspect that you jar is defect, (or you overwrite the plugin dependencies somehow in your pom.xml), because this error has never occurred before but if its a fundamental issue should occur every time.

@llorllale
Copy link

Had this same issue. The build consistently failed with NoClassDefFoundError with some class from joda-time, although the exact class in question would vary. Solved it by deleting the cached copy from my .m2 and running the build again (thereby prompting maven to download it again).

@tkruse
Copy link
Author

tkruse commented Nov 5, 2017

sorry, losttrack of this, too late to reproduce by now. feel free to close.

@rhuss
Copy link
Collaborator

rhuss commented Nov 5, 2017

Thanks for coming back. If it occurs again, feel free to open a new issue.

@rhuss rhuss closed this as completed Nov 5, 2017
@jakaarl
Copy link

jakaarl commented Oct 21, 2019

This is still very much an issue with 0.31.0. I tried removing joda-time from my local repo, which resulted in my build pulling in version 2.9.9 of joda-time. Build claims success, but then throws:

Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/joda/time/format/DateTimeFormatterBuilder$StringLiteral
	at org.joda.time.format.DateTimeFormatterBuilder.appendLiteral(DateTimeFormatterBuilder.java:418)
	at org.joda.time.format.ISODateTimeFormat$Constants.weekElement(ISODateTimeFormat.java:1927)
	at org.joda.time.format.ISODateTimeFormat$Constants.<clinit>(ISODateTimeFormat.java:1252)
	at org.joda.time.format.ISODateTimeFormat.dateTime(ISODateTimeFormat.java:773)
	at io.fabric8.maven.docker.util.Timestamp.<init>(Timestamp.java:60)
	at io.fabric8.maven.docker.access.log.LogRequestor.callLogCallback(LogRequestor.java:199)
	at io.fabric8.maven.docker.access.log.LogRequestor.readStreamFrame(LogRequestor.java:172)
	at io.fabric8.maven.docker.access.log.LogRequestor.parseResponse(LogRequestor.java:185)
	at io.fabric8.maven.docker.access.log.LogRequestor.run(LogRequestor.java:103)
	Suppressed: java.lang.NoClassDefFoundError: jnr/constants/platform/Errno
		at jnr.enxio.channels.Native.read(Native.java:102)
		at jnr.unixsocket.impl.Common.read(Common.java:50)
		at jnr.unixsocket.impl.AbstractNativeSocketChannel.read(AbstractNativeSocketChannel.java:65)
		at jnr.unixsocket.UnixSocketChannel.read(UnixSocketChannel.java:250)

@jakaarl
Copy link

jakaarl commented Oct 21, 2019

I tried up- and downgrading joda-time, to no avail. FYI, running Java 12.

@jakaarl
Copy link

jakaarl commented Oct 21, 2019

Removing the log from my wait does make the stack trace disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants