cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error in To Custom Pass

Ckumar
Contributor
0 Kudos

Hello Experts,

I have written a To Custom Pass in which I am trying to write a user in a file using JAVA class.

As per my knowledge I have defined the PassType, Parameter & Value correctly but when I ran that job got following error. I am using SAP IDM 7.2 SP10.

Running pass failed to load class HelloWorld

java.lang.ClassNotFoundException: com.sap.idm.ic.HelloWorld

I have already added DirectoryPath of HelloWorld class in CLASSPATH also.

Attached the relevant screenshots for reference.

Could you please help me to fix this error.


Regards,

Chandan Kumar

Accepted Solutions (1)

Accepted Solutions (1)

former_member2987
Active Contributor
0 Kudos

HI there,

What's in the class?

Matt

Ckumar
Contributor
0 Kudos

Hi Matt,

JAVAClass is a simple program in which I am trying to write the entry in a file.

It seems that SAP IDM is failed to find and load the class file.

Please find the Classfile at following link.

https://docs.google.com/a/jailabs.biz/document/d/1xFMjml7bt1CfixVpVKHkmnl_T5xHoPaAtyOo7yZnjlc/edit?u...

Regards,

C Kumar

former_member201064
Active Participant
0 Kudos

I haven't read the classfile by now as I just have requested the permission from you (dtfhhn). The message says that the file cannot be found.

I simply assume that you have not entered a package for the Java class? Without entering the package before the classname the IdM assumes com.sap.idm.ic (like the ToSAP & other classes).

I suggest that you move the class to some package if you haven't already one in usage. After that you have to enter the classname as something like z.idm.myfiles.HelloWorld if you are using the package z.idm.myfiles.

Or placing the file in subfolders /com/sap/idm/ic of the current folder without changing the folder you specified.

Here a blog from my old S-user:

Ckumar
Contributor
0 Kudos

Thanks for reply Domnik,

I have gone through your blog and followed the steps explained there only to write the Pass

My class file is already in a Package.

Attached the screenshots for reference.

Could you please try again to access the below link to view the code using your google account.Sign in - Google Accounts

Regards,

C kumar

former_member201064
Active Participant
0 Kudos

Have you tried adding com.sap.idm.ic in the pass? Or moving the class in subfolders \com\sap\idm\ic? Or swithing to another packe as the standard SAP package could be something "reserved". Haven't tried it out though.

By the way, a main method wont be executed, only the add/mod/delete/init methods

Ckumar
Contributor
0 Kudos

Yes Domnik,

I have added com.sap.idm.ic in the pass type and then got error as

Running pass failed to load class HelloWorld

java.lang.ClassNotFoundException: com.sap.idm.ic.com.sap.idm.ic.HelloWorld

I am not an SAP IDM/JAVA expert, please could please explain your last sentence.

Regards,

C Kumar

former_member201064
Active Participant
0 Kudos

Have you restarted the dispatcher by now (plus generating the scripts for the dispatcher new)?

Do you have write access on C:\ ? I don't have it neither on the IdM server nor on my computer, so I am using another folder

Also, I would strongly recommend using another package. The IdM tries now to "double" the classpath which isn't getting better.

What I meant:

When you extend from the ToCustom class, the IdM treats your class like on of its own (that's the DSE-API). It uses these methods (except the constructor)

  • Constructor: Not really needed. All system connections should be done in the next method:
  • initCustom: I use them for system connections and other "init" work. In your HelloWorld example it won't be needed though
  • addEntryCustom: Called when using changetype add or no changetype. Placing the code for writing the file here is correct
  • modEntryCustom: Called when using the changetype modify or no changetype (no changetype = IdM tries both of the,)
  • deleteEntryCustom: Called when using the changetype delete
  • exitPass: Close the connection to the target system and other "cleaning up" stuff
  • try / catch won't work the "normal" way in Java classes. You can catch the exception but then not a e.printStackTrace but a method named logIt(). It has two parameters for the level and one for the text. Info = 3, Warning = 2, Error = 1; e.g.: logIt(3, "Connector not initialized. An exception occured...");

The FromCustom has similar methods, yet only for reading.

Ckumar
Contributor
0 Kudos

Thanks for such a detailed explanation Dominik!

I believe it will really help to write class files for To Custom Pass.

I have generated the jar file for my class and then added it to Identity Center CLASSPATH

Identity Center  -> Tools -> Options... -> JAVA -> Classpath extension

After adding the jar file, I have regenerated the dispatcher script and then restarted the dispatcher and run the Job.

Now I am not getting the previous error, It seems To Custom pass is now able to find and load the class file but got the following error.

Please help me to fix this error.

Regards,

C Kumar

former_member201064
Active Participant
0 Kudos

The customInit method has to return true.

False produces this message. All other methods except deleteEntryCustom have the same return pattern. True = success, false = Error.

deleteEntryCustom: 0 if delete was not successful, 1 if successful. aka the count how many users were deleted

Ckumar
Contributor
0 Kudos

Thanks Dominik!


I have changed the return type of initcustom method to true and its working fine now.


Regards,

C Kumar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Dominik,

I have read your article on custom Java connectors. I have just started to write my own custom connector.

I have been unable to find any Javadocs that describe the classes in DSE.jar, specifically the FromCustom class. I can see you have described the class methods in the article. Do you know if there exists official Javadoc for this class and if so, where can I find it ?

Regards

Thomas Christensen

former_member2987
Active Contributor
0 Kudos

Thomas,

You used to be able to get it from the Development team.  You might need to open an OSS Note.

Matt

Former Member
0 Kudos

OK. Thanks Matt.