The hierarchy of the type XXX is inconsistent异常排查方式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/guying4875/article/details/53633798

最近在学习使用shiro框架在学习过程中由于要自定义一个权限认证拦截器当继承AuthorizationFilter类时报出了“The hierarchy of the type XXX is inconsistent”异常

在网上查询出现该异常的原因是:

由于我在myeclipse里建了两个Java PROJECT项目,分别是A projiect和B projiect,项目A引用了一些JAR包,然后项目B引用了项目A,但是B没有引用A的JAR包,就出现了这个鸟问题了

结果在B项目里引用A项目的JAR包就OK了。


The hierarchy of the type is inconsistent  解释为:层次结构的类型不一致


根据以上提示查看AuthorizationFilter类中所import 的所有的类发现在该类中有

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

这两个类,而我在maven的pom.xml中并未引入servlet,在pom.xml中添加

<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
再次编译问题解决


阅读更多
换一批

Inconsistent accessibility: parameter type xxx is less accessible than method x

10-27

完整的代码:[code=csharp]using System;rnusing System.Drawing;rnusing System.Runtime.InteropServices;rnusing ESRI.ArcGIS.ADF.BaseClasses;rnusing ESRI.ArcGIS.ADF.CATIDs;rnusing ESRI.ArcGIS.Controls;rnrnnamespace Engine.App_Code rn /// rn /// Summary description for OpenMxdCommand.rn /// rn [Guid("ce02d34f-135a-42f5-9955-80402160acf9")]rn [ClassInterface(ClassInterfaceType.None)]rn [ProgId("Engine.App_Code.OpenMxdCommand")]rn public sealed class OpenMxdCommand : BaseCommand rn #region COM Registration Function(s)rn [ComRegisterFunction()]rn [ComVisible(false)]rn static void RegisterFunction(Type registerType) rn // Required for ArcGIS Component Category Registrar supportrn ArcGISCategoryRegistration(registerType);rnrn //rn // TODO: Add any COM registration code herern //rn rnrn [ComUnregisterFunction()]rn [ComVisible(false)]rn static void UnregisterFunction(Type registerType) rn // Required for ArcGIS Component Category Registrar supportrn ArcGISCategoryUnregistration(registerType);rnrn //rn // TODO: Add any COM unregistration code herern //rn rnrn #region ArcGIS Component Category Registrar generated codern /// rn /// Required method for ArcGIS Component Category registration -rn /// Do not modify the contents of this method with the code editor.rn /// rn private static void ArcGISCategoryRegistration(Type registerType) rn string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\0", registerType.GUID);rn ControlsCommands.Register(regKey);rnrn rn /// rn /// Required method for ArcGIS Component Category unregistration -rn /// Do not modify the contents of this method with the code editor.rn /// rn private static void ArcGISCategoryUnregistration(Type registerType) rn string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\0", registerType.GUID);rn ControlsCommands.Unregister(regKey);rnrn rnrn #endregionrn #endregionrnrn private IHookHelper m_hookHelper;rn private IMapControl3 mapCtrl = null;rnrn private ControlsSynchronizer m_controlsSynchronizer;rnrn public OpenMxdCommand() rn base.m_category = "打开地图文档"; //localizable textrn base.m_caption = "打开地图文档"; //localizable textrn base.m_message = "打开地图文档"; //localizable text rn base.m_toolTip = "打开地图文档"; //localizable text rn base.m_name = "打开地图文档"; //unique id, non-localizable (e.g. "MyCategory_MyCommand")rnrn try rn string bitmapResourceName = GetType().Name + ".bmp";rn base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);rn rn catch (Exception ex) rn System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");rn rn rnrn public OpenMxdCommand(ControlsSynchronizer controlsSynchronizer)rn : this() rn m_controlsSynchronizer = controlsSynchronizer;rn rnrn #region Overridden Class Methodsrnrn /// rn /// Occurs when this command is createdrn /// rn /// Instance of the applicationrn public override void OnCreate(object hook) rn if (hook == null)rn return;rnrn if (m_hookHelper == null)rn m_hookHelper = new HookHelperClass();rnrnrn m_hookHelper.Hook = hook;rnrn if (hook is IToolbarControl) rn IToolbarControl tbarCtrl = (IToolbarControl)hook;rn mapCtrl = (IMapControl3)tbarCtrl.Buddy;rn rn else if (hook is IMapControl3)rn mapCtrl = (IMapControl3)hook;rn rnrn /// rn /// Occurs when this command is clickedrn /// rn public override void OnClick() rn System.Windows.Forms.OpenFileDialog openMxdDlg = new System.Windows.Forms.OpenFileDialog();rn openMxdDlg.Filter = "Map Document(*.mxd)|*.mxd";rn openMxdDlg.Multiselect = false;rn openMxdDlg.Title = "Open map document";rn if (openMxdDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) rn string fileName = openMxdDlg.FileName;rn ESRI.ArcGIS.Carto.IMapDocument mDoc = new ESRI.ArcGIS.Carto.MapDocumentClass();rn //权限验证.rn if (mDoc.get_IsPresent(fileName) && !mDoc.get_IsPasswordProtected(fileName)) rn //mapCtrl.LoadMxFile(fileName);rn //mapCtrl.Extent = mapCtrl.FullExtent; //全幅.rn //mapCtrl.ActiveView.Refresh();rnrn mDoc.Open(fileName);rn ESRI.ArcGIS.Carto.IMap map = mDoc.get_Map(0);rn mDoc.SetActiveView((ESRI.ArcGIS.Carto.IActiveView)map);rn controlsSynchronizer.PageLayoutControl.PageLayout = mDoc.PageLayout;rn controlsSynchronizer.ReplaceMap(map);rn mDoc.Close(); //?.rn rn rn rnrn #endregionrn rnrn[/code]rnrn请问是哪里错了...

没有更多推荐了,返回首页