cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
195
Views
0
Helpful
2
Replies
Highlighted
Cisco Employee

Starting java machine from eclipse errors on loading ned

May be someone ran into this and point to resolution.

 

I have ncs 4.1 installed locally

 

Packages configure with one ned, only cisco-ios.

 

I start ncs and java log looks like this.

<INFO> 26-Feb-2016::13:39:50.121 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-ios"] -->

<WARN> 26-Feb-2016::13:39:50.156 ResourceManager JVM-Launcher: - Resource annotated field :IOSNedCli::mm already set, no resource injection performed

<INFO> 26-Feb-2016::13:39:50.156 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-ios"] --> LOADED

<INFO> 26-Feb-2016::13:39:50.157 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_PACKAGE

<INFO> 26-Feb-2016::13:39:50.157 NcsMain JVM-Launcher: - READ SOCKET =>

 

This warning is OK.

 

 

Then I follow development guide to start java vm from eclipse instead of starting it automatically

 

When I start java vm from eclipse log becomes

 

 

<INFO> 26-Feb-2016::13:39:50.117 NcsMain JVM-Launcher: - FOUND TYPE: callback

<INFO> 26-Feb-2016::13:39:50.118 NcsMain JVM-Launcher: - FOUND TYPE: callback

<INFO> 26-Feb-2016::13:39:50.118 NcsMain JVM-Launcher: - FOUND TYPE: ned

<INFO> 26-Feb-2016::13:39:50.121 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-ios"] -->

<WARN> 26-Feb-2016::13:39:50.125 ResourceManager JVM-Launcher: - class IOSDp2 not loaded by tail-f classloader, defaulting to package 'UNKNOWN'

<WARN> 26-Feb-2016::13:39:50.138 ResourceManager JVM-Launcher: - class IOSDp not loaded by tail-f classloader, defaulting to package 'UNKNOWN'

<WARN> 26-Feb-2016::13:39:50.153 ResourceManager JVM-Launcher: - class IOSNedCli not loaded by tail-f classloader, defaulting to package 'UNKNOWN'

<WARN> 26-Feb-2016::13:39:50.156 ResourceManager JVM-Launcher: - class IOSNedCli not loaded by tail-f classloader, defaulting to package 'UNKNOWN'

<WARN> 26-Feb-2016::13:39:50.156 ResourceManager JVM-Launcher: - Resource annotated field :IOSNedCli::mm already set, no resource injection performed

<INFO> 26-Feb-2016::13:39:50.156 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-ios"] --> LOADED

<INFO> 26-Feb-2016::13:39:50.157 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_PACKAGE

 

 

These warnings effect the rest of the work I am trying to do.

 

I am sure someone ran into this already. Why is this happening when java vm is started from eclipse?

 

 

Again, if I just let ncs to start java vm all is fine but I need to be able to debug.

 

 

Any help would be appreciated.

 

Everyone's tags (5)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: Starting java machine from eclipse errors on loading ned

Eclipse has its own classloader which is very eager in loading classes.

 

So it will load all classes it can get hold of, even the ones in the packages.

 

Then there is nothing for the tail-f classloader to load.

 

 

You can setup only the NcsJVMLauncher in a separate project with no other classes and go from there.

 

However this is messy in debugging and I prefer remote debugging.

 

 

In a cli do:

 

admin@ncs(config)# java-vm auto-start false

admin@ncs(config)# commit

Commit complete.

 

Then in a shell start the java-vm by its start script with remote debug flag set  

$ ncs-start-java-vm –d

 

Now eclipse can connect and remote debug the application on port 9000

 

The procedure is described in the examples.ncs under

 

getting-started/developing-with-ncs/README.develop

 

View solution in original post

2 REPLIES 2
Highlighted
Cisco Employee

Re: Starting java machine from eclipse errors on loading ned

Eclipse has its own classloader which is very eager in loading classes.

 

So it will load all classes it can get hold of, even the ones in the packages.

 

Then there is nothing for the tail-f classloader to load.

 

 

You can setup only the NcsJVMLauncher in a separate project with no other classes and go from there.

 

However this is messy in debugging and I prefer remote debugging.

 

 

In a cli do:

 

admin@ncs(config)# java-vm auto-start false

admin@ncs(config)# commit

Commit complete.

 

Then in a shell start the java-vm by its start script with remote debug flag set  

$ ncs-start-java-vm –d

 

Now eclipse can connect and remote debug the application on port 9000

 

The procedure is described in the examples.ncs under

 

getting-started/developing-with-ncs/README.develop

 

View solution in original post

Beginner

Re: Starting java machine from eclipse errors on loading ned

Hi khgrant ,                  .

 

When I am doing remote debugging I am facing below issue. EFE (End of File error). 9000 port is not enabling. could you please assist me where I am doing mistake. I am using nso-5.1.0.1 version. DemoService is my project name which I need to debug.

 

mef-dev@Presto-sdk-dev:~/NSO-Work$ make clean
(for i in ; do \
make -C packages/${i}/src clean || exit 1; \
done)
rm -rf state/* ncs-cdb/*
rm -rf logs/* lux_logs
rm -rf .bundle
mef-dev@Presto-sdk-dev:~/NSO-Work$ make all
(for i in ; do \
make -C packages/${i}/src all || exit 1; \
done)
if [ ! -d ncs-cdb ]; then mkdir ncs-cdb; fi
if [ ! -d state ]; then mkdir state; fi
if [ ! -d logs ]; then mkdir logs; fi
if [ ! -d init_data ]; then mkdir init_data; fi
cp init_data/* ncs-cdb/. > /dev/null 2>&1 || true
mef-dev@Presto-sdk-dev:~/NSO-Work$ make start
ncs --stop || true
ncs
mef-dev@Presto-sdk-dev:~/NSO-Work$ ncs-start-java-vm -d
Starting java-vm with options:
' -classpath :/home/mef-dev/nso-5.1.0.1/java/jar/* -Xdebug -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=n -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8'
Listening for transport dt_socket at address: 9000
NCS JVM STARTING
NcsLogger applying Default configuration!
<INFO> 06-Nov-2019::17:57:04.791 NcsMain JVM-Launcher: - CONNECTED TO to NCS --> Socket[addr=/127.0.0.1,port=4569,localport=54376]
<INFO> 06-Nov-2019::17:57:04.810 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:04.822 NcsMain JVM-Launcher: - <= GOT INIT_JVM
JMXURL : service:jmx:rmi://127.0.0.1:9901/jndi/rmi://127.0.0.1:9902/ncs
<INFO> 06-Nov-2019::17:57:06.321 NcsMain JVM-Launcher: - ALARM SERVICE STARTED
<INFO> 06-Nov-2019::17:57:06.322 NcsMain JVM-Launcher: - DONE COMMAND --> INIT_JVM
<INFO> 06-Nov-2019::17:57:06.322 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.323 NcsMain JVM-Launcher: - <= GOT LOAD_SHARED_JARS
<INFO> 06-Nov-2019::17:57:06.324 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["cisco-nc-1.0"] -->
<INFO> 06-Nov-2019::17:57:06.324 NcsMain JVM-Launcher: - loading shared jar: file:///home/mef-dev/NSO-Work/state/packages-in-use/1/cisco/shared-jar/cisco-ns.jar
<INFO> 06-Nov-2019::17:57:06.324 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["cisco-nc-1.0"] --> OK
<INFO> 06-Nov-2019::17:57:06.324 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_SHARED_JARS
<INFO> 06-Nov-2019::17:57:06.325 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.325 NcsMain JVM-Launcher: - <= GOT LOAD_SHARED_JARS
<INFO> 06-Nov-2019::17:57:06.325 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["cisco2-nc-1.0"] -->
<INFO> 06-Nov-2019::17:57:06.325 NcsMain JVM-Launcher: - loading shared jar: file:///home/mef-dev/NSO-Work/state/packages-in-use/1/cisco2/shared-jar/cisco2-ns.jar
<INFO> 06-Nov-2019::17:57:06.326 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["cisco2-nc-1.0"] --> OK
<INFO> 06-Nov-2019::17:57:06.327 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_SHARED_JARS
<INFO> 06-Nov-2019::17:57:06.327 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.328 NcsMain JVM-Launcher: - <= GOT LOAD_SHARED_JARS
<INFO> 06-Nov-2019::17:57:06.328 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["demoservice"] -->
<INFO> 06-Nov-2019::17:57:06.328 NcsMain JVM-Launcher: - loading shared jar: file:///home/mef-dev/NSO-Work/state/packages-in-use/1/demoservice/shared-jar/demoservice-ns.jar
<INFO> 06-Nov-2019::17:57:06.328 NcsMain JVM-Launcher: - LOAD SHARED PACKAGE ["demoservice"] --> OK
<INFO> 06-Nov-2019::17:57:06.328 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_SHARED_JARS
<INFO> 06-Nov-2019::17:57:06.329 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.330 NcsMain JVM-Launcher: - <= GOT LOAD_PACKAGE
<INFO> 06-Nov-2019::17:57:06.330 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-nc-1.0"] -->
<INFO> 06-Nov-2019::17:57:06.332 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco-nc-1.0"] --> LOADED
<INFO> 06-Nov-2019::17:57:06.332 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_PACKAGE
<INFO> 06-Nov-2019::17:57:06.333 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.333 NcsMain JVM-Launcher: - <= GOT LOAD_PACKAGE
<INFO> 06-Nov-2019::17:57:06.334 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco2-nc-1.0"] -->
<INFO> 06-Nov-2019::17:57:06.334 NcsMain JVM-Launcher: - LOADING PACKAGE ["cisco2-nc-1.0"] --> LOADED
<INFO> 06-Nov-2019::17:57:06.335 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_PACKAGE
<INFO> 06-Nov-2019::17:57:06.335 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.338 NcsMain JVM-Launcher: - <= GOT LOAD_PACKAGE
<INFO> 06-Nov-2019::17:57:06.339 NcsMain JVM-Launcher: - FOUND TYPE: callback
<INFO> 06-Nov-2019::17:57:06.340 NcsMain JVM-Launcher: - LOADING PACKAGE ["demoservice"] -->
<INFO> 06-Nov-2019::17:57:06.359 NcsMain JVM-Launcher: - LOADING PACKAGE ["demoservice"] --> LOADED
<INFO> 06-Nov-2019::17:57:06.359 NcsMain JVM-Launcher: - DONE COMMAND --> LOAD_PACKAGE
<INFO> 06-Nov-2019::17:57:06.361 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.361 NcsMain JVM-Launcher: - <= GOT INSTANTIATE_COMPONENT
<INFO> 06-Nov-2019::17:57:06.361 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco-nc-1.0:cisco"] -->
<INFO> 06-Nov-2019::17:57:06.361 NcsMain JVM-Launcher: - => Nothing to deploy for component cisco-nc-1.0:cisco
<INFO> 06-Nov-2019::17:57:06.362 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco-nc-1.0:cisco"] --> DONE
<INFO> 06-Nov-2019::17:57:06.362 NcsMain JVM-Launcher: - DONE COMMAND --> INSTANTIATE_COMPONENT
<INFO> 06-Nov-2019::17:57:06.363 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.363 NcsMain JVM-Launcher: - <= GOT INSTANTIATE_COMPONENT
<INFO> 06-Nov-2019::17:57:06.363 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco2-nc-1.0:cisco2"] -->
<INFO> 06-Nov-2019::17:57:06.363 NcsMain JVM-Launcher: - => Nothing to deploy for component cisco2-nc-1.0:cisco2
<INFO> 06-Nov-2019::17:57:06.363 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["cisco2-nc-1.0:cisco2"] --> DONE
<INFO> 06-Nov-2019::17:57:06.364 NcsMain JVM-Launcher: - DONE COMMAND --> INSTANTIATE_COMPONENT
<INFO> 06-Nov-2019::17:57:06.364 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.370 NcsMain JVM-Launcher: - <= GOT INSTANTIATE_COMPONENT
<INFO> 06-Nov-2019::17:57:06.371 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["demoservice:demoserviceRFS"] -->
<INFO> 06-Nov-2019::17:57:06.432 NcsMain JVM-Launcher: - INSTANTIATE COMPONENT ["demoservice:demoserviceRFS"] --> DONE
<INFO> 06-Nov-2019::17:57:06.432 NcsMain JVM-Launcher: - DONE COMMAND --> INSTANTIATE_COMPONENT
<INFO> 06-Nov-2019::17:57:06.439 NcsMain JVM-Launcher: - READ SOCKET =>
<INFO> 06-Nov-2019::17:57:06.439 NcsMain JVM-Launcher: - <= GOT DONE_LOADING
<INFO> 06-Nov-2019::17:57:06.439 NcsMain JVM-Launcher: - DONE LOADING -->
<INFO> 06-Nov-2019::17:57:06.439 NcsMain JVM-Launcher: - DONE LOADING --> OK
<INFO> 06-Nov-2019::17:57:06.439 NcsMain JVM-Launcher: - DONE COMMAND --> DONE_LOADING
<INFO> 06-Nov-2019::17:57:06.442 NcsMain JVM-Launcher: - READ SOCKET =>
<WARN> 06-Nov-2019::17:57:06.453 NcsMain JVM-Launcher: - CONTROL SOCKET CLOSED - HALTING
<ERROR> 06-Nov-2019::17:57:06.454 NcsMain JVM-Launcher: - Error in NcsMain mainLoop :
com.tailf.conf.ConfException: unexpected end of file
at com.tailf.conf.ConfInternal.readFill(ConfInternal.java:414)
at com.tailf.conf.ConfInternal.termRead(ConfInternal.java:184)
at com.tailf.conf.ConfInternal.termRead(ConfInternal.java:112)
at com.tailf.ncs.NcsMain.read(NcsMain.java:1451)
at com.tailf.ncs.NcsMain.mainLoop(NcsMain.java:653)
at com.tailf.ncs.NcsMain.run(NcsMain.java:489)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException
... 7 more
<WARN> 06-Nov-2019::17:57:06.471 NcsMain JVM-Launcher: - Stopping by System.exit()
<WARN> 06-Nov-2019::17:57:06.471 NcsMain JVM-Launcher: - NCS JVM STOPPED

 

And also I want to add here, as mentioned in below documents

https://www.tail-f.com/wordpress/wp-content/uploads/2014/12/ncs_getting_started.pdf

page no 87.

I have added below tag in ncs.conf 

<japi>

    <new-­session-­timeout>PT1000S</new-­session-­timeout>

    <query-­timeout>PT1000S</query-­timeout>

   <connect-­timeout>PT1000S</connect-­timeout>

</japi>

But still result is same. please help me resolve this issue.