artifact resolving question

11 views
Skip to first unread message

Zsolt Kúti

unread,
Apr 28, 2015, 6:02:18 AM4/28/15
to rio-...@googlegroups.com
Hello,

I am trying to deploy a simple opstring with the only artifact being
outrigger. As I do not use maven, no local repository for the
artifacts. From the rio documentation it seems resolving is supposed to
happen, but either attempting to deploy from rio-ui or command line*
results in error that indicates a resolving issue.

I have set proxies (in net.properties of the jdk) and the ones known by
the OS to no avail.

Any idea?
Thanks!

Zsolt


*: this attempt is done with a modification below to monitor.grovvy:
String[] initialOpStrings = [path-to-the opstring]


ARN 11:40:31.205 o.r.m.service.ProvisionMonitorImpl - Deploying
OperationalString [Test] java.lang.NullPointerException: null
at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:361)
~[na:na] at
org.rioproject.resolver.aether.AetherService.resolve(AetherService.java:264)
~[na:na] at
org.rioproject.resolver.aether.AetherResolver$ResolvingRequestTask.call(AetherResolver.java:319)
~[na:na] at
org.rioproject.resolver.aether.AetherResolver$ResolvingRequestTask.call(AetherResolver.java:302)
~[na:na] at java.util.concurrent.FutureTask.run(FutureTask.java:262)
~[na:1.7.0_65] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
~[na:1.7.0_65] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
~[na:1.7.0_65] Wrapped by: java.util.concurrent.ExecutionException:
java.lang.NullPointerException at
java.util.concurrent.FutureTask.report(FutureTask.java:122)
~[na:1.7.0_65] at
java.util.concurrent.FutureTask.get(FutureTask.java:188) ~[na:1.7.0_65]
at
org.rioproject.resolver.aether.AetherResolver.getClassPathFor(AetherResolver.java:122)
~[na:na] Wrapped by: org.rioproject.resolver.ResolverException: While
trying to resolve org.apache.river:outrigger-dl:2.2.2; at
org.rioproject.resolver.aether.AetherResolver.getClassPathFor(AetherResolver.java:126)
~[na:na] at
org.rioproject.monitor.service.DeploymentVerifier.resolve(DeploymentVerifier.java:134)
~[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.DeploymentVerifier.resolveOperationalStringService(DeploymentVerifier.java:107)
~[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.DeploymentVerifier.verifyOperationalStringService(DeploymentVerifier.java:90)
~[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.DeploymentVerifier.verifyOperationalString(DeploymentVerifier.java:76)
~[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.DeploymentVerifier.verifyDeploymentRequest(DeploymentVerifier.java:68)
~[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.ProvisionMonitorImpl.deploy(ProvisionMonitorImpl.java:527)
[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.ProvisionMonitorImpl.deploy(ProvisionMonitorImpl.java:502)
[monitor-service-5.1.4.jar:5.1.4] at
org.rioproject.monitor.service.ProvisionMonitorAdminImpl.deploy(ProvisionMonitorAdminImpl.java:107)
[monitor-service-5.1.4.jar:5.1.4]

Dennis Reedy

unread,
Apr 28, 2015, 6:27:52 AM4/28/15
to rio-...@googlegroups.com
Zsolt,

Its just a non-stop issue for you isnt it :) You will end up with a local repository, the underlying aether resolver will resolve artifact to ~/.m2/repository. You may need to follow these instructions: http://maven.apache.org/guides/mini/guide-proxies.html

HTH

Dennis
> --
> You received this message because you are subscribed to the Google Groups "Rio Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rio-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Zsolt Kúti

unread,
Apr 28, 2015, 7:13:44 AM4/28/15
to rio-...@googlegroups.com
Hi Dennis,


On Tue, 28 Apr 2015 06:27:48 -0400
Dennis Reedy <dennis...@gmail.com> wrote:

> Zsolt,

> Its just a non-stop issue for you isnt it :) You will end up with a
> local repository, the underlying aether resolver will resolve
> artifact to ~/.m2/repository. You may need to follow these
> instructions: http://maven.apache.org/guides/mini/guide-proxies.html


Oh, my head is dizzy! It so easy to miss way among the various
layers of technology maze...

Thanks, this got me further. And yes, I am trying the sample web app
and this was the first step.

While we are at it, another question. Your modified catalina.policy
refers to:

grant codeBase "file:/groovy/script" { ...

What is this groovy, is this really needed?

Thanks!
Zsolt

Dennis Reedy

unread,
Apr 28, 2015, 7:16:48 AM4/28/15
to rio-...@googlegroups.com
Its Groovy (http://www.groovy-lang.org), and yes its needed.

Dennis



Zsolt Kúti

unread,
Apr 28, 2015, 7:53:08 AM4/28/15
to rio-...@googlegroups.com
On Tue, 28 Apr 2015 07:16:45 -0400
Dennis Reedy <dennis...@gmail.com> wrote:


> > grant codeBase "file:/groovy/script" { ...

> > What is this groovy, is this really needed?


> Its Groovy (http://www.groovy-lang.org), and yes its needed.

I was not clear. This is a file which I do not have. Should I
separately install groovy and refer to this file?
I have just checked that groovy 2.4.3 does not have this "script".


Zsolt

Dennis Reedy

unread,
Apr 28, 2015, 7:57:59 AM4/28/15
to rio-...@googlegroups.com
The “groovy/script” is the codeSource created when a groovy script is run. It’s nothing you need to create/install

Dennis

Zsolt Kúti

unread,
Apr 28, 2015, 10:40:57 AM4/28/15
to rio-...@googlegroups.com
On Tue, 28 Apr 2015 07:57:55 -0400
Dennis Reedy <dennis...@gmail.com> wrote:


> The “groovy/script” is the codeSource created when a groovy script
> is run. It’s nothing you need to create/install

OK, thanks.


Just a short notice for those who are interested, our discussion
now deals with a sample web project where the web client uses
services run by Rio. The code is here:
https://github.com/tinca/rio5-web-test


With the setenv.sh in place (modified to my system and checked the
variables which are correct) tomcat still does not see classdefs at
runtime.
I can hopefully investigate it further tomorrow.

Zsolt



Caused by: java.lang.NoClassDefFoundError: net/jini/core/entry/Entry
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2436)
at java.lang.Class.getDeclaredFields(Class.java:1806)
at
org.apache.catalina.util.Introspection$1.run(Introspection.java:102) at
org.apache.catalina.util.Introspection$1.run(Introspection.java:99) at
java.security.AccessController.doPrivileged(Native Method) at
org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:98)
at
org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
at
org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:403)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:879)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)


Dennis Reedy

unread,
Apr 28, 2015, 10:48:05 AM4/28/15
to rio-...@googlegroups.com
Can you please provide the output when you run bin/catalina.sh start -security?

Dennis

Zsolt Kúti

unread,
Apr 29, 2015, 3:32:31 AM4/29/15
to rio-...@googlegroups.com
On Tue, 28 Apr 2015 10:48:02 -0400
Dennis Reedy <dennis...@gmail.com> wrote:


> Can you please provide the output when you run bin/catalina.sh start
> -security?

Hi Dennis,

We do not use catalina.sh, but the OSs standard service start/stop
mechanism (on Ubuntu/Debian /etc/init.d/tomcat7 start/stop and the
FreeBSD equivalent of it, which finally calls jsvc).
I want to make it work first on FreeBSD.

Because it seems to be a classpath problem, as if CP set by setenv.sh
had no effect, I tried to put those libs under CATALINA_HOME/lib.
Same error, see below.

Now, I have to pause working on this, will pick up again sometimes
later.

Zsolt


org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/web-test]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
...
at java.lang.Thread.run(Thread.java:745) Caused by:
java.lang.NoClassDefFoundError: net/jini/core/entry/Entry at
java.lang.Class.getDeclaredFields0(Native Method) at
java.lang.Class.privateGetDeclaredFields(Class.java:2436) at
java.lang.Class.getDeclaredFields(Class.java:1806) at
org.apache.catalina.util.Introspection$1.run(Introspection.java:102) at
org.apache.catalina.util.Introspection$1.run(Introspection.java:99) at
java.security.AccessController.doPrivileged(Native Method) at
org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:98)
at
org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
at
org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
at
...
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ...
14 more Caused by: java.lang.ClassNotFoundException:
net.jini.core.entry.Entry at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) ...
31 more

Dennis Reedy

unread,
Apr 29, 2015, 5:36:02 AM4/29/15
to rio-...@googlegroups.com
Hi Zsolt,

Putting the jars into CATALINA_HOME/lib will have no effect. This reason is the rio-platform jar (as well as jsk-platform, groovy-all and slf4j) must be in the system classloader in order to have it’s RMIClassLoaderSpi loaded to handle the artifact: URLs.

From what I can see wrt /etc/init.d/tomcat7 script, is the script calls $CATALINA_HOME/bin/startup.sh (which will call setenv.sh), but we need to call it with -security.

HTH

Regards

Dennis

Zsolt Kúti

unread,
Apr 29, 2015, 7:03:31 AM4/29/15
to rio-...@googlegroups.com
On Wed, 29 Apr 2015 05:35:58 -0400
Dennis Reedy <dennis...@gmail.com> wrote:


> Hi Zsolt,

>

> Putting the jars into CATALINA_HOME/lib will have no effect. This
> reason is the rio-platform jar (as well as jsk-platform, groovy-all
> and slf4j) must be in the system classloader in order to have it’s
> RMIClassLoaderSpi loaded to handle the artifact: URLs.

Now, I understand why it has no effect. Will try something else.

> From what I can see wrt /etc/init.d/tomcat7 script, is the script
> calls $CATALINA_HOME/bin/startup.sh (which will call setenv.sh), but
> we need to call it with -security.

Security is certainly set, it is used routinely on the platforms
mentioned.

Zsolt

Dennis Reedy

unread,
Apr 29, 2015, 7:07:06 AM4/29/15
to rio-...@googlegroups.com
Hi Zsolt,

If possible, I think what might be helpful would be to try running $CATALINA_HOME/bin/catalina.sh start -security and provide the output of that command.

Thanks

Dennis

Zsolt Kúti

unread,
Apr 29, 2015, 8:02:50 AM4/29/15
to rio-...@googlegroups.com
On Wed, 29 Apr 2015 07:07:02 -0400
Dennis Reedy <dennis...@gmail.com> wrote:


> Hi Zsolt,

>

> If possible, I think what might be helpful would be to try running
> $CATALINA_HOME/bin/catalina.sh start -security and provide the output
> of that command.

# bin/catalina.sh start -security
Using RIO_HOME: /home/kuti/apps/rio
Using CATALINA_OPTS: -Drio.home=/home/kuti/apps/rio
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0/temp
Using JRE_HOME: /usr/local
Using
CLASSPATH: /home/kuti/apps/rio/lib/jsk-platform-2.2.2.jar:/home/kuti/apps/rio/lib/rio-platform-5.1.4.jar:/home/kuti/apps/rio/lib/groovy-all-2.3.8.jar:/home/kuti/apps/rio/lib/logging/slf4j-api-1.7.7.jar:/home/kuti/apps/rio/lib/logging/jul/slf4j-jdk14-1.7.7.jar:/usr/local/apache-tomcat-7.0/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0/bin/tomcat-juli.jar

The jars in classpath are accessible.
(~/apps/rio is a soft link to rio-5.1.4, this way it's easy to change
between versions)


Starting TC with catalina.sh shows additional (permission) errors to
ClassNotFound and NoClassDef, but I am not sure if trying to resolve
them would be useful.

Zsolt

Dennis Reedy

unread,
Apr 29, 2015, 8:13:49 AM4/29/15
to rio-...@googlegroups.com

>
> # bin/catalina.sh start -security
> Using RIO_HOME: /home/kuti/apps/rio
> Using CATALINA_OPTS: -Drio.home=/home/kuti/apps/rio
> Using CATALINA_BASE: /usr/local/apache-tomcat-7.0
> Using CATALINA_HOME: /usr/local/apache-tomcat-7.0
> Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0/temp
> Using JRE_HOME: /usr/local
> Using
> CLASSPATH: /home/kuti/apps/rio/lib/jsk-platform-2.2.2.jar:/home/kuti/apps/rio/lib/rio-platform-5.1.4.jar:/home/kuti/apps/rio/lib/groovy-all-2.3.8.jar:/home/kuti/apps/rio/lib/logging/slf4j-api-1.7.7.jar:/home/kuti/apps/rio/lib/logging/jul/slf4j-jdk14-1.7.7.jar:/usr/local/apache-tomcat-7.0/bin/bootstrap.jar:/usr/local/apache-tomcat-7.0/bin/tomcat-juli.jar
>
> The jars in classpath are accessible.
> (~/apps/rio is a soft link to rio-5.1.4, this way it's easy to change
> between versions)
>
>
> Starting TC with catalina.sh shows additional (permission) errors to
> ClassNotFound and NoClassDef, but I am not sure if trying to resolve
> them would be useful.

Actually the permission errors are most likely key here. I ended up running tomcat with -Djava.security.debug=access:failure to determine what to set in catalina.policy. If permissions are not set correctly we may indeed have root cause for your issue(s).

Dennis

Zsolt Kúti

unread,
Apr 29, 2015, 9:44:41 AM4/29/15
to rio-...@googlegroups.com
On Wed, 29 Apr 2015 08:13:46 -0400
Dennis Reedy <dennis...@gmail.com> wrote:

...
> > Starting TC with catalina.sh shows additional (permission) errors
> > to

> > ClassNotFound and NoClassDef, but I am not sure if trying to
> > resolve

> > them would be useful.

>

> Actually the permission errors are most likely key here. I ended up
> running tomcat with -Djava.security.debug=access:failure to determine
> what to set in catalina.policy. If permissions are not set correctly
> we may indeed have root cause for your issue(s).

It would be just a bit strange that catalina.sh reported additional
permission problem, while the other launching method did not.
Nevertheless thanks for the tip, I will try java.security.debug.

Zsolt

Dennis Reedy

unread,
Apr 29, 2015, 9:47:22 AM4/29/15
to rio-...@googlegroups.com
Be prepared for lots & lots of output :)

Dennis
Reply all
Reply to author
Forward
0 new messages