[NETVIRT-48] Java exception when install netvirt feature java.io.FileNotFoundException: ~/etc/shiro.ini (No such file or directory) Created: 04/Aug/16  Updated: 19/Oct/17  Resolved: 05/Aug/16

Status: Resolved
Project: netvirt
Component/s: General
Affects Version/s: Beryllium
Fix Version/s: None

Type: Bug
Reporter: Nikolas Hermanns Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: All


Attachments: Text File karaf.log    
External issue ID: 6340

 Description   

When installing the netvirt feature a lot of exceptions are thrown. This is one of them.

Stable release SR-2 Beryllium.

2016-08-04 17:03:38,019 | ERROR | pool-12-thread-1 | EnvironmentLoader | 223 - org.apache.shiro.web - 1.2.3 | Shiro environment initializa
tion failed
org.apache.shiro.config.ConfigurationException: java.io.FileNotFoundException: /home/cloudci/etc/shiro.ini (No such file or directory)
at org.apache.shiro.config.Ini.loadFromPath(Ini.java:242)[222:org.apache.shiro.core:1.2.3]
at org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment.createShiroIni(KarafIniWebEnvironment.java:109)[220:org.opendaylight.aaa.shiro:0.3.2
.Beryllium-SR2]
at org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment.createDefaultShiroIni(KarafIniWebEnvironment.java:95)[220:org.opendaylight.aaa.shiro
:0.3.2.Beryllium-SR2]
at org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment.init(KarafIniWebEnvironment.java:45)[220:org.opendaylight.aaa.shiro:0.3.2.Beryllium-
SR2]
at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)[222:org.apache.shiro.core:1.2.3]
at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)[222:org.apache.shiro.core:1.2.3]
at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:221)[223:org.apache.shiro.web:1.2.3]



 Comments   
Comment by Nikolas Hermanns [ 04/Aug/16 ]

Attachment karaf.log has been added with description: karaf file

Comment by Nikolas Hermanns [ 04/Aug/16 ]

I used:
feature:install odl-ovsdb-openstack

to install the feature.

Comment by Nikolas Hermanns [ 05/Aug/16 ]

Ok found the issue my self.

the problem was that I had a startup script:
$cat ~/start_opendaylight
#!/bin/bash
KARAF_HOME="/opt/opendaylight"
JAVA_OPTS="-server -Xms256M -Xmx2048M -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dcom.sun.management.jmxremote"
OPTS="-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true"
MAIN="org.apache.karaf.main.Main"
DEBUG=true

  1. Try to find lang used in system
    test -f /etc/default/locale && . /etc/default/locale || true
    export LANG=$LANG
    #export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/jre/bin/java::")
    export JAVA_HOME=/home/cloudci/jdk1.8.0_101
    export KARAF_BASE="$KARAF_HOME"
    export KARAF_DATA="$KARAF_BASE/data"
    export KARAF_ETC="$KARAF_BASE/etc"
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$KARAF_BASE/lib"
    export JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed"
    export JAVA_EXT_DIRS="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext"

if [ "$DEBUG" = true ]; then
JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7586 ${JAVA_OPTS}"
fi

for file in "$KARAF_HOME"/lib/karaf*.jar
do
if [ -z "$CLASSPATH" ]; then
CLASSPATH="$file"
else
CLASSPATH="$CLASSPATH:$file"
fi
done

exec ${JAVA_HOME}/bin/java $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" -Djava.ext.dirs="${JAVA_EXT_DIRS}" -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Dkaraf.data="$KARAF_DATA" -Dkaraf.etc="$KARAF_ETC" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN

which happend to be started in the home folder. then java shiro is not smart enough to see where its root folder is so:
~/opendaylight/distribution/etc/shiro.ini

when executing the start_opendayulight script from the ~/opendaylight/distribution folder it actually worked and did not throw any error anymore.
Through this the apidoc and all other http services did not come up.

Generated at Wed Feb 07 20:20:34 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.