IBM Support

Profile creation: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EFactory error using manageprofiles command

Troubleshooting


Problem

While attempting to create a profile using the manageprofiles command, the WebSphere Application Server V7.0 profile tool prints a message which includes a reference to this error message: NoClassDefFoundError: org/eclipse/emf/ecore/EFactory.

Symptom

This issue occurs when using the command-line profile creation tool
(manageprofiles.sh or manageprofiles.bat) in WebSphere Application Server V7.0.

Immediately after running the command, it produces an error, and the command has no effect. Here is an excerpt of the error which is printed to the console. The particularly relevant portion is in bold text:

java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0

(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke

(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke

(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke

(Method.java:597)
......
Caused by: java.lang.
NoClassDefFoundError: org/eclipse/emf/ecore/EFactory
java.lang.ClassLoader.defineClass1

(Native Method)
java.lang.ClassLoader.defineClass

(ClassLoader.java:621)
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass

(DefaultClassLoader.java:160)
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass

(ClasspathManager.java:550)


The log generated by this failed profile creation attempt is located in <product_root>/logs/manageprofiles, and is named <profile_name>_create.log. The log contains the error printed above.

This particular error also causes a different log file to be generated. This other log file is not normally significant in profile creation issues, but it is particularly significant for this error. The log file is located in <product_root>/configuration, and the file name is a large number, such as "125196154191846980.log". This log contains more information which is relevant to the true root cause of the problem.

Caused by: java.lang.IllegalStateException: The platform metadata area could not be written:
<user_home>/workspace/.metadata.  By default the platform writes its content under the current working directory when the platform is launched.  Use the -data parameter to specify a different content area for the platform.
org.eclipse.core.internal.runtime.DataArea.assertLocationInitialized
(DataArea.java:55)
org.eclipse.core.internal.runtime.DataArea.getStateLocation
(DataArea.java:77)

In the actual error message, the <user_home> is printed as the full path to the home directory of the user running the manageprofiles process.

Note that the error message mentions a "-data" parameter, suggesting that the parameter could be used to resolve the problem. This error message is generated internally by the framework which the profile tools use, and so that suggestion cannot help resolve this particular problem. Disregard that part of the error message.

Cause

The manageprofiles tool requires write access to the operating system's user home directory. The manageprofiles tool needs to write some temporary files to that location, and the tool cannot start up if it cannot write the temporary files. (The temporary files are related to the OSGI Framework used by the product.)

Diagnosing The Problem

The first error message listed in the previous section mentions a "NoClassDefFoundError" exception. Normally, these kinds of errors occur when a product file (a class) is missing, or if the CLASSPATH variable is set incorrectly. That is not the case here. Instead, the error is caused because the foundational framework used in profile creation does not initialize itself properly. The second error message listed above explains the initialization error. As a result of the framework error, the profile tool is unable to load its classes properly, and declares a "no class definition found" error.

Resolving The Problem

Be sure to check both of the logs described in the "Cause" section above. The "NoClassDefFoundError" exception can occur for different reasons, so it is necessary to confirm the symptoms by checking the second log mentioned there.

To resolve this issue, be sure that the user which is trying to create profiles has a home directory which exists, and also has proper permissions to write to that directory.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Install","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
23 June 2018

UID

swg21408906