Exception in OMR Applet

Dear Support

We evaluated the OMR reading from an image from the command prompt and it worked fine.
We are trying to create an Applet for this and we are getting the below exception.

class com.aspose.omr.internal.aj: Unable to create an element —> java.lang.Cla
ssNotFoundException: com.aspose.omr.ChoiceBoxElement
— End of inner exception stack trace —
com.aspose.omr.OmrTemplate.a(Unknown Source)
com.aspose.omr.OmrTemplate.a(Unknown Source)
com.aspose.omr.OmrTemplate.load(Unknown Source)
example.getfolderdetails(Example.java:101)
example.actionPerformed(Example.java:74)
java.awt.Button.processActionEvent(Button.java:409)
java.awt.Button.processEvent(Button.java:377)
java.awt.Component.dispatchEventImpl(Component.java:4861)
java.awt.Component.dispatchEvent(Component.java:4687)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
java.awt.EventQueue.access$200(EventQueue.java:103)
java.awt.EventQueue$3.run(EventQueue.java:694)
java.awt.EventQueue$3.run(EventQueue.java:692)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:7
6)
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:8
7)
java.awt.EventQueue$4.run(EventQueue.java:708)
java.awt.EventQueue$4.run(EventQueue.java:706)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:7
6)
java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242
)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150
)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Can you please evaluate this and help…
Thanks


Hi,


Thank you for contacting Aspose support.

We have evaluated your presented scenario by creating a simple applet application in Eclipse IDE while using the latest version of Aspose.OMR for Java 2.0.0. Unfortunately, we are unable to replicate the said exception on our end. In order to further investigate the matter, we would request you to please archive your workspace (sample application) and attach the zip file here along with your environment details such as follow.

  • Operating system version
  • Operating system architecture (32bit/64bit)
  • JDK type
  • JDK version
Above code is working Ecllipse. same code not working on terminal.


ramesh@ramesh ~/Desktop/ramesh $ appletviewer -J-Djava.security.policy=Write.jp index.html
images
class com.aspose.omr.internal.aj: Unable to create an element ---> java.lang.ClassNotFoundException: com.aspose.omr.ChoiceBoxElement
--- End of inner exception stack trace ---
com.aspose.omr.OmrTemplate.a(Unknown Source)
com.aspose.omr.OmrTemplate.a(Unknown Source)
com.aspose.omr.OmrTemplate.load(Unknown Source)
ocr.init(ocr.java:50)
sun.applet.AppletPanel.run(AppletPanel.java:436)
java.lang.Thread.run(Thread.java:744)

Please send sample code for executing ocr with using any IDE.

Hi Ramesh,

Please find the detailed articles and source code snippets on the following link.

Regarding the original problem, as you have narrated that the Applet type project works perfectly in the Eclipse environment that means the problem isn’t on the part of Aspose.OCR for Java API. You should confirm the arguments that you are passing from the terminal to load the applet with applet viewer. Moreover, you require the aspose-omr-x.x-jdkxx.jar for this operation not aspose.ocr.jar that you have included in your attached archive.

Hi Aspose Team,


in the above attached code aspose.jar is OMR jar file. i am passing exact path to to the OMRTemplate.Load(filepath). but it gives Exception as Unknow source. please help to me.

Hi Ramesh,


ClassNotFoundException occurs when Java Virtual Machine tries to load a particular class and doesn’t find it in the classpath. If you can compile the code without receiving any errors during the compilation time then the com.aspose.omr package is in place as expected. Moreover, you are able to run the applet through IDE without any issue so the problem does not seem to be related to the Aspose.OMR for Java API. I am mentioning these facts so that you could check other possibilities (configurations, command line arguments) as well while troubleshooting this problem on your side.

Please consider the following.

  • If you have obtained the ocr.class by compiling the ocr.java from an IDE such as Eclipse then the code directive inside the index.html should contain the package name preceding the class name code = “[packagename]/ocr.class”,
  • Try loading the applet through terminal as appletviewer index.html or/and directly into the browser.

If you still find problems then please provide us your environment details such as follow for further investigation.

  • Operating system version
  • Operating system architecture
  • JDK type
  • JDK version

Dear Support Team

The Class not found exception is not occurring at the omrTemplate class. That is occurring at internal.aj class which is called from the omrTemplate and ak like this… .The error we are getting is no class Choiceboxelement. or no class gridelement which is placed in the template.amr file.


But when we remove the elements from the template.amr there is no error and eof reached without throwing any exception.


Hi Ramesh,


We still need your environment details to log an investigation of your presented scenario. Please provide these details as requested earlier in this thread.
Hi Support team

Pls find the jdk and os versions of the machines we are using

Windows xp sp3
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) Client VM (build 25.25-b02, mixed mode, sharing)



Linux mint
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1~0.12.10.1)
OpenJDK Server VM (build 24.51-b03, mixed mode)

Hi Ramesh,


Thank you for the environment details. We have logged an investigative ticket (OCR-33912) for the product team to look further into this matter. Please spare us little time for the proper analysis of the presented scenario. In the meanwhile, we will keep you posted with updates in this regard.

Hi Support team


Can we have any update on this ticket please.
Thanks

Hi,


I am afraid, the ticket attached to this thread is currently pending for analysis and is in the queue with other priority tasks. We will notify you here as soon as we receive any updates in this regard.

We are sorry for the inconvenience.

Hi again,


This is to inform you that the ticket OCR-33912 is scheduled for the upcoming release of Aspose.OCR for Java 2.2.0, that will be available for public use in the last quarter of February 2015.

Hi

Any further resolution on this ticket, as we are planning to get the new release once it is available.

Thanks
Krish

Hi Krish,


Thank you for writing back.

Aspose.OCR for Java 2.2.0 has been uploaded to the Aspose download section. We are currently preparing the blog announcement to notify all the users regarding this release. Please note, the said release contains the fix for the ticket logged earlier as OCR-33912, so if you do not wish to wait for the formal notification, you may head to the download section and test the fix in your environment.

The issues you have found earlier (filed as OCR-33912) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.