# Why Some Classes are Not Importable

**URL:** <https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [December 10, 2021, 2:00am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979 "2021-12-10T02:00:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 10, 2021, 2:00am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/1 "2021-12-10T02:00:47Z")

</div>

Even all classes I have ever seen in SDK says `public` some classes are not importable like [RemoteHistorianSettingsRecord (inductiveautomation.com)](http://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.1/com/inductiveautomation/gateway/tags/history/distributed/client/RemoteHistorianSettingsRecord.html)

Why? or How to import Those?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2021, 2:11am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/2 "2021-12-10T02:11:41Z")

</div>

See my comment on the other thread.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 10, 2021, 2:41am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/3 "2021-12-10T02:41:33Z")

</div>

Thanks @pturmel, Nice info. I’ve been trying reflection and interfaces with no luck. I’m in a death stop in this.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 10, 2021, 2:42am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/4 "2021-12-10T02:42:58Z")

</div>

> [@Get Remote Tag Provider Info via Script](https://forum.inductiveautomation.com/t/get-remote-tag-provider-info-via-script/53972/19):
>
> Also note that not all gateway classes are exposed to scripting at all. Specifically, classes supplied by modules instead of the platform. Module classes are only accessible via deliberate scripting support from the module, or rather intricate reflection techniques.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2021, 3:37am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/5 "2021-12-10T03:37:51Z")

</div>

> [@Get Remote Tag Provider Info via Script](https://forum.inductiveautomation.com/t/get-remote-tag-provider-info-via-script/53972/19):
>
> intricate reflection techniques

IgnitionGateway =\> ModuleManager =\> (lookup module, returns GatewayHook) =\> get hook's classloader =\> ask that classloader to look up desired class =\> use reflection on class to use static methods and/or constuctors.

Have fun!

{ I shouldn't have to say it, but breakage is easy, and there's no support. Nada. Don't experiment with any of this on a production system. }

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 10, 2021, 4:28am UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/6 "2021-12-10T04:28:19Z")

</div>

hmmm, the class loader should be done with Configure Serializer and xlm serializer?  
Is lang.reflect the correct class one for reflection?

Yes, hehe this is just a dev environment.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2021, 12:48pm UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/7 "2021-12-10T12:48:10Z")

</div>

Spend some time studying `java.lang.Class`.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 10, 2021, 4:24pm UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/8 "2021-12-10T16:24:33Z")

</div>

You can skip some of those steps; if you have a GatewayContext, you can ask it for the [`ModuleManager`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.12/com/inductiveautomation/ignition/gateway/model/GatewayContext.html#getModuleManager()) then ask the module manager to [resolve your class](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.12/com/inductiveautomation/ignition/gateway/model/ModuleManager.html#resolveClass(java.lang.String)) by name.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2021, 4:46pm UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/9 "2021-12-10T16:46:26Z")

</div>

oooo! Never noticed that method.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 13, 2021, 3:34pm UTC](https://forum.inductiveautomation.com/t/why-some-classes-are-not-importable/53979/10 "2021-12-13T15:34:55Z")

</div>

just amazing
