cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2187
Views
0
Helpful
2
Replies

NED --ERROR-- java uninitialized cause java path changed

yeepsae17
Cisco Employee
Cisco Employee

< Symptom >

Reloading NED packages failed.

 

root@ncs# packages reload

reload-result {

    package alu-sr

    result false

    info --ERROR--

}

reload-result {

    package cisco-iosxr

    result false

    info --ERROR--

}

reload-result {

    package l3vpn

    result true

}

reload-result {

    package huawei-vrp

    result false

    info --ERROR--

 

root@ncs# show packages package oper-status              

                                                                                     PACKAGE               

                      PROGRAM                                                        META     FILE         

                      CODE     JAVA           BAD NCS  PACKAGE  PACKAGE  CIRCULAR    DATA     LOAD   ERROR 

NAME              UP  ERROR    UNINITIALIZED  VERSION  NAME     VERSION  DEPENDENCY  ERROR    ERROR  INFO  

------------------------------------------------------------------------------------------------------------

 

alu-sr            -   -        X              -        -        -        -           -        -      -     

cisco-iosxr       -   -        X              -        -        -        -           -        -      -     

huawei-vrp        -   -        X              -        -        -        -           -        -      -     

l3vpn             X   -        -              -        -        -        -           -        -      -     

 

 

< troubleshoot >

 

After java path was changed by any reason, once the nso restarts, java-vm doesn’t come up with this error msg in the ncs-java-vm.log,
 
Starting java-vm with options:\n' -classpath :/opt/ncs/current/java/jar/* -Dport=4569 -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8'
/opt/ncs/current/bin/ncs-start-java-vm: line 97: exec: java: not found
 
The new java path was exported in shell environment, so the ncs-start-java-vm can be executed from SHELL directly, but not started by "/etc/init.d/ncs start"
 
In order to find the reason why it doesn't start, I did two ways as below.
 
1) I modified the ncs-start-java-vm line 97 like “exec /usr/local/java/bin/java ${opts} ${mainclass}”, then it’s working.
 
2) I created symbolic link like 'ln -s /usr/local/java/bin/java /usr/bin/java', then it's working. 
 
In case of local installation, it doesn't have this problem, however in case of the system installation I think the ncs-start-java-vm can't get the shell environment. 
 
Can anyone give me better idea? 
2 Replies 2

ramkraja
Cisco Employee
Cisco Employee

Is /usr/local/java/bin in your PATH when you start NSO?

You cannot change the env variables of an already running Linux process.

The environment is applied once the process is restarted.

 

When the NSO started, the /usr/local/java/bin was not in the PATH.

While the NSO was running, someone installed new jdk and the PATH was chagned.

So I restarted the NSO, but the new PATH was not applied.

 

I think you could reproduce this.

0) in the system installation,

1) remove the /usr/bin/java which should be symbolic link.

2) create the the symbolic link under the other directory which is in the PATH

3) restart the NSO (/etc/init.d/ncs restart)

4) Java VM is not running. 

 

In case of local installation, the Java VM is running.