I am following Jeff Tutorial series. I followed the steps as in http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html.
Since I do not have a free 8080 port, I gave the below mentioned commands for repo and share respectively
mvn integration-test -Pamp-to-war -Dmaven.tomcat.port=8081,
mvn integration-test -Pamp-to-war -Dmaven.tomcat.port=8082,
However, I get this error when I launch the URL: http://localhost:8082/share/page
Your authentication details have not been recognized or Alfresco may not be available at this time.
Below are the stack trace and the share-config-custom.xml
Stack:
at freemarker.core.Environment.visit(Environment.java:341)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:136)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.IfBlock.accept(IfBlock.java:84)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.visit(Environment.java:487)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Macro$Context.runMacro(Macro.java:209)
at freemarker.core.Environment.visit(Environment.java:694)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.process(Environment.java:243)
at org.springframework.extensions.webscripts.processor.FTLTemplateProces
sor.process(FTLTemplateProcessor.java:171)
at org.springframework.extensions.webscripts.WebTemplateProcessor.execut
eBody(WebTemplateProcessor.java:438)
at org.springframework.extensions.surf.render.AbstractProcessor.execute(
AbstractProcessor.java:57)
at org.springframework.extensions.surf.render.RenderService.processTempl
ate(RenderService.java:720)
at org.springframework.extensions.surf.render.bean.TemplateInstanceRende
rer.body(TemplateInstanceRenderer.java:140)
at org.springframework.extensions.surf.render.AbstractRenderer.render(Ab
stractRenderer.java:77)
at org.springframework.extensions.surf.render.bean.PageRenderer.body(Pag
eRenderer.java:85)
at org.springframework.extensions.surf.render.AbstractRenderer.render(Ab
stractRenderer.java:77)
at org.springframework.extensions.surf.render.RenderService.renderPage(R
enderService.java:761)
at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageVie
w.java:411)
at org.alfresco.web.site.SlingshotPageView.dispatchPage(SlingshotPageVie
w.java)
at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.
java:250)
at org.alfresco.web.site.SlingshotPageView.renderView(SlingshotPageView.
java)
at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.rend
erMergedOutputModel(AbstractWebFrameworkView.java:316)
at org.alfresco.web.site.SlingshotPageView.renderMergedOutputModel(Sling
shotPageView.java)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView
.java:264)
at org.alfresco.web.site.SlingshotPageView.render(SlingshotPageView.java
)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherSe
rvlet.java:1201)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResu
lt(DispatcherServlet.java:986)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
erServlet.java:933)
at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:851)
at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
workServlet.java:953)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServl
et.java:844)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkSer
vlet.java:829)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51
)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthe
nticationFilter.java:74)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.alfresco.web.site.servlet.SecurityHeadersFilter.doFilter(Security
HeadersFilter.java:168)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.alfresco.web.site.servlet.CSRFFilter.doFilter(CSRFFilter.java:322
)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAut
henticationFilter.java:394)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocke
t(PlainConnectionSocketFactory.java:72)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpCl
ientConnectionOperator.java:117)
... 149 more
Terminate batch job (Y/N)?
^C
D:\Code_Home\wksp-alfresco-5.0\content-tutorial-share>mvn integration-test -Pamp
-to-war -Dmaven.tomcat.port=8082
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building content-tutorial-share AMP project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- alfresco-maven-plugin:2.0.0:set-version (default-set-version) # conte
nt-tutorial-share ---
[INFO] Removed -SNAPSHOT suffix from version - 1.0
[INFO] Added timestamp to version - 1.0.1511251415
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:add-test-resource (add-env-test-prope
rties) # content-tutorial-share ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # content-tu
torial-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 10 resources to ../content-tutorial-share
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # content-tutoria
l-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # co
ntent-tutorial-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] skip non existing resourceDirectory D:\Code_Home\wksp-alfresco-5.0\conten
t-tutorial-share\src\test\properties\local
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (add-module-properties-to-t
est-classpath) # content-tutorial-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to alfresco/module/content-tutorial-share
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (add-module-config-to-test-
classpath) # content-tutorial-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) # content
-tutorial-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18:test (default-test) # content-tutorial-sha
re ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-dependency-plugin:2.9:unpack (unpack-alfresco) # content-tutori
al-share ---
[INFO] Configured Artifact: org.alfresco:share:5.0.c:war
[INFO] Unpacking C:\Users\pa832358\.m2\repository\org\alfresco\share\5.0.c\share
-5.0.c.war to D:\Code_Home\wksp-alfresco-5.0\content-tutorial-share\target\conte
nt-tutorial-share-war with includes "" and excludes ""
[INFO]
[INFO] --- alfresco-maven-plugin:2.0.0:amp (default-amp) # content-tutorial-shar
e ---
[INFO] Building jar: D:\Code_Home\wksp-alfresco-5.0\content-tutorial-share\targe
t\content-tutorial-share\lib\content-tutorial-share.jar
[INFO] Adding directory to AMP package [ 'D:\Code_Home\wksp-alfresco-5.0\content
-tutorial-share\target\content-tutorial-share' '']
[INFO] Building amp: D:\Code_Home\wksp-alfresco-5.0\content-tutorial-share\targe
t\content-tutorial-share.amp
[INFO]
[INFO] --- alfresco-maven-plugin:2.0.0:install (amps-to-war-overlay) # content-t
utorial-share ---
- WARNING: The file '/WEB-INF/lib/slf4j-api-1.7.5.jar' is being overwritten b
y this module. The original has been backed-up to '/WEB-INF/classes/alfresco/mod
ule/backup/76c4c8ea-9351-11e5-b6d7-15ae7dccbdeb.bin'
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (run-embedded) > process-classes # conte
nt-tutorial-share >>>
[INFO]
[INFO] --- alfresco-maven-plugin:2.0.0:set-version (default-set-version) # conte
nt-tutorial-share ---
[INFO] Removed -SNAPSHOT suffix from version - 1.0
[INFO] Added timestamp to version - 1.0.1511251419
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:add-test-resource (add-env-test-prope
rties) # content-tutorial-share ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # content-tu
torial-share ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 10 resources to ../content-tutorial-share
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) # content-tutoria
l-share ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (run-embedded) < process-classes # conte
nt-tutorial-share <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (run-embedded) # content-tutorial-share
---
[INFO] Running war on http://localhost:8082/content-tutorial-share
[INFO] Creating Tomcat server configuration at D:\Code_Home\wksp-alfresco-5.0\co
ntent-tutorial-share\target\tomcat
[INFO] setting SystemProperties:
[INFO] java.io.tmpdir=D:\Code_Home\wksp-alfresco-5.0\content-tutorial-share\tar
get
[INFO] create webapp with contextPath: /share
Nov 25, 2015 2:19:56 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8082"]
Nov 25, 2015 2:19:57 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Nov 25, 2015 2:19:57 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Nov 25, 2015 2:20:53 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Nov 25, 2015 2:20:54 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2015-11-25 14:21:09,953 INFO [extensions.webscripts.TemplateProcessorRegistry]
[localhost-startStop-1] Registered template processor freemarker for extension
ftl
2015-11-25 14:21:09,968 INFO [extensions.webscripts.ScriptProcessorRegistry]
[localhost-startStop-1] Registered script processor javascript for extension js
2015-11-25 14:21:09,969 INFO [extensions.webscripts.TemplateProcessorRegistry
] [localhost-startStop-1] Registered template processor freemarker for extension
ftl
2015-11-25 14:21:09,971 INFO [extensions.webscripts.ScriptProcessorRegistry]
[localhost-startStop-1] Registered script processor javascript for extension js
2015-11-25 14:21:16,585 INFO [extensions.webscripts.DeclarativeRegistry] [loc
alhost-startStop-1] Registered 369 Web Scripts (+0 failed), 383 URLs
2015-11-25 14:21:16,586 INFO [extensions.webscripts.DeclarativeRegistry] [loc
alhost-startStop-1] Registered 8 Package Description Documents (+0 failed)
2015-11-25 14:21:16,586 INFO [extensions.webscripts.DeclarativeRegistry] [loc
alhost-startStop-1] Registered 0 Schema Description Documents (+0 failed)
2015-11-25 14:21:16,722 INFO [extensions.webscripts.AbstractRuntimeContainer]
[localhost-startStop-1] Initialised Spring Surf Container Web Script Container
(in 6743.375ms)
2015-11-25 14:21:16,727 INFO [extensions.webscripts.TemplateProcessorRegistry
] [localhost-startStop-1] Registered template processor freemarker for extension
ftl
2015-11-25 14:21:16,729 INFO [extensions.webscripts.ScriptProcessorRegistry]
[localhost-startStop-1] Registered script processor javascript for extension js
2015-11-25 14:21:16,944 WARN [shared_impl.util.LocaleUtils] [localhost-startS
top-1] Locale name in faces-config.xml null or empty, setting locale to default
locale : en_US
Nov 25, 2015 2:21:18 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
Nov 25, 2015 2:21:18 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring Surf Dispatcher Servlet'
Nov 25, 2015 2:21:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8082"]
2015-11-25 14:30:35,862 INFO [web.site.EditionInterceptor] [http-bio-8082-exec
-1] Successfully retrieved license information from Alfresco.
share-config-custom.xml:
<alfresco-config>
<!-- Document Library config section -->
<config evaluator="string-compare" condition="DocumentLibrary">
<aspects>
<!-- Aspects that a user can see -->
<visible>
<aspect name="sc:webable" />
<aspect name="sc:productRelated" />
</visible>
<!-- Aspects that a user can add. Same as "visible" if left empty -->
<addable>
</addable>
<!-- Aspects that a user can remove. Same as "visible" if left empty -->
<removeable>
</removeable>
</aspects>
<types>
<type name="cm:content">
<subtype name="sc:doc" />
<subtype name="sc:whitepaper" />
</type>
<type name="sc:doc">
<subtype name="sc:whitepaper" />
</type>
</types>
</config>
<config evaluator="string-compare" condition="Remote">
<remote>
<endpoint>
<id>alfresco-noauth</id>
<name>Alfresco - unauthenticated access</name>
<description>Access to Alfresco Repository WebScripts that do not
require authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
<identity>none</identity>
</endpoint>
<endpoint>
<id>alfresco</id>
<name>Alfresco - user access</name>
<description>Access to Alfresco Repository WebScripts that require
user authentication
</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
<identity>none</identity>
</endpoint>
<endpoint>
<id>alfresco-feed</id>
<name>Alfresco Feed</name>
<description>Alfresco Feed - supports basic HTTP authentication via
the EndPointProxyServlet
</description>
<connector-id>http</connector-id>
<endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
<basic-auth>true</basic-auth>
<identity>none</identity>
</endpoint>
</remote>
</config>
</alfresco-config>
Also note that I am able to launch http://localhost:8081/alfresco/
Pls suggest
You nee to switch identity on the alfresco endpoint to user, in order to be able to authenticate:
<endpoint>
<id>alfresco</id>
<name>Alfresco - user access</name>
<description>Access to Alfresco Repository WebScripts that require
user authentication
</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://localhost:8081/alfresco/s</endpoint-url>
<identity>user</identity>
</endpoint>
I have a project which uses JOCL library (http://www.jocl.org/) and has multiple modules. When I run "./activator test" from command line, or run "test" command in SBT console I'm getting errors like the following:
[info] Exception encountered when attempting to run a suite with class name: pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec *** ABORTED ***
[info] java.lang.UnsatisfiedLinkError: Error while loading native library "JOCL_0_1_9-linux-x86_64" with base name "JOCL_0_1_9"
[info] Operating system name: Linux
[info] Architecture : amd64
[info] Architecture bit size: 64
[info] ---(start of nested stack traces)---
[info] Stack trace from the attempt to load the library as a file:
[info] java.lang.UnsatisfiedLinkError: no JOCL_0_1_9-linux-x86_64 in java.library.path
[info] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
[info] at java.lang.Runtime.loadLibrary0(Runtime.java:870)
[info] at java.lang.System.loadLibrary(System.java:1122)
[info] at org.jocl.LibUtils.loadLibrary(LibUtils.java:80)
[info] at org.jocl.CL.<clinit>(CL.java:47)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextDescription$.enumerate(CLContextDescription.scala:44)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.contextsDescriptions$lzycompute(CLContextsManager.scala:6)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.contextsDescriptions(CLContextsManager.scala:6)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.createCpuContext(CLContextsManager.scala:9)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.cpuContext$lzycompute(CLContextsCache.scala:24)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.cpuContext(CLContextsCache.scala:24)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.withCpuContext(CLContextsCache.scala:28)
[info] at pl.tarsa.sortalgobox.opencl.common.CpuSort.sort(CpuSort.scala:34)
[info] at pl.tarsa.sortalgobox.opencl.common.CpuSort.sort(CpuSort.scala:32)
[info] at pl.tarsa.sortalgobox.sorts.SortChecker.forEmptyArray(SortChecker.scala:31)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(CpuMergeSortSpec.scala:32)
[info] at pl.tarsa.sortalgobox.tests.CommonUnitSpecBase.guardedOpenCLTest(CommonUnitSpecBase.scala:40)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1.apply$mcV$sp(CpuMergeSortSpec.scala:31)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1.apply(CpuMergeSortSpec.scala:31)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1.apply(CpuMergeSortSpec.scala:31)
[info] at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
[info] at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info] at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info] at org.scalatest.Transformer.apply(Transformer.scala:22)
[info] at org.scalatest.Transformer.apply(Transformer.scala:20)
[info] at org.scalatest.FlatSpecLike$$anon$1.apply(FlatSpecLike.scala:1647)
[info] at org.scalamock.scalatest.AbstractMockFactory$$anonfun$withFixture$1.apply(AbstractMockFactory.scala:35)
[info] at org.scalamock.scalatest.AbstractMockFactory$$anonfun$withFixture$1.apply(AbstractMockFactory.scala:34)
[info] at org.scalamock.MockFactoryBase$class.withExpectations(MockFactoryBase.scala:41)
[info] at pl.tarsa.sortalgobox.tests.CommonUnitSpecBase.withExpectations(CommonUnitSpecBase.scala:28)
[info] at org.scalamock.scalatest.AbstractMockFactory$class.withFixture(AbstractMockFactory.scala:34)
[info] at pl.tarsa.sortalgobox.tests.CommonUnitSpecBase.withFixture(CommonUnitSpecBase.scala:28)
[info] at org.scalatest.FlatSpecLike$class.invokeWithFixture$1(FlatSpecLike.scala:1644)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
[info] at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
[info] at org.scalatest.FlatSpecLike$class.runTest(FlatSpecLike.scala:1656)
[info] at org.scalatest.FlatSpec.runTest(FlatSpec.scala:1683)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
[info] at scala.collection.immutable.List.foreach(List.scala:381)
[info] at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
[info] at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:427)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
[info] at scala.collection.immutable.List.foreach(List.scala:381)
[info] at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
[info] at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
[info] at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
[info] at org.scalatest.FlatSpecLike$class.runTests(FlatSpecLike.scala:1714)
[info] at org.scalatest.FlatSpec.runTests(FlatSpec.scala:1683)
[info] at org.scalatest.Suite$class.run(Suite.scala:1424)
[info] at org.scalatest.FlatSpec.org$scalatest$FlatSpecLike$$super$run(FlatSpec.scala:1683)
[info] at org.scalatest.FlatSpecLike$$anonfun$run$1.apply(FlatSpecLike.scala:1760)
[info] at org.scalatest.FlatSpecLike$$anonfun$run$1.apply(FlatSpecLike.scala:1760)
[info] at org.scalatest.SuperEngine.runImpl(Engine.scala:545)
[info] at org.scalatest.FlatSpecLike$class.run(FlatSpecLike.scala:1760)
[info] at org.scalatest.FlatSpec.run(FlatSpec.scala:1683)
[info] at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:462)
[info] at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:671)
[info] at sbt.TestRunner.runTest$1(TestFramework.scala:76)
[info] at sbt.TestRunner.run(TestFramework.scala:85)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
[info] at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:185)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
[info] at sbt.TestFunction.apply(TestFramework.scala:207)
[info] at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
[info] at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
[info] at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
[info] at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
[info] at sbt.std.Transform$$anon$4.work(System.scala:63)
[info] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[info] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[info] at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[info] at sbt.Execute.work(Execute.scala:235)
[info] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[info] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[info] at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
[info] at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[info] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[info] at java.lang.Thread.run(Thread.java:745)
[info] Stack trace from the attempt to load the library as a resource:
[info] java.lang.UnsatisfiedLinkError: Native Library /tmp/libJOCL_0_1_9-linux-x86_64.so already loaded in another classloader
[info] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1903)
[info] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822)
[info] at java.lang.Runtime.load0(Runtime.java:809)
[info] at java.lang.System.load(System.java:1086)
[info] at org.jocl.LibUtils.loadLibraryResource(LibUtils.java:188)
[info] at org.jocl.LibUtils.loadLibrary(LibUtils.java:91)
[info] at org.jocl.CL.<clinit>(CL.java:47)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextDescription$.enumerate(CLContextDescription.scala:44)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.contextsDescriptions$lzycompute(CLContextsManager.scala:6)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.contextsDescriptions(CLContextsManager.scala:6)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.createCpuContext(CLContextsManager.scala:9)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.cpuContext$lzycompute(CLContextsCache.scala:24)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.cpuContext(CLContextsCache.scala:24)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.withCpuContext(CLContextsCache.scala:28)
[info] at pl.tarsa.sortalgobox.opencl.common.CpuSort.sort(CpuSort.scala:34)
[info] at pl.tarsa.sortalgobox.opencl.common.CpuSort.sort(CpuSort.scala:32)
[info] at pl.tarsa.sortalgobox.sorts.SortChecker.forEmptyArray(SortChecker.scala:31)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(CpuMergeSortSpec.scala:32)
[info] at pl.tarsa.sortalgobox.tests.CommonUnitSpecBase.guardedOpenCLTest(CommonUnitSpecBase.scala:40)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1.apply$mcV$sp(CpuMergeSortSpec.scala:31)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1.apply(CpuMergeSortSpec.scala:31)
[info] at pl.tarsa.sortalgobox.opencl.CpuMergeSortSpec$$anonfun$1.apply(CpuMergeSortSpec.scala:31)
[info] at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
[info] at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info] at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info] at org.scalatest.Transformer.apply(Transformer.scala:22)
[info] at org.scalatest.Transformer.apply(Transformer.scala:20)
[info] at org.scalatest.FlatSpecLike$$anon$1.apply(FlatSpecLike.scala:1647)
[info] at org.scalamock.scalatest.AbstractMockFactory$$anonfun$withFixture$1.apply(AbstractMockFactory.scala:35)
[info] at org.scalamock.scalatest.AbstractMockFactory$$anonfun$withFixture$1.apply(AbstractMockFactory.scala:34)
[info] at org.scalamock.MockFactoryBase$class.withExpectations(MockFactoryBase.scala:41)
[info] at pl.tarsa.sortalgobox.tests.CommonUnitSpecBase.withExpectations(CommonUnitSpecBase.scala:28)
[info] at org.scalamock.scalatest.AbstractMockFactory$class.withFixture(AbstractMockFactory.scala:34)
[info] at pl.tarsa.sortalgobox.tests.CommonUnitSpecBase.withFixture(CommonUnitSpecBase.scala:28)
[info] at org.scalatest.FlatSpecLike$class.invokeWithFixture$1(FlatSpecLike.scala:1644)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTest$1.apply(FlatSpecLike.scala:1656)
[info] at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
[info] at org.scalatest.FlatSpecLike$class.runTest(FlatSpecLike.scala:1656)
[info] at org.scalatest.FlatSpec.runTest(FlatSpec.scala:1683)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
[info] at org.scalatest.FlatSpecLike$$anonfun$runTests$1.apply(FlatSpecLike.scala:1714)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:413)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
[info] at scala.collection.immutable.List.foreach(List.scala:381)
[info] at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
[info] at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:390)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:427)
[info] at org.scalatest.SuperEngine$$anonfun$traverseSubNodes$1$1.apply(Engine.scala:401)
[info] at scala.collection.immutable.List.foreach(List.scala:381)
[info] at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
[info] at org.scalatest.SuperEngine.org$scalatest$SuperEngine$$runTestsInBranch(Engine.scala:396)
[info] at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:483)
[info] at org.scalatest.FlatSpecLike$class.runTests(FlatSpecLike.scala:1714)
[info] at org.scalatest.FlatSpec.runTests(FlatSpec.scala:1683)
[info] at org.scalatest.Suite$class.run(Suite.scala:1424)
[info] at org.scalatest.FlatSpec.org$scalatest$FlatSpecLike$$super$run(FlatSpec.scala:1683)
[info] at org.scalatest.FlatSpecLike$$anonfun$run$1.apply(FlatSpecLike.scala:1760)
[info] at org.scalatest.FlatSpecLike$$anonfun$run$1.apply(FlatSpecLike.scala:1760)
[info] at org.scalatest.SuperEngine.runImpl(Engine.scala:545)
[info] at org.scalatest.FlatSpecLike$class.run(FlatSpecLike.scala:1760)
[info] at org.scalatest.FlatSpec.run(FlatSpec.scala:1683)
[info] at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:462)
[info] at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:671)
[info] at sbt.TestRunner.runTest$1(TestFramework.scala:76)
[info] at sbt.TestRunner.run(TestFramework.scala:85)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
[info] at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:185)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
[info] at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
[info] at sbt.TestFunction.apply(TestFramework.scala:207)
[info] at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
[info] at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
[info] at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
[info] at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
[info] at sbt.std.Transform$$anon$4.work(System.scala:63)
[info] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[info] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
[info] at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
[info] at sbt.Execute.work(Execute.scala:235)
[info] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[info] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
[info] at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
[info] at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[info] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[info] at java.lang.Thread.run(Thread.java:745)
[info] ---(end of nested stack traces)---
[info] at org.jocl.LibUtils.loadLibrary(LibUtils.java:122)
[info] at org.jocl.CL.<clinit>(CL.java:47)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextDescription$.enumerate(CLContextDescription.scala:44)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.contextsDescriptions$lzycompute(CLContextsManager.scala:6)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.contextsDescriptions(CLContextsManager.scala:6)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsManager$.createCpuContext(CLContextsManager.scala:9)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.cpuContext$lzycompute(CLContextsCache.scala:24)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.cpuContext(CLContextsCache.scala:24)
[info] at pl.tarsa.sortalgobox.opencl.common.CLContextsCache$.withCpuContext(CLContextsCache.scala:28)
[info] at pl.tarsa.sortalgobox.opencl.common.CpuSort.sort(CpuSort.scala:34)
Those errors don't appear for tests in first module/ subproject depending on JOCL. Ie when I do "./activator test" then OpenCL tests from some (first tested) module work and all other don't. When I do "./activator" to spawn SBT console and then run "test" multiple times then for the first time it behaves like ordinary "./activator test" but for next test runs all OpenCL tests fails with UnsatisfiedLinkError.
Here's my build file: https://github.com/tarsa/SortAlgoBox/blob/4a041d93beb572a6dcce100780bc675d46d814f3/project/MainBuild.scala
According to this answer: https://stackoverflow.com/a/23157190/492749 SBT uses some magic classloaders and renames native libraries for each such classloader. The problem is that JOCL unpacks the native libraries during loading of some Java class and the resulting filename and location is always the same. In other words: SBT's magic doesn't play well with JOCL magic.
What would be your solution?
PS: tests work well when executed from within IntelliJ IDEA - probably IDEA doesn't use the classloader magic.
According to this answer: https://stackoverflow.com/a/23157190/492749 SBT uses some magic classloaders and renames native libraries for each such classloader. The problem is that JOCL unpacks the native libraries during loading of some Java class and the resulting filename and location is always the same. In other words: SBT's magic doesn't play well with JOCL magic.
This didn't happen automatically for me; I think it's only used when loading SBT plugins. I had to adapt the SBT classloader:
// adapted from sbt.classpath.NativeCopyLoader
package scalan.compilation.lms
import java.io.File
import java.net.{URLClassLoader, URL}
import java.nio.file.Files
/**
* Loads native libraries from a temporary location in order to work around the jvm native library uniqueness restriction.
*
* The loader will provide native libraries listed in `explicitLibraries` and on `searchPaths` by copying them to `tempDirectory`.
*/
class NativeCopyLoader(explicitLibraries: Seq[File], searchPaths: Seq[File], urls: Array[URL], parent: ClassLoader) extends URLClassLoader(urls, parent) {
private[this] val mapped = new collection.mutable.HashMap[String, String]
private[this] val tempDirectory = Files.createTempDirectory("native-library-copies").toFile
tempDirectory.deleteOnExit()
override protected def findLibrary(name: String): String =
synchronized { mapped.getOrElseUpdate(name, findLibrary0(name)) }
private[this] def findLibrary0(name: String): String = {
val mappedName = System.mapLibraryName(name)
val explicit = explicitLibraries.filter(_.getName == mappedName).toStream
val search = searchPaths.toStream flatMap relativeLibrary(mappedName)
(explicit ++ search).headOption.map(copy).orNull
}
private[this] def relativeLibrary(mappedName: String)(base: File): Seq[File] = {
val f = new File(base, mappedName)
if (f.isFile) f :: Nil else Nil
}
private[this] def copy(f: File): String = {
val target = new File(tempDirectory, f.getName)
Files.copy(f.toPath, target.toPath)
target.getAbsolutePath
}
}
And then make sure it's used when loading the classes which load the native libraries. This may need modification to work with JOCL magic, however.
I have a sbt project that was working fine but after a reload stopped loading the artifacts. An update resolves the dependencies properly but for some reasons now doesn't include the libraries in the project as can be seen in the following show update (note no artifacts for many spray-io modules). Any ideas how to resolve this?
> show update
[info] Updating {file:/Users/nnovod/LIMStales/}default-6a103f...
[info] Resolving org.scala-lang#scala-library;2.10.2 ...
[info] Resolving com.typesafe.akka#akka-actor_2.10;2.1.4 ...
[info] Resolving com.typesafe#config;1.0.0 ...
[info] Resolving io.spray#spray-can;1.1-M8 ...
[info] Resolving io.spray#spray-io;1.1-M8 ...
[info] Resolving io.spray#spray-util;1.1-M8 ...
[info] Resolving io.spray#spray-http;1.1-M8 ...
[info] Resolving org.parboiled#parboiled-scala_2.10;1.1.5 ...
[info] Resolving org.parboiled#parboiled-core;1.1.5 ...
[info] Resolving io.spray#spray-routing;1.1-M8 ...
[info] Resolving io.spray#spray-httpx;1.1-M8 ...
[info] Resolving org.jvnet.mimepull#mimepull;1.9.2 ...
[info] Resolving com.chuusai#shapeless_2.10;1.2.4 ...
[info] Resolving com.googlecode.concurrentlinkedhashmap#concurrentlinkedhashmap-lru;1.3.2 ...
[info] Resolving io.spray#spray-json_2.10;1.2.5 ...
[info] Resolving org.apache.poi#poi;3.9 ...
[info] Resolving commons-codec#commons-codec;1.5 ...
[info] Resolving org.apache.poi#poi-ooxml;3.9 ...
[info] Resolving org.apache.poi#poi-ooxml-schemas;3.9 ...
[info] Resolving org.apache.xmlbeans#xmlbeans;2.3.0 ...
[info] Resolving stax#stax-api;1.0.1 ...
[info] Resolving dom4j#dom4j;1.6.1 ...
[info] Resolving xml-apis#xml-apis;1.0.b2 ...
[info] Resolving io.spray#spray-testkit;1.1-M8 ...
[info] Resolving org.specs2#specs2_2.10;1.14 ...
[info] Resolving org.specs2#specs2-scalaz-core_2.10;7.0.0 ...
[info] Resolving org.specs2#specs2-scalaz-concurrent_2.10;7.0.0 ...
[info] Resolving org.specs2#scalaz-effect_2.10;7.0.0 ...
[info] Resolving org.specs2#scalaz-core_2.10;7.0.0 ...
[info] Resolving org.scalatest#scalatest_2.10;1.9.1 ...
[info] Resolving org.scala-lang#scala-actors;2.10.0 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.0 ...
[info] Done updating.
[info] Update report:
[info] Resolve time: 1834 ms, Download time: 81 ms, Download size: 0 bytes
[info] compile:
[info] org.scala-lang:scala-library:2.10.2: (Artifact(scala-library,jar,jar,None,List(),None,Map()),/Users/nnovod/.sbt/boot/scala-2.10.2/lib/scala-library.jar)
[info] com.typesafe.akka:akka-actor_2.10:2.1.4: (Artifact(akka-actor_2.10,bundle,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/com.typesafe.akka/akka-actor_2.10/bundles/akka-actor_2.10-2.1.4.jar)
[info] com.typesafe:config:1.0.0: (Artifact(config,bundle,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/com.typesafe/config/bundles/config-1.0.0.jar)
[info] io.spray:spray-can:1.1-M8:
[info] io.spray:spray-io:1.1-M8:
[info] io.spray:spray-util:1.1-M8:
[info] io.spray:spray-http:1.1-M8:
[info] org.parboiled:parboiled-scala_2.10:1.1.5: (Artifact(parboiled-scala_2.10,bundle,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.parboiled/parboiled-scala_2.10/bundles/parboiled-scala_2.10-1.1.5.jar)
[info] org.parboiled:parboiled-core:1.1.5: (Artifact(parboiled-core,bundle,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.parboiled/parboiled-core/bundles/parboiled-core-1.1.5.jar)
[info] io.spray:spray-routing:1.1-M8:
[info] io.spray:spray-httpx:1.1-M8:
[info] org.jvnet.mimepull:mimepull:1.9.2: (Artifact(mimepull,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.jvnet.mimepull/mimepull/jars/mimepull-1.9.2.jar)
[info] com.chuusai:shapeless_2.10:1.2.4: (Artifact(shapeless_2.10,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/com.chuusai/shapeless_2.10/jars/shapeless_2.10-1.2.4.jar)
[info] com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.3.2: (Artifact(concurrentlinkedhashmap-lru,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru/jars/concurrentlinkedhashmap-lru-1.3.2.jar)
[info] io.spray:spray-json_2.10:1.2.5: (Artifact(spray-json_2.10,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/io.spray/spray-json_2.10/jars/spray-json_2.10-1.2.5.jar)
[info] org.apache.poi:poi:3.9: (Artifact(poi,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.apache.poi/poi/jars/poi-3.9.jar)
[info] commons-codec:commons-codec:1.5: (Artifact(commons-codec,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.5.jar)
[info] org.apache.poi:poi-ooxml:3.9: (Artifact(poi-ooxml,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.apache.poi/poi-ooxml/jars/poi-ooxml-3.9.jar)
[info] org.apache.poi:poi-ooxml-schemas:3.9: (Artifact(poi-ooxml-schemas,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.apache.poi/poi-ooxml-schemas/jars/poi-ooxml-schemas-3.9.jar)
[info] org.apache.xmlbeans:xmlbeans:2.3.0: (Artifact(xmlbeans,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/org.apache.xmlbeans/xmlbeans/jars/xmlbeans-2.3.0.jar)
[info] stax:stax-api:1.0.1: (Artifact(stax-api,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/stax/stax-api/jars/stax-api-1.0.1.jar)
[info] dom4j:dom4j:1.6.1: (Artifact(dom4j,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/dom4j/dom4j/jars/dom4j-1.6.1.jar)
[info] xml-apis:xml-apis:1.0.b2: (Artifact(xml-apis,jar,jar,None,ArraySeq(master),None,Map()),/Users/nnovod/.ivy2/cache/xml-apis/xml-apis/jars/xml-apis-1.0.b2.jar)
I deleted all of spray.io in the .ivy2 cache (rm -r .ivy2/cache/io.spray) and then did a new update and that fixed things.
I was able to run the sample yesterday, but after attempting to get playn to work with Eclipse it no longer works. It runs normally as HTML5 (mvn -Phtml integration-test).
Here's the full output of me downloading and running playn-samples/showcase:
$ ls -la
total 0
drwxr-xr-x 2 sean staff 68 14 Jan 21:46 .
drwxr-xr-x 16 sean staff 544 14 Jan 21:46 ..
$ git clone https://code.google.com/p/playn-samples
Cloning into 'playn-samples'...
remote: Counting objects: 4291, done.
remote: Finding sources: 100% (4291/4291), done.
remote: Total 4291 (delta 1766)
Receiving objects: 100% (4291/4291), 58.48 MiB | 4.26 MiB/s, done.
Resolving deltas: 100% (1766/1766), done.
$ cd playn-samples/showcase
$ mvn test
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PlayN Showcase Metaproject
[INFO] PlayN Showcase Core
[INFO] PlayN Showcase Android
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PlayN Showcase Metaproject 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # playn-showcase ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PlayN Showcase Core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # playn-showcase-core ---
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) # playn-showcase-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 53 resources
[INFO] skip non existing resourceDirectory /Users/sean/dev/playn/playn-samples/showcase/core/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) # playn-showcase-core ---
[INFO] Compiling 28 source files to /Users/sean/dev/playn/playn-samples/showcase/core/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) # playn-showcase-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/sean/dev/playn/playn-samples/showcase/core/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:testCompile (default-testCompile) # playn-showcase-core ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) # playn-showcase-core ---
[INFO] No tests to run.
[INFO] Surefire report directory: /Users/sean/dev/playn/playn-samples/showcase/core/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PlayN Showcase Android 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # playn-showcase-android ---
[INFO]
[INFO] --- android-maven-plugin:3.1.1:generate-sources (default-generate-sources) # playn-showcase-android ---
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] ANDROID-904-002: Found aidl files: Count = 0
[INFO] /Developer-3.2.5/androidsdk/platform-tools/aapt [package, -m, -J, /Users/sean/dev/playn/playn-samples/showcase/android/target/generated-sources/r, -M, /Users/sean/dev/playn/playn-samples/showcase/android/AndroidManifest.xml, -S, /Users/sean/dev/playn/playn-samples/showcase/android/res, --auto-add-overlay, -I, /Developer-3.2.5/androidsdk/platforms/android-11/android.jar]
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # playn-showcase-android ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/sean/dev/playn/playn-samples/showcase/android/src/main/resources
[INFO] skip non existing resourceDirectory /Users/sean/dev/playn/playn-samples/showcase/android/target/generated-sources/extracted-dependencies/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) # playn-showcase-android ---
[INFO] Compiling 2 source files to /Users/sean/dev/playn/playn-samples/showcase/android/target/classes
[INFO]
[INFO] --- android-maven-plugin:3.1.1:proguard (default-proguard) # playn-showcase-android ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # playn-showcase-android ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/sean/dev/playn/playn-samples/showcase/android/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:testCompile (default-testCompile) # playn-showcase-android ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.13:test (default-test) # playn-showcase-android ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PlayN Showcase Metaproject ........................ SUCCESS [0.289s]
[INFO] PlayN Showcase Core ............................... SUCCESS [1.784s]
[INFO] PlayN Showcase Android ............................ SUCCESS [1.125s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.034s
[INFO] Finished at: Mon Jan 14 21:48:18 EST 2013
[INFO] Final Memory: 15M/81M
[INFO] ------------------------------------------------------------------------
Specify platform too with the -P switch. In your case (Java) say:
mvn test -Pjava
If you want to try the HTML port, say:
mvn -Phtml integration-test
The playn site is stupid.
mvn test just runs the test suite. Instead, you should run mvn install, you will see something like:
...
[INFO] Waiting for initial device list from the Android Debug Bridge
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Successfully uninstalled playn.showcase.android from <DEVICENAME>
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Successfully installed /home/wires/workdir/wordquiz-playn/playn-samples/showcase/android/target/playn-showcase-android-1.0-SNAPSHOT.apk to <DEVICENAME>
...
You can then find the application on your phone, it is called "Showcase" and has a round green smiley icon.
You can also start the application from the commandline, just cd android and mvn android:run. Note that this only runs the application you installed before, it doesn't install it.
The Android and the Java Version is working fine but when i try to comile the HTML Version I get only errors.
I did it by selecting maven build... and entering integration-test in the goals text field (like adviced in the getting started guide).
But I get only following errors:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PlayN Hello HTML 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # playn-hello-html ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # playn-hello-html ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory F:\Documents\Programmieren\PlayN\game\html\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) # playn-hello-html ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # playn-hello-html ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory F:\Documents\Programmieren\PlayN\game\html\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:testCompile (default-testCompile) # playn-hello-html ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # playn-hello-html ---
[INFO] Surefire report directory: F:\Documents\Programmieren\PlayN\game\html\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- gwt-maven-plugin:2.4.0:compile (default) # playn-hello-html ---
[ERROR] Fehler: Hauptklasse com.google.gwt.dev.Compiler konnte nicht gefunden oder geladen werden
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.527s
[INFO] Finished at: Fri Nov 02 10:31:17 CET 2012
[INFO] Final Memory: 11M/28M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.4.0:compile (default) on project playn-hello-html: Command [[
[ERROR] C:\Program Files (x86)\Java\jre7\bin\java -Xmx256m -classpath F:\Documents\Programmieren\PlayN\game\html\src\main\java;F:\Documents\Programmieren\PlayN\game\html\src\main\resources;F:\Documents\Programmieren\PlayN\game\html\target\classes;C:\Users\\.m2\repository\com\googlecode\playn\playn-hello-core\1.0-SNAPSHOT\playn-hello-core-1.0-SNAPSHOT.jar;C:\Users\\.m2\repository\com\googlecode\playn\playn-core\1.4\playn-core-1.4.jar;C:\Users\\.m2\repository\com\samskivert\pythagoras\1.2\pythagoras-1.2.jar;C:\Users\
\.m2\repository\com\googlecode\playn\playn-html\1.4\playn-html-1.4.jar;C:\Users\\.m2\repository\com\googlecode\playn\playn-webgl\1.4\playn-webgl-1.4.jar;C:\Users\\.m2\repository\com\google\gwt\gwt-user\2.4.0\gwt-user-2.4.0.jar;C:\Users\\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar;C:\Users\\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA-sources.jar;C:\Users\\.m2\repository\com\allen-sauer\gwt\voices\gwt-voices\2.1.8\gwt-voices-2.1.8.jar;C:\Users\\.m2\repository\com\google\gwt\gwt-user\2.4.0\gwt-user-2.4.0.jar;C:\Users\\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar;C:\Users\\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA-sources.jar;C:\Users\\.m2\repository\com\google\gwt\gwt-dev\2.4.0\gwt-dev-2.4.0.jar com.google.gwt.dev.Compiler -gen F:\Documents\Programmieren\PlayN\game\html\target\.generated -logLevel INFO -style PRETTY -war F:\Documents\Programmieren\PlayN\game\html\target\playn-hello-html-1.0-SNAPSHOT -localWorkers 8 -XdisableClassMetadata -XdisableCastChecking -XdisableRunAsync playn.sample.hello.HelloGame
[ERROR] ]] failed with status 1
[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/MojoExecutionException
When I try Google -> GWT Compile (as mentioned somewhere here on Stackoverflow) it only says that this isn't a GWT Project!
What can I do to get the HTML Version working?
Regards
Fleckdalm
try this:
mvn clean -Phtml package