# OpenNMS port



## pathiaki (Dec 1, 2014)

Hi, 

I'm trying to port the OpenNMS software, version 1.14, to FreeBSD 10.x.

It seems that there's a problem with it interacting with OpenJDK 1.7.  The OpenNMS project uses Oracle JDK 7.  I'm having problems in that the product builds and installs correctly.  It runs for about one to three hours and crashes. The crash seems to be caused by Java running away and consuming all the memory and the OS killing it before the machine wedges.

The backtrace on the java.core file implies the above. Could someone assist me in finding out what is wrong?  I've looked at all the 'large' monitoring tools and they are convoluted, or a PITA to configure.  OpenNMS is pretty straightforward and highly intelligent.

Could someone help me debug this?

Thank you,

P.


----------



## SirDice (Dec 2, 2014)

Have you tried running it on java/linux-sun-jdk17? It might be a problem with OpenJDK itself.


----------



## pathiaki (Dec 2, 2014)

SirDice said:


> Have you tried running it on java/linux-sun-jdk17? It might be a problem with OpenJDK itself.



Yes, I tried to do the Linux versions. There are problems no matter what I try. All of them want the Fedora 10 base, however, that base requires the Linux expat which is marked as FORBIDDEN. (I tried commenting out the FORBIDDEN line in the Makefile and it still won't download.) Do you have a workaround for this?

Otherwise, there are no Linux versions of Oracle Java at this point.

Thank you,

P.


----------



## SirDice (Dec 2, 2014)

pathiaki said:


> All of them want the fedora 10 base, however, that base requires the linux expat which is marked as FORBIDDEN.  (I tried commenting out the "Forbidden" line in the Makefile and it still won't download)  Do you have a workaround for this?


From /usr/ports/UPDATING:

```
20140922:
  AFFECTS: users of emulators/linux_base-f10 and emulators/linux_base-c6
  AUTHOR: xmj@FreeBSD.org

  The complete drop-in replacement linux-c6 port infrastructure is in ports
  and will shortly replace the current linux-f10- ports as default.

  To switch to the linux-c6 infrastructure you should:

  0. Backup all your vital information!
  1. Remove the current linux base port and all linux-f10- ports.
  2. Add the following lines to /etc/make.conf:
       OVERRIDE_LINUX_BASE_PORT=c6
       OVERRIDE_LINUX_NONBASE_PORTS=c6
  3. Make sure no linux application is running.
  4. Set appropriate sysctl (compat.linux.osrelease=2.6.18).
  5. Install emulators/linux-c6.

  That should be enough in most circumstances. If you experience difficulties,
  please be sure to expand step 1 to:

  1a. Remove all ports which depend on linux base port.
  1b. Remove linux base port.
  1c. Clean /compat/linux/ directory.

  Should you encounter any other difficulties not fixed by these extended
  steps, please submit an issue report in Bugzilla and send an email to FreeBSD's
  emulation@ mailing list.
```


----------



## pathiaki (Dec 2, 2014)

SirDice said:


> From /usr/ports/UPDATING:
> 
> ```
> 20140922:
> ...



Well, number one I should have updated my ports recently and I would have seen this.   Thank you, for that.

I went through the entire set of instructions.  Wow, that's a log of RPMs.  After this was installed, I installed the java/linux-sun-jdk17 port. I tried running this: `/usr/local/bin/java --version`. I got:

```
java: error: no suitable JavaVMs found
```
`pkg info | grep java`

```
java-zoneinfo-2014.j           Updated Java timezone definitions
javavmwrapper-2.5              Wrapper script for various Java Virtual Machines
jicmp-1.4.3                    Java native interface (JNI) to ICMP (ping)
jicmp6-1.2.3                   Java native interface (JNI) to ICMPv6
jrrd-1.0.7                     Java native interface (JNI) to RRDtool
linux-sun-jdk17-7.71           Oracle Java 7 Development Kit for Linux
```
I checked the permissions on /usr/local/linux-sun-jdk1.7.0  and everything below it:

```
total 19948
    9 drwxr-xr-x   8 root  wheel        15 Dec  2 22:29 .
    9 drwxr-xr-x  14 root  wheel        14 Dec  2 22:29 ..
    5 -r--r--r--   1 root  wheel      3339 Sep 27 00:15 COPYRIGHT
    5 -r--r--r--   1 root  wheel        40 Sep 27 00:15 LICENSE
    5 -r--r--r--   1 root  wheel       114 Sep 27 00:15 README.html
  109 -r--r--r--   1 root  wheel    110114 Sep 26 20:49 THIRDPARTYLICENSEREADME-JAVAFX.txt
  265 -r--r--r--   1 root  wheel    173559 Sep 27 00:15 THIRDPARTYLICENSEREADME.txt
    9 drwxr-xr-x   2 root  wheel        49 Dec  2 22:29 bin
    9 drwxr-xr-x   4 root  wheel         9 Dec  2 22:29 db
    9 drwxr-xr-x   3 root  wheel        10 Dec  2 22:29 include
    9 drwxr-xr-x   6 root  wheel        12 Dec  2 22:29 jre
    9 drwxr-xr-x   5 root  wheel        16 Dec  2 22:29 lib
    9 drwxr-xr-x   4 root  wheel         5 Dec  2 22:29 man
    5 -r--r--r--   1 root  wheel       498 Sep 27 00:17 release
19489 -r--r--r--   1 root  wheel  19913003 Sep 27 00:16 src.zip
```

Does anyone see anything that I'm not?

Thank you,

P.


----------



## pathiaki (Dec 15, 2014)

Hi,

Well, there's two things going on.  The OpenNMS people were REALLY helpful in helping me to track this down.  There's a couple of issues that were problems.

First, we tried OpenJDK 1.7 and FreeBSD 10.x, it crashes in the same manner as before.  (They have added a lot of fixes to properly detect FreeBSD versus Linux install, but the crash seems to be coming from OpenJDK 1.7)

Second, we tried the Linuxulator with CentOS 6.6 (as above - Thanks, Sir Dice!), and they got an epoll crash which kind of confused me as I thought this was in 10.0.  It turns out it was pulled as an improvement and will be put in the new 64-bit linuxulator based on CentOS 6.x or, possibly, CentOS 7.x.  So, no epoll for the linux-sun-jdk 1.7 to call makes it crash.

I'm going to the FreeBSD Java people next and will post back later as soon as this is solved.  This seems like OpenJDK 1.7 has a bug which needs correcting.  OpenNMS does start and work with it for 15 minutes to as long as 3 hours, but then bombs out.

FYI,  

(Rages at the code, breaks his chains and moves forword to conquer the beast.......  )

P.


----------

