FAQ
Answers to Frequently Asked Questions (FAQ) about
NeXtMidas are organized into the following categories:
-
How do I increase Java's memory size for my application?
-
To increase either the Java Virtual Machine's (JVM) initial (heap) memory and maximum (heap) memory size:
JVM memory modifying arguments (-Xms
for initial heap size; -Xmx
for maximum heap size)
are specified in the NM_USER_JVM_FLAGS
environment variable. These examples
increase initial memory to 128 MB and maximum memory to 256 MB:
- Unix (C-shell)
setenv NM_USER_JVM_FLAGS "-Xms128m -Xmx256m"
- Unix (Bash)
export NM_USER_JVM_FLAGS="-Xms128m -Xmx256m"
- Windows
set NM_USER_JVM_FLAGS=-Xms128m -Xmx256m
- When I run the
CONFIDENCE
tests after installing
NeXtMidas I get a number of "Could not find file" errors and failed
tests. Is there something wrong?
-
Many tests rely on the first disk auxiliary (
AUX
) for
the read/write tests. By default this is set to /midas/data1/+/
(NeXtMidas translates the "+
" to be your user name). If this
directory does not exist, or you do not have read/write permissions for it,
you need to change the value of AUX.1
. To do this, create a
nmstartup.mm
file (which NeXtMidas
automatically loads at startup) that looks similar to this:
startmacro
info "Loading Personal Startup File"
set U:AUX.1 "/midas/data1/+/"
endmacro
Substitute the /midas/data1/+/
for the location of your data file directory.
(See $NMROOT/nxm/sys/cfg/nmstartup.mm
for details.)
- Why do I get the following error when I start NeXtMidas?
Shell.loadLibrary err: java.lang.UnsatisfiedLinkError:
/home/smith/nxm284/nxm/sys/lib/Native_lin.so: cannot
open shared object file: No such file or directory.
-
First verify that the file exists, if it does not exist then either
NeXtMidas did not build properly (unlikely) or someone deleted the file,
the fix is to rebuild NeXtMidas. If the file does exist then there are two
probable causes:
- NeXtMidas was built using another system (usually via a NFS mount or
a shared drive) and the resulting binaries are incompatible with your
OS, or
- NeXtMidas was built with an unsupported version of Java, please see
the NeXtMidas release notes for more details.
- Check to see that the copy of the JDK installed matches the hardware
(i.e. a 32-bit version of the JDK will not work properly on a 64-bit
system -- if you copied the JDK from another platform this may be the
problem).
-
I have NeXtMidas versions 1.8.2 and 1.9.2 installed on my system, but when I
switch between the two I get strange errors. Can I safely use both versions
of NeXtMidas at the same time?
-
Yes. There should be no problem with using multiple versions of NeXtMidas at
the same time, however it is highly recommended that you open separate
xterm/console windows for each version of NeXtMidas. Using separate windows
for each version of NeXtMidas will avoid any conflicts between the
environment settings used by each of the versions.
Also be careful when changing the setting of $NMROOT
since some
shells will not properly update your alias for nmstart
.
-
When using NeXtMidas in Windows, can I install NeXtMidas on one drive and
store my data files on another drive?
-
Yes. However, NeXtMidas assumes the drive letters are the same
(unless otherwise specified) and you need to tell NeXtMidas which drives
to use. To do this, create a
nmstartup.mm
file (which NeXtMidas automatically loads
at startup) that looks similar to this:
startmacro
info "Loading Personal Startup File"
set U:AUX.1 "Z:\midas\data1\+\"
set U:AUX.9 "C:\midas\icedisk\"
endmacro
Note: This is identical to the lines in
$NMROOT/nxm/sys/cfg/nmstartup.mm
except for the addition of the
drive letters.
- With what versions of Java is NeXtMidas compatible?
- This is listed at the top of the release notes for each version of
NeXtMidas. In general, NeXtMidas should be run with the most up-to-date
Java version in order to take advantage of critical security patches
that affect Java instances.
- Why did my performance dramatically change from one Java to the next?
- Generally the latest Java version will outperform older ones, but specific
Java updates may contain both performance benefits in some areas and
performance degradation in other areas. For example, Java 7 update 80
(Java 7u80) performs significantly slower for some interactions with
KeyObject compared to Java 7 update 79 (Java 7u79); at the same time Java
7u80 performs significantly better for other interactions with KeyObject
than Java 7u79. At the same time, the performance with Java 8 update 65
(Java 8u65), the most recent Java release at the time of the testing,
performed significantly better than either Java 7u79 or Java 7u80 for
both sets of KeyObject interactions.
- Can I use IBM's Java compiler with NeXtMidas?
- Some users have been successful with IBM's version of the JDK on RedHat
Linux. However, the NeXtMidas developers can only officially support the
versions from Oracle (formerly Sun Microsystems)
(http://java.oracle.com).
The only exception to this is the JDK for the Tru64 platform (which is
only released on the Tru64 web site).
- Which C/C++ compiler should I use when building native code for NeXtMidas?
- Most widely-available C/C++ compilers work. NeXtMidas uses the GNU C
Compiler (gcc) as the default compiler on Linux and Solaris. Most
Linux users will find that
gcc
comes pre-installed with their
version of Linux. The GNU C Compiler is available for most platforms from
http://gcc.gnu.org/ at no cost.
- Which Fortran compiler should I use when building host primitives for
NeXtMidas?
- Please see the XBC section in the NeXtMidas
User's Guide for details.
- My Unix system does not have a C/C++ compiler installed, can I still install
and run NeXtMidas on this system?
- Yes. Before running
nmstart
, change the
nmmake.bldswitches
property in
$NMROOT/nxm/sys/cfg/build.props
to
/DONATIVE=FALSE
, and set the environment variable
$NM_USER_JVM_FLAGS
to NONATIVE=TRUE
. This will
enable you to compile and run NeXtMidas in "No Native" mode where only the
Java libraries are used.
- When I try to run NeXtMidas on my Unix system with C-Shell, I receive an error
that a "variable name is too long". How do I resolve this error?
- The cause of this error is due to a environment variable name character
limit (16) in some versions of
csh
.
In order to resolve this issue, you will need to redirect csh
to use tcsh
, which does not have said character limit.
$ cd /bin
- Make a copy of the original
csh
.
$ cp -p csh csh.orig
- Create a symbolic link from
csh
to tcsh
.
$ ln -s tcsh csh
- Ensure that the symbolic link was created properly.
$ ls -l *csh
- You should now see that the
csh
script points to tcsh
.
Rerun NeXtMidas.
- When I try to run NeXtMidas, I receive an error that says there is an
"Exception in thread "main" java.lang.UnsupportedClassVersionError: NmClassLoader : Unsupported major.minor version 52.0" -or-
"Exception in thread "main" java.lang.UnsupportedClassVersionError: nxm/sys/lib/Shell : Unsupported major.minor version 51.0"
How do I resolve this error?
- The cause of this error is when you are trying to downgrade to a lower Java
version after having built NeXtMidas with a higher Java version.
e.g. You initially built NeXtMidas with Java Development Kit (JDK) 8 (creates class file version 52.0)
and are now trying to run it with Java 7 (supports running class file version 51.0 or lower)
or with Java 6 (supports running class file version 50.0 or lower).
NeXtMidas 3.5.3 and later no longer specifies the -source and -target compiler options per DR 845590-1 (Bug 2882),
so you MUST build NeXtMidas with your lowest desired JDK.
To fix this on NeXtMidas 3.5.4 and later versions, please execute the commands below.
$ nm make clean all
$ nm make all
- When I move a feature (see code below) in NeXtMidas 2.3.0 it draws the feature
in the new location, however it is still drawing the feature in the old location.
What's wrong with my feature, I thought this worked in NeXtMidas 2.1.0?
nM> plot/bg world
nM> feature label=v1 plot=plot table={NAME="V3",TYPE=SYMBOL|TEXT,
COLOR=green,ENABLE=ALL,LINE={SYMBOL=CROSS}}
nM> set V1.x 36.0
nM> set V1.y 24.0
-
Nothing is wrong, this is the expected behavior.
-
The reason it shows up now and not in earlier versions of NeXtMidas is because an additional
ENABLE
flag (BSTORE
) was implemented in the newer releases of
NeXtMidas. The new flag is off by default, but when ENABLE=ALL
is used it becomes
enabled. If you had used ENABLE=DEF
to enable only the default options, the
behavior would match older versions of NeXtMidas (i.e. using ENABLE=DEF
is
backwards-compatible, ENABLE=ALL
is not).
-
The
BSTORE
option (which is enabled in this case) tells PLOT
to put
the feature into the backing store. This increases the performance of PLOT
by
reducing the frequency of redraws for items in the backing store. Since the backing store is
used for things that do not change or change infrequently, it is the user's responsibility to
force the backing store to redraw when something changes in it (one way to do this is by
calling the MPlot.resize()
method).
- When I download a file via HTTP I don't always get the entire file. The amount of the file
that I get is unpredictable. I can load the file in a web browser, what's wrong?
-
The HTTP response can have the
content-length
specified. By default Java checks
this (see java.net.URLConnection.getContentLength()
) and tries to download that
number of bytes.
-
If the
content-length
is not specified it will try to download as much as
it thinks it needs (which is usually not enough). If the content-length
is
incorrect, unpredictable behavior may be observed and it is possible that an exception may
be thrown.
-
Unfortunately bad or missing
content-length
values are seen all-too-often on the
web. As such, most web browsers try to take this into account (though at the expense of speed).
(In the future we may provide an option for this in NeXtMidas.)
-
The easiest fix (provided you are able to alter the server) is to provide accurate
content-length
values.
- I created a file using NeXtMidas that X-Midas doesn't understand. For example, I get an
"incorrect number of bytes read" error message when I try to datalist or xdatalist the file.
Is this a bug?
-
This is an X-Midas bug present in older versions of X-Midas. A version of the bug is present
in X-Midas up to version 4.5.4. Old versions of X-Midas try to read the file
in exact 512-byte blocks. Newer versions can handle files that are not organized exactly into 512-byte
blocks, but have problems with files that start out a non-integral multiple of 512-bytes, and
then have data records removed from them. A quick workaround for this issue is to add a keyword to
the offending file (see Keyword), which adds an
extended header block to the end of the file thereby forcing
it to a multiple of 512-bytes. The Midas Blue File specification
(Midas BLUE File Format / Version 1.1.0
(CCD-2006002-1.1.0)) does not require files to be padded out to 512-byte multiples,
thereby boosting performance and using less disk space.
- I had a large file called
myfile.prm
and then used NOOP
to copy a
smaller file over top of it. When I do a ls
in the Unix shell it says that
myfile.prm
is still big. What is wrong?
-
Nothing is wrong. It is standard practice for Midas frameworks (X-Midas, NeXtMidas, and others)
to write a new file over top of an older file with the same name. When it does this it does not
delete the old file first, leaving the old space allocation (on disk) intact. This is done
for historical reasons and because it improves disk-access time for some applications.
- I have a file with a strange file name like
data_2007:12:07::23:09:18.tmp
, I can
read it in X-Midas, but not in NeXtMidas, what is wrong?
-
The use of special characters in the file name is causing problems. In this case the colon
is making it look like a URL with a protocol of
data_2007:
. You can work around
this by prefixing it with a protocol identifier. For example, use
file:data_2007:12:07::23:09:18.tmp
when accessing the file.
- Can I use my X-Midas host primitives with NeXtMidas?
- Yes! The XBC option tree for NeXtMidas lets you use most
X-Midas primitives as-is (without modifying any Fortran code).
- Can I use my X-Midas macros with NeXtMidas?
- Not at this time.
- Can I use my NeXtMidas macros with X-Midas?
- Yes! Please see the NeXtMidas
as an X-Midas Option Tree section in the NeXtMidas User's Guide
for details.
- Can I use my NeXtMidas primitives with X-Midas?
- Yes! Please see the NeXtMidas
as an X-Midas Option Tree section in the NeXtMidas User's Guide
for details.
- I am familiar with the X-Midas commands. How do I use them in NeXtMidas?
- Look at the X-Midas To
NeXtMidas Command Mapping section.
- I know how to use NeXtMidas commands. How do I use them in X-Midas?
- Go to the NeXtMidas To
X-Midas Command Mapping section.
- When I change directories in X-Midas, NeXtMidas doesn't seem to see to
see the updates, as in this example:
X-Midas> nm/on/bg/id=999
X-Midas> nm res aux.0
S: AUX.0 = /home/xmmgr/temp/
X-Midas> cd /my/data/
X-Midas> aux/list
Path(0) =/my/data/>
Path(98) = /home/xmmgr/
Path(99) = /home/xmmgr/xm-4_14_0/xm/dat/
X-Midas> nm res aux.0
S: AUX.0 = /home/xmmgr/temp/>
Why is that?
- When X-Midas launches a process in the background (such as NM), it uses
the current working directory for that process. When the user does a
cd to change the current working directory, that only affects
new processes, it does not affect those processes already running. The
easiest way around this is to use an AUX other than AUX 0 (or CWD).
- When I run a NeXtMidas WebStart application, I get a "Security Warning"
that says the application wants "access to your local machine and
network." What should I do?
- This is a normal security warning telling you that NeXtMidas will use the
local system to store files, etc. When this warning message appears, just
click "Start."
- I installed the Java Development Kit on my Linux system, but
Netscape doesn't recognize the plug-in. What's wrong?
-
Before Netscape, Mozilla, or Firefox can see the plug-in, most Unix systems
require a symbolic link to be made so the browser can see the plug-in. The
Browsers section explains how to do this.
- Can I use native libraries (C/C++/Fortran) with WebStart?
- No, only Java classes can be used.
- Do different applications using same JAR file download the file again?
- Each JAR is identified with its source URL and will be cached and shared.
For more information see
http://docs.oracle.com/javase/8/docs/technotes/guides/javaws/developersguide/faq.html#s205
- My NeXtMidas application works fine from the OS shell or NeXtMidas shell, but why does it crash with
an OutOfMemoryError when run from Java Web Start?
- Try increasing your JVM's maximum (heap) memory size. The default maximum amount of memory in Java Web Start is 64 MiB.
To increase the memory for the Java Web Start application, set the
max-heap-size
attribute of your j2se
element under the resources
element in your applications's JNLP file.
You can also set the initial memory size (which defaults to 16 MiB) via the initial-heap-size
attribute.
For example, to set initial memory to 128 MiB and maximum memory to 256 MiB:
<jnlp>
...
<resources>
<j2se version="1.7+" initial-heap-size="128m" max-heap-size="256m"/>
<jar href="nxm-sys.jar" main="true"/>
<jar href="nxm-map.jar"/>
</resources>
...
</jnlp>
For more information see
http://www.oracle.com/technetwork/java/javase/javawebstart/index.html
Another JNLP tag reference
http://lopica.sourceforge.net/ref.html
- I setup Apache for NeXtMidas and when I access the
NMROOT
URL in my browser, I get this error:
"You don't have permission to access /nmroot/ on this server."
What is wrong?
- Sounds like a permissions problem in one or more of the directories to
get to
NMROOT
. Try setting each permission to be readable
and executable by user/group/other.
- Why do I get the error "The requested URL /nmroot was not found on
this server" when I access NeXtMidas on an Apache server?
- You probably forgot the slash (/) at the end of the URL
(i.e.,
http://<myserver>/nmroot/
).
- I setup Apache for NeXtMidas and when I run the
TEST_CGI
macro in nxm.sys.test
I get this error:
"...Server returned HTTP response code: 500...." The
ScriptAlias
directive in my Apache configuration file is
correctly pointing to nxm.sys.test
error. What's wrong?
- Most likely, Apache is unable to execute the CGI scripts used by the
TEST_CGI
macro. The CGI scripts must be executable. To
fix this in a Unix shell, set the scripts used by TEST_CGI
to be executable:
$ cd $NMROOT/nxm/sys/test
$ chmod a+x *.sh
- After NetBeans completes "Scanning Project Classpaths" a red
error message appears in the status bar. Why?
- There are two possible causes:
-
NetBeans does not support the use of "recursive links" (a link that
points to a parent directory). For example, an option tree
OPT
with a nxm
directory containing a link
to opt
(i.e. opt/nxm/opt -> opt
)
causes problems for NetBeans and results in an error message similar to:
"nxm/opt/nxm/opt/nxm/opt/nxm/opt/nxm/opt
". Any similar links
need to be removed.
-
Or, you do not have the proper permissions to read/write
all of the files in (and below) the NeXtMidas directory. In Unix,
try the following:
$ cd $NMROOT
$ chmod -R ug+rwX *
If you continue to have problems, contact your system administrator.
- When I open a frame I previously created in NetBeans, or create a new
frame and add a MidasDisplay to it, a red error message appears in the
NetBeans status bar. Why?
- NetBeans is unable to read the JAR file the widgets are in. Here's the fix:
-
Recompile NeXtMidas:
$ nm make clean all
$ nm make all all
-
Re-register the NeXtMidas widgets in NetBeans (go to
Registering the NeXtMidas Widgets).
If this fails, verify that you have the proper permissions for accessing the
NeXtMidas files and the NeXtMidas JAR file.
- I created a new GUI form in NetBeans (following the instructions in
Using NetBeans with NeXtMidas ), but
after clicking "Next" in the "New File" window NetBeans just sat there for
several minutes. Why?
- We have only reproduced this problem when running NetBeans from
a network-mounted drive (i.e. NetBeans is not installed on the local
system). The only suggestions we can offer are (1) wait or (2) try
installing NetBeans on the local system.
- Can I build NeXtMidas classes within NetBeans?
- Building NeXtMidas requires several steps that NetBeans is unaware of.
Files compiled within NetBeans may not work properly. (Hopefully, this
will change in the future.)
- Is an Ant build file available for NeXtMidas?
- No, but this is on our "wish list" for a future release.
- Can I add the NeXtMidas valuator widget to my palette in NetBeans?
- This capability is currently being worked on and will be included in
an upcoming release of NeXtMidas.
- NetBeans says I should put my source files in a directory
separate from my compiled class files. How do I do this?
- This isn't necessary if you created your NeXtMidas project in
NetBeans following the steps outlined in
Starting a Project in NetBeans.
- Can I use [Advanced NetBeans Feature] with NeXtMidas?
- Possibly. NetBeans has many advanced features which we have not
properly checked yet for compatibility with NeXtMidas. If you
use [Advanced NetBeans Feature] with NeXtMidas, please provide us
an outline of what was done and we will make it available for
other users.
- When I try to run my Primitive command, I get the following error (InvocationTargetException and NoClassDefFoundError):
nM> mycommand
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Caused by: java.lang.NoClassDefFoundError: nxm/myopt/prim/mycommand (wrong name: nxm/testopt/prim/mycommand)
at java.lang.ClassLoader.defineClass1(Native Method)
...
at nxm.sys.lib.Shell.getCommandForClassName(Shell.java:826)
at nxm.sys.lib.Shell.loadCommand(Shell.java:780)
..R
-
The primitive is in the wrong package (it should be in "nxm.myopt.prim") (i.e. near the first line of mycommand.java
make sure you have
package nxm.myopt.prim;
and NOT package nxm.testopt.prim;
.
-
Or, you have defined the name of the option tree incorrectly. I.e. in this case the "MYOPT" option tree
should be defined as "TESTOPT".