Ошибка fatal error on startup

C# Visual Studio 2010 Express:

When my application starts up, even before showing my GUI, I get following error in a dialog box:

Fatal Problem: Value cannot be null.

Parameter name: source

This seems to be related to some user settings in the application.
I changed a setting type from String in StringCollection, but I am not sure this is the root cause. The name «source» does not ring a bell either.

Problem is that I cannot break the application to debug this error.
When I click OK, the application starts up, but the settings are all empty for some reason.

Thanks for your help

Davy

JaredPar's user avatar

JaredPar

729k148 gold badges1236 silver badges1452 bronze badges

asked Nov 17, 2010 at 22:53

Davy's user avatar

4

The best way to solve this is to use the debugger to find out where the exception is acutally coming from. To do this try the following

Disable Just My Code

  • Tools -> Options -> Debugger
  • Uncheck «Enable Just My Code»

Turn on first chance excepions

  • Debug -> Exceptions
  • Check «Thrown» for «Common Language Runtime Exceptions»

Then hit F5 to start debugging your application. This should give you a very good idea where the error is occuring and why.

answered Nov 17, 2010 at 23:03

JaredPar's user avatar

JaredParJaredPar

729k148 gold badges1236 silver badges1452 bronze badges

5

SOLVED:

I replaced following code, which loads my internal SrcPathList from the properties:

*SrcPathList = new List(Properties.Settings.Default.SrcPathList.Cast()); // From StringCollection to List*

With this:

if (Properties.Settings.Default.SrcPathList != null)
{
  SrcPathList = new List(Properties.Settings.Default.SrcPathList.Cast()); // From StringCollection to List
}
else
{
  SrcPathList = new List();
}

This solved the problem which was caused by loading an empty list causing a null value

Thank you all for your fast help!

answered Nov 18, 2010 at 7:38

Davy's user avatar

DavyDavy

1,7001 gold badge19 silver badges41 bronze badges

Turn on the setting to break on all exceptions, instead of just unhandled ones.

Execution will stop right at the point where the exception is thrown, instead of at the dialog.

You’re unlikely to be in the midst of your code, but you can look at the stack trace to work out what’s going on.

answered Nov 17, 2010 at 23:06

Bevan's user avatar

BevanBevan

43.5k10 gold badges81 silver badges133 bronze badges

i have a similar problem. Everytime i tried to run it, I receive a «fatal error on startup». And, followed by these words:

Java exception occurred: java. lang. ExceptionlnlnitializerError at com. mathworks. mde. desk. MLDesktop.<init>(MLDesktop. java:567)

at com. mathworks. mde. desk. MLDesktop. getinstance(MLDesktop. java:655)

Caused by: java. lang. NullPointerException at sun. awt. FontConfiguration. getVersion(FontConfiguration. java:1264)

at sun. awt. FontConfiguration. readFontConfigFile(FontConfiguration. java:219)

at sun. awt. FontConfiguration. init(FontConfiguration, java:107)

at sun. awt. Win32FontManager. createFontConfiguration(Win32FontManager. java:182)

at sun. font. SunFontManager$2. run(SunFontManager. java:431)

at java. security. AccessController. doPrivileged(Native Method)

at sun. font. SunFontManager.<init>(SunFontManager. java:376)

at sun. awt. Win32FontManager.<init>(Win32FontManager. java:89)

at sun. reflect. NativeConstructorAccessorlmpl. newlnstance0(Native Method)

at sun. reflect. NativeConstructorAccessorlmpl. newlnstance(NativeConstructorAccessorlmpl. java:62)

at sun. reflect. DelegatingConstructorAccessorlmpl. newlnstance(DelegatingConstructorAccessorlmpl. java:45)

at java. lang. reflect. Constructor. newlnstance(Constructor. java:423)

at java. lang. Class. newlnstance(Class. java:442)

at sun. font. FontManagerFactory$1. run(FontManagerFactory. java:83)

at java. security. AccessController. doPrivileged(Native Method)

at sun. font. FontManagerFactory. getlnstance(FontManagerFactory. java:74)

at java. awt. Font. getFont2D(Font, java:491)

at java. awt. Font. access$000(Font, java:224)

at java. awt. FontSFontAccesslmpl. getFont2D(Font. java:228)

at sun. font. FontUtilities. getFont2D(FontUtilities. java:180)

at sun. font. FontUtilities. fontSupportsDefaultEncoding(FontUtilities. java:338)

at com. sun, java. swing, plaf: windows. WindowsLookAndFeelSWindowsFontProperty. configureValue(WindowsLookAndFeel. java:2293)

at com. sun. java. swing. plaf. windows. DesktopProperty. createValue(DesktopProperty. java:154)

at javax. swing. UIDefaults. getFromHashtable(UIDefaults, java:231)

at javax. swing. UIDefaults. get(UIDefaults, java:161)

at javax. swing. MultiUIDefaults. get(MultiUIDefaults. java:64)

at javax. swing. UIDefaults. getFont(UIDefaults, java:388)

at javax. swing. UIManager. getFont(UlManager. java:672)

at javax. swing. LookAndFeel. installColorsAndFont(LookAndFeel, java:208)

at javax. swing. plaf. basic. BasicPanelUl. installDefaults(BasicPanelUl., java:66)

at javax. swing. plaf. basic. BasicPanelUL. installUI(BasicPanelUl, java:56)

at javax. swing. JComponent. setUI(JComponent. java:666)

at javax. swing. JPanel. setUI(JPanel. java:153)

at javax. swing. JPanel. updateUI(JPanel. java:126)

at javax. swing. JPanel.<init>(JPanel. java:86)

at javax. swing. JPanel.<init>(JPanel. java:109)

at javax. swing. JPanel.<init>(JPaneljava:117)

at com. mathworks. mde. explorer. Explorer.<clinit>(Explorer. java:156)

.2 more

Contents

  1. Introduction
  2. MATLAB R2014b on Ubuntu 14.04

    1. From ISO
    2. From Download
    3. Install
  3. MATLAB R2012a

    1. Important Note Regarding Ubuntu 12.04
    2. Important Note Regarding Student version (32-bit)
  4. Installation Instructions

    1. Basic
    2. Create A MATLAB Launcher/shortcut
    3. MEX functions

        1. Warning
    4. Troubleshooting

      1. No MATLAB bin directory for glnxa64

        1. Solution for the command line (CLI) launch
        2. Solution for the graphical (GUI) launch
      2. libc.so.6 not found
      3. libXmu.so.6 not found
      4. Java problems

        1. Source
      5. Matlab executable not in path
      6. Failure loading desktop class
  5. Previous Versions
  6. External Links

Parent page: Programming Applications

Introduction

MATLAB® is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C++, and Fortran.

You can use MATLAB in a wide range of applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. Add-on toolboxes (collections of special-purpose MATLAB functions, available separately) extend the MATLAB environment to solve particular classes of problems in these application areas.

MATLAB provides a number of features for documenting and sharing your work. You can integrate your MATLAB code with other languages and applications, and distribute your MATLAB algorithms and applications.

MATLAB R2014b on Ubuntu 14.04

From ISO

  • First, mount the .iso file of the image with right-click, Open with and select Disk image mounter (if required).
  • Open a terminal and change to the mounted image file. For example:
    • cd /media/username/MATHWORKS_R2014A

From Download

  • Download the install file from http://www.mathworks.com/downloads/

  • Unzip and open downloaded directoy

Install

  • Run the installer as a super user
    • sudo ./install
  • Follow the instructions of the installer and install in /usr/local/MATLAB/R2014a
  • To add an entry to the launcher and some other features, install the matlab-support package:
    • sudo apt-get install matlab-support
  • During the installation you have to confirm the installation path of matlab and could restrict the installation only to certain users (which I did not require). In addition you could rename the GCC libraries, but I had no problems so far so I didn’t deactivate those.
  • After completion, you have to change the ownership of the .matlab folder in the home folder to your own user account if you do not want to run Matlab as a super user.
    • sudo chown username -R ~/.matlab

Now Matlab should also be launchable through unity and should work as intended.

MATLAB R2012a

Important Note Regarding Ubuntu 12.04

MATLAB R2012a was released on March 1, 2012. Please note that this is prior to the release of Ubuntu 12.04. Consequently Ubuntu 12.04 is not a supported operating system for MATLAB R2012a as it can be seen in the MATLAB Roadmap.

MATLAB R2012a users are strongly encouraged to install R2012a on Ubuntu 10.04 LTS or Ubuntu 10.10 for best results. Help for the installation of MATLAB R2012a on Ubuntu 12.04 will however be given through this tutorial.

Important Note Regarding Student version (32-bit)

Unfortunately, 32-bit is the only version available to students.

If you have a 64-bit system, you will have some trouble but it is normally possible to go through each of them and the details are in the Troubleshooting section.

The following helps you be a length ahead of these problem. If you have a 64-bit system, you can still install 32-bit version of MATLAB. However, you will need to install the «ia32-libs» package before the installation. If you have Ubuntu 13.10 or later, check out this thread for more information.

Once it is installed, run the installer with the -glnx86 argument to force it to use 32-bit

sudo /media/MATHWORKS_R2012A/install -glnx86 -v

Though for R2012a it is not necessary anymore. If you don’t run it with the -glnx86 argument, MATLAB will just say

Could not find JRE for glnxa64.  Trying glnx86.

at the start of the installation. And it will use 32-bit.

Then, just follow the instructions of the Installation Instructions section.

After the installation, you will need to run MATLAB with the -glnx86 argument to force it to use 32-bit

matlab -glnx86

See the Troubleshooting section for more details on this.

Installation Instructions

Basic

  • You will need superuser privileges. The assumption is that MATLAB install files are located at /media/MATHWORKS_R2012a in your filesystem.

See the Troubleshooting section if you get into trouble during the installation.

1. Run the MATLAB installer with the following Terminal command (The -v argument is for the install script to be verbose which means, it is more likely to warn you if something weird happens):

sudo /media/MATHWORKS_R2012A/install -v

If it complains about java, try installing install »OpenJDK Java 6» package because MATLAB is not compliant with Java 7.

2. When prompted to ‘Choose installation type‘ you should select custom. This will allow you to create symbolic links to MATLAB in /usr/local/bin.

Choose installation type

3. When prompted to ‘Specify installation folder‘ it is recommended that you use the default folder /usr/local/MATLAB/R2012a (or the default /usr/local/MATLAB/R2012a_student if you have a student version).

Specify installation folder

If you have a student version, the default folder will be /usr/local/MATLAB/R2012a_Student.

4. When given the option to ‘Create symbolick links to MATLAB scripts in:‘ it is recommended that you check the box and use the supplied path /usr/local/bin.

Create symbolick links to MATLAB scripts in:

5. You can check that your installation work by executing the following command

matlab

See the Troubleshooting section if you get errors.

Create A MATLAB Launcher/shortcut

Automatic option: install package «matlab-support», sudo apt-get install matlab-support or via the Software Center on the dashboard.

Manual option as follows.

1. Get an icon:

sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png

2. Get the launcher file:

sudo wget 'https://help.ubuntu.com/community/MATLAB?action=AttachFile&do=get&target=matlab-r2012a.desktop' -O /usr/share/applications/matlab.desktop

If you have the student version of MATLAB (or simply the 32 bit version) on a 64 bit system, you will need to modify this file. Run

gksudo gedit /usr/share/applications/matlab.desktop

Then uncomment #Exec=matlab -arch=glnx86 -desktop and comment Exec=matlab -desktop (by adding or removing the # character).

If you get two MATLAB launcher icons in your Unity laucher, try uncommenting the following line in /usr/share/applications/matlab.desktop:

StartupWMClass=com-mathworks-util-PostVMInit

If your launcher does not work, see the Troubleshooting section.

MEX functions


Warning

The content of this section has been written for R2011a with Ubuntu 10.04 and 10.10. It may vary a lot if you are using the R2012a with Ubuntu 12.04.


If you try to compile MEX functions you may see a message like the following:

Warning: You are using gcc version "4.4.4-14ubuntu5)".  The version
         currently supported with MEX is "4.3.4".
         For a list of currently supported compilers see:
         http://www.mathworks.com/support/compilers/current_release/

Note this is a warning — the MEX function will still compile.

The following instructions will setup gcc 4.3 and make it the default compiler for MATLAB:

1. Install The GNU Compiler Collection 4.3 and The GNU Standard C++ Library

2. Make a MATLAB specific bin directory for gcc symlink.

mkdir ~/.matlab/bin

3. Symlink gcc to gcc-4.3 via user MATLAB specific bin directory.

ln -s /usr/bin/gcc-4.3 ~/.matlab/bin/gcc

4. Add MATLAB specific bin directory to the front of your system $PATH within your local startup.m file.

printf "setenv('PATH',sprintf('/home/%%s/.matlab/bin:%%s',getenv('USER'),getenv('PATH')));n" >> ~/Documents/MATLAB/startup.m

Steps 3 and 4 above may not work for at least one instance of a user trying to compile using MEX in MATLAB R2011a running on Ubuntu 10.10. An alternative is to do the following:

  • 3a. At the MATLAB Command Window prompt, type:
mex -setup

and choose option 2 which says:

 2: /usr/local/MATLAB/R2011a/bin/mexopts.sh :
      Template Options file for building MEX-files via the system ANSI compiler

This will copy to your home directory a local copy of the file mexopts.sh.

  • 4a. Then edit this local file:
sudo gedit ~/.matlab/R2011a/mexopts.sh

and replace all instances of CC=’gcc’ to CC=’gcc-4.3′, CXX=’g++’ to CXX=’g++-4.3′, and FC=’gfortran’ to FC=’gfortran-4.3′. Save and exit. The next time you run MEX in MATLAB to compile it will work properly.

For more ideas, try this thread or this one.

Troubleshooting

No MATLAB bin directory for glnxa64

If MATLAB tells you

    ---------------------------------------------------------------------------
    Warning: Cannot locate Java Runtime Environment (JRE) . . .

             1. Either a correct JRE was not available for redistribution when
                this release was shipped, in which case you should refer to the
                Release Notes for additional information about how to get it.

             2. Or you have tried to use the MATLAB_JAVA environment variable
                to specify an alternate JRE, but MATLAB cannot find it.  Please
                run 'matlab -n' to determine what value you are using for
                MATLAB_JAVA and fix accordingly.
    ---------------------------------------------------------------------------

    matlab: No MATLAB bin directory for this machine architecture.

           ARCH = glnxa64

when you launch it, you will need to force it to use glnx86.


Solution for the command line (CLI) launch

To do so, run

matlab -glnx86

If you like launching MATLAB from the command line, you will maybe find it inconvenient to write -glnx86 each time you need to launch it. You can then add it in your ~/.bashrc (at the end if you hesitate where to put it)

alias matlab='matlab -glnx86'

Solution for the graphical (GUI) launch

You will need to add the -glnx86 argument to matlab in the exec line of your file /usr/share/applications/matlab.desktop If you have followed the ‘Create a MATLAB Launcher’ section, you can just comment the line with the argument -glnx86 and uncomment the next line as explained in the file.


libc.so.6 not found

If you have Ubuntu 12.04 you like get the following error when running Matlab graphically:

/usr/local/bin/matlab: 1: /usr/local/MATLAB/R2012a/bin/util/oscheck.sh: /lib64/libc.so.6: not found

or

/usr/local/bin/matlab: 1: /usr/local/MATLAB/R2012a/bin/util/oscheck.sh: /lib/libc.so.6: not found

Matlab R2012a targeted Ubuntu 10.04 and so it’s looking for libc.so.6 in a different location then where is found under Ubuntu 12.04 LTS. This can be fixed by making two small changes to matlab’s oscheck.sh script.

sudo cp /usr/local/MATLAB/R2012a/bin/util/oscheck.sh{,.original}
sudo chmod 755 /usr/local/MATLAB/R2012a/bin/util/oscheck.sh
sudo nano /usr/local/MATLAB/R2012a/bin/util/oscheck.sh

Make these two edits:

Line #177

/lib/libc.so.6

becomes

/lib/i386-linux-gnu/libc.so.6

Line #184

/lib64/libc.so.6

becomes

/lib/x86_64-linux-gnu/libc.so.6

libXmu.so.6 not found

If you get

/usr/local/MATLAB/R2012a_Student/bin/glnx86/MATLAB: error while loading shared libraries: libXmu.so.6: cannot open shared object file: No such file or directory

just install the «ia32-libs» package.

Java problems

If you get

exec: 2433: /tmp/install.dir.880/Linux/resource/jre/bin/java: not found

or

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.awt.Component
        at java.lang.Class.forName0(Native Method)
        ...
Finished

during the installation or MATLAB fails at startup after the installation is complete, maybe you are trying to install a 32-bit version of MATLAB on a 64-bit system because you have the student version or for whatever reason (see Important Note Regarding Student version and How To Install 32-bit MATLAB on 64-bit system).

In order to do that, you need to install the «ia32-libs» package.

Source

http://www.mathworks.nl/support/solutions/en/data/1-C7174M/index.html?product=PB&solution=1-C7174M

Matlab executable not in path

If the matlab executable is not in your PATH, the matlab.desktop file needs to be edited. Replace

matlab -desktop

with the full executable path (default: /usr/local/MATLAB/R2012a/bin/matlab)

/usr/local/MATLAB/R2012a/bin/matlab -desktop

or you can add the Matlab bin folder in your path at login adding this line in your ~/.profile

PATH=$PATH:/usr/local/MATLAB/R2012a/bin

Failure loading desktop class

Fatal Error on startup: Internal Error: Failure occurs during desktop startup. Details: Failure loading desktop class.

That means Matlab has trooble loading the Java Virtual Machine. I solved it by asking him to use the jvm installed on Ubuntu and not the version shipped with MATLAB. So do

export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk-amd64/jre matlab

for 64 bit MATLAB (install install the «openjdk-7-jre» package first) and

export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk-i386/jre matlab -arch=glnx86

for the student version (install install the «openjdk-7-jre:i386» package first).

If it works, update the file /usr/share/applications/matlab.desktop accordingly, changing

Exec=matlab -arch=glnx86 -desktop

to

Exec=MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk-i386/jre matlab -arch=glnx86 -desktop

for example (for the student version).

Previous Versions

  • R2011a

  • R2010b

  • R2010a

  • R2009b

External Links

Compatibility information:

  • < http://www.mathworks.nl/support/sysreq/sv-r2012a/linux.html > — System Requirements — Release 2012a

  • < http://www.mathworks.com/support/compilers/R2012a/glnxa64.html > — Supported and Compatible Compilers – Release 2012a — Linux

For more information about MATLAB see the following links

  • < http://www.mathworks.com/ > — MathWorks — MATLAB and Simulink for Technical Computing.

  • < http://www.mathworks.com/products/matlab/ > — MATLAB — The Language Of Technical Computing

  • < http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html > — MATLAB Documentation.

  • < http://www.mathworks.com/support/ > — The MathWorks Support.

  • < http://www.mathworks.com/matlabcentral/ > — MATLAB Central.

  • < http://www.mathworks.com/matlabcentral/fileexchange/ > — MATLAB Central File Exchange.


CategoryScience

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

The R session had a fatal error.

2022-07-26T10:28:10.699854Z [rsession-ParmeshGajjar] ERROR system error 2 (The system cannot find the file specified) [path: C:/Program Files/RStudio/R/modules/SessionCpp.R]; OCCURRED AT class rstudio::core::Error __cdecl rstudio::r::SourceManager::sourceTools(const class rstudio::core::FilePath &) src/cpp/r/RSourceManager.cpp:45

The R session exited with code 2.

2022-07-26T10:27:54.106582Z [rsession-ParmeshGajjar] ERROR system error 2 (The system cannot find the file specified) [path: C:/Program Files/RStudio/R/modules/SessionCpp.R]; OCCURRED AT class rstudio::core::Error __cdecl rstudio::r::SourceManager::sourceTools(const class rstudio::core::FilePath &) src/cpp/r/RSourceManager.cpp:45; LOGGED FROM: int __cdecl rstudio::r::session::RReadConsole(const char *,char *,int,int) src/cpp/r/session/RStdCallbacks.cpp:299
2022-07-26T10:28:10.697854Z [rsession-ParmeshGajjar] ERROR system error 2 (The system cannot find the file specified) [path: C:/Program Files/RStudio/R/modules/SessionCpp.R]; OCCURRED AT class rstudio::core::Error __cdecl rstudio::r::SourceManager::sourceTools(const class rstudio::core::FilePath &) src/cpp/r/RSourceManager.cpp:45; LOGGED FROM: int __cdecl rstudio::r::session::RReadConsole(const char *,char *,int,int) src/cpp/r/session/RStdCallbacks.cpp:299
2022-07-26T10:28:10.697854Z [rsession-ParmeshGajjar] ERROR system error 2 (The system cannot find the file specified) [path: C:/Program Files/RStudio/R/modules/SessionCpp.R]; OCCURRED AT class rstudio::core::Error __cdecl rstudio::r::SourceManager::sourceTools(const class rstudio::core::FilePath &) src/cpp/r/RSourceManager.cpp:45; LOGGED FROM: int __cdecl rstudio::r::session::RReadConsole(const char *,char *,int,int) src/cpp/r/session/RStdCallbacks.cpp:299

RStudio Edition : <!-- Desktop or Server -->
RStudio Version : 
OS Version      : 
R Version       : 

Мне едва удалось установить MATLAB, но я думаю, что он установлен правильно. Тем не менее, когда я cd к bin каталог и запустить ./matlabпоявляется логотип MATLAB, но затем он снова мгновенно закрывается, и я получаю сообщение об ошибке:

License checkout failed. License Manager Error -2 

Make sure that the formatting of the license file is correct. When editing the license file use a basic text editor.
Troubleshoot this issue by visiting: http://www.mathworks.com/support/lme/R2012b/2

Diagnostic Information: Feature: MATLAB 

License path: /home/x/.matlab/R2012b_licenses:/home/x/MATLAB1/licenses/license.dat:/home/x/MATLAB1/licenses/network.lic 

Licensing error: -2,413. System Error: 2 ~/MATLAB1/bin$ ./matlab Fatal Error on startup: 

Cannot locate com/mathworks/jmi/OpaqueJavaInterface class

Я посмотрел на решение, предписанное на веб-сайте MathWorks, но мне трудно понять, что делать. Я использую 64-битную Ubuntu 12.10.

Благодарю.

2013-02-03 01:43

2
ответа

Исходя из сообщения об ошибке, вы должны поместить файл лицензии в следующую папку

Путь лицензии: /home/x/.matlab/R2012b_licenses:/home/x/MATLAB1/licenses/license.dat:/home/x/MATLAB1/licenses/network.lic


tndoan

03 авг ’13 в 09:21
2013-08-03 09:21

2013-08-03 09:21

Я решил эту проблему, фактически проверив, что у меня есть правильная лицензия. Оказалось, у меня был другой network.lic, и поэтому мой предыдущий network.lic не работал. Я открыл его и скопировал тот же компьютер, который был у другого компьютера в здании, и он работал нормально.

2015-09-22 22:42

Don’t worry, fix is very easy.

I had the same problem, just go to Defend Center.

from home:

1. Choose «Virus and threat protection».

2. Choose :»Virus and threat protection settings».

3. Scroll down to «Controlled folder access», click «Manage Controlled folder access».

4. Click «Allow an app through Controlled folder access».

5. Click «Add an allowed app».

6. Navigate to your Adobe Audition Installation Folder, default is: «C:Program FilesAdobeAdobe Audition CC 2018».

7. Choose «Adobe Audition CC.exe» (the app).

8. Click ok (or open etc.,).

9. That’s it!

10 or u can simply turn «Controlled folder access» off at steps 3, after u click «Manage Controlled folder access».

if the problem is still there and u have an Antivirus, check for similar setting in your antivirus.

Hope that Helps!

Понравилась статья? Поделить с друзьями:
  • Ошибка fatal error maximum execution time of
  • Ошибка fatal error loading pixel shader
  • Ошибка fatal error has occurred this connection is terminated
  • Ошибка fatal error failed to load il2cpp
  • Ошибка fatal error failed to initialize