Getting "java.lang.NoClassDefFoundError: javax/mail/Address" while building EAR with studio-tools command.

Getting "java.lang.NoClassDefFoundError: javax/mail/Address" while building EAR with studio-tools command.

book

Article ID: KB0091165

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
============
Getting "java.lang.NoClassDefFoundError: javax/mail/Address" while building EAR with studio-tools command.

Environment:
============
TIBCO BusinessEvents 4.0.2

Symptoms:
=========
While building EAR with studio-tools command, EAR is built successfully but the following exception is thrown:
>>>>>>>>>>>>>>>>>>>>
Failed to fully load function catalog 'BRMS', moving on to next catalogs.
java.lang.NoClassDefFoundError: javax/mail/Address
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.tibco.cep.datamodeling.DefaultFunctionCatalogProvider$1.getClass(Unknown Source)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunction(JavaStaticFunctionsFactory.java:231)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCategory(JavaStaticFunctionsFactory.java:188)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCategory(JavaStaticFunctionsFactory.java:182)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCatalog(JavaStaticFunctionsFactory.java:142)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunctionCategoriesFromDocument(JavaStaticFunctionsFactory.java:124)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunctionCategoryURLs(JavaStaticFunctionsFactory.java:99)
        at com.tibco.cep.rt.functions.AbstractFunctionCatalogProvider.loadCatalogs(Unknown Source)
        at com.tibco.cep.datamodeling.DefaultFunctionCatalogProvider.loadCatalogs(Unknown Source)
        at com.tibco.cep.studio.parser.semantic.FunctionsCatalogManager.getStaticRegistry(Unknown Source)
        at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.loadOntologyFunctions(Unknown Source)
        at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.close(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.BuildEarCLI.runOperation(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioCommandLineInterpreter.executeCommandLine(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioCommandLineInterpreter.main(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioToolsApplication.start(Unknown Source)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.ClassNotFoundException: javax.mail.Address
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 31 more
Failed to fully load function catalog 'BRMS', moving on to next catalogs.
java.lang.NoClassDefFoundError: javax/mail/Address
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.tibco.cep.eventstreamprocessing.ESPFunctionCatalogProvider$1.getClass(Unknown Source)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunction(JavaStaticFunctionsFactory.java:231)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCategory(JavaStaticFunctionsFactory.java:188)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCategory(JavaStaticFunctionsFactory.java:182)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCatalog(JavaStaticFunctionsFactory.java:142)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunctionCategoriesFromDocument(JavaStaticFunctionsFactory.java:124)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunctionCategoryURLs(JavaStaticFunctionsFactory.java:99)
        at com.tibco.cep.rt.functions.AbstractFunctionCatalogProvider.loadCatalogs(Unknown Source)
        at com.tibco.cep.eventstreamprocessing.ESPFunctionCatalogProvider.loadCatalogs(Unknown Source)
        at com.tibco.cep.studio.parser.semantic.FunctionsCatalogManager.getStaticRegistry(Unknown Source)
        at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.loadOntologyFunctions(Unknown Source)
        at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.close(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.BuildEarCLI.runOperation(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioCommandLineInterpreter.executeCommandLine(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioCommandLineInterpreter.main(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioToolsApplication.start(Unknown Source)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.ClassNotFoundException: javax.mail.Address
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 31 more
Failed to fully load function catalog 'BRMS', moving on to next catalogs.
java.lang.NoClassDefFoundError: javax/mail/Address
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.tibco.cep.rt.functions.DefaultFunctionCatalogProvider$1.getClass(Unknown Source)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunction(JavaStaticFunctionsFactory.java:231)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCategory(JavaStaticFunctionsFactory.java:188)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCategory(JavaStaticFunctionsFactory.java:182)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadCatalog(JavaStaticFunctionsFactory.java:142)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunctionCategoriesFromDocument(JavaStaticFunctionsFactory.java:124)
        at com.tibco.be.model.functions.impl.JavaStaticFunctionsFactory.loadFunctionCategoryURLs(JavaStaticFunctionsFactory.java:99)
        at com.tibco.cep.rt.functions.AbstractFunctionCatalogProvider.loadCatalogs(Unknown Source)
        at com.tibco.cep.rt.functions.DefaultFunctionCatalogProvider.loadCatalogs(Unknown Source)
        at com.tibco.cep.studio.parser.semantic.FunctionsCatalogManager.getStaticRegistry(Unknown Source)
        at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.loadOntologyFunctions(Unknown Source)
        at com.tibco.cep.studio.core.util.packaging.impl.EMFEarPackager.close(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.BuildEarCLI.runOperation(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioCommandLineInterpreter.executeCommandLine(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioCommandLineInterpreter.main(Unknown Source)
        at com.tibco.cep.studio.cli.studiotools.StudioToolsApplication.start(Unknown Source)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.ClassNotFoundException: javax.mail.Address
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 31 more
<<<<<<<<<<<<<<<<<<<<<<

If we add mail.jar to studio-tools' classpath, studio-tools exits without any exception and ERA is not built successfully.

Resolution:
===========
This is a harmless exception. Building an EAR should be successful with this exception. The following imformation is printed by the studio-tools command:
>>>>>>>>>>>
Built the EAR file successfully.
<<<<<<<<<<<

Typically you would not need rms function jars in your projects. It is largely used with BRMS project. To suppressing this exception, you could do the following:
Remove all %BE_RMS_HOME%/hotfix/lib* & %BE_RMS_HOME%/lib/* entries from $BE_HOME\be\4.0\studio\bin\studio-tools.tra file

Note:
====
This will be fixed in a upcoming BE 4.0.2 Hotfix and it is not an issue in BE 5.x versions.

Issue/Introduction

Getting "java.lang.NoClassDefFoundError: javax/mail/Address" while building EAR with studio-tools command.