com.google.gson appears multiple time in matlab jar library and refuse to load new version of com.google.gson
1 次查看(过去 30 天)
显示 更早的评论
I have encountered this problem in many times in the past years.
Matlab has several library jars with com.google.gson class, including :
C:\Program Files\MATLAB\R2016a\java\jarext\connector_impl\mgg_server\mgg_server.jar
C:\Program Files\MATLAB\R2016a\java\jarext\connector_api\connector_api_java\connector_interface.jar
C:\Program Files\MATLAB\R2016a\java\jarext\aps_impl\pubsub_impl_java\pubsub_impl.jar
If to add customized jars to matlab which also import com.google.gson with a newer version, Matlab refuse to loaded it.
The com.google.gson class is the most frequent problems I encountered, takes about 90%.
Delete these jars sometimes solve the problem, but sometimes cause matlab internal class definition lost, such as:
>>panel = uifigure('name',obj.title,'NumberTitle','off','Visible','on','Position',obj.panelPos,...
'MenuBar','none','ToolBar','none','resize','off');
MathWorks::System::IUserException [Undefined variable "com" or class "com.mathworks.matlabserver.connector.api.Connector.isRunning".
Error in connector.isRunning
Error in matlab.ui.internal.toolstrip.base.Utility.startConnector (line 363)
isRunning = connector.isRunning;
Error in matlab.ui.internal.desktop.uicontainer.UIContainer (line 137)
[~, this.ConnectorPort] = matlab.ui.internal.toolstrip.base.Utility.startConnector();
Error in matlab.ui.internal.controller.FigureContainer (line 14)
this = this@matlab.ui.internal.desktop.uicontainer.UIContainer(htmlpath);
Error in matlab.ui.internal.controller.FigureController/createContainer (line 195)
this.Container = matlab.ui.internal.controller.FigureContainer;
Error in matlab.ui.internal.controller.FigureController/createView (line 151)
this.createContainer();
Error in matlab.ui.internal.componentframework.WebComponentController/add (line 95)
obj.createView( parentController, parentView, map );
Error in matlab.ui.internal.controller.WebCanvasContainerController/add (line 49)
add@matlab.ui.internal.componentframework.WebContainerController( this, webComponent, parentController );
Error in matlab.ui.internal.componentframework.WebControllerFactory/create (line 87)
component.createController( parentController, [] );]
which is localized in % C:\Program Files\MATLAB\R2016a\java\jarext\connector_api\connector_api_java\connector_interface.jar
A recommendation is to seperate the gson brach out as an isolated jar.
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!