- 3,722,782 Users
- 2,244,412 Discussions
- 7,850,085 Comments
Forum Stats
Discussions
Categories
- 16 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 2K Databases
- 599 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 32 Multilingual Engine
- 496 MySQL Community Space
- 7 NoSQL Database
- 7.7K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 420 SQLcl
- 58 SQL Developer Data Modeler
- 185K SQL & PL/SQL
- 21.1K SQL Developer
- 2.4K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.6K Development Tools
- 12 DevOps
- 3K QA/Testing
- 327 Java
- 10 Java Learning Subscription
- 12 Database Connectivity
- 71 Java Community Process
- 2 Java 25
- 11 Java APIs
- 141.2K Java Development Tools
- 8 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 14 Java SE
- 13.8K Java Security
- 4 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 147 LiveLabs
- 34 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 16 Español
- 1.9K Japanese
- 3 Portuguese
How to add Java bean in Oracle forms 12C

Hello friends,
I'm trying to include a javabean in a form of Oracle forms.
First of all I am using an example of javabean obtained from the following address Read/Write a file on the client machine - Oracle Forms PJCs/Java Beans . Copy the form and the javabean to my server, but when wanting to modify the file formsweb.cfg I can not find any archive_jini tag, so I proceeded to add the name of the jar file in the archive tag.
After doing all this I open my form from the browser and clicking on the button that calls a method, it does not do anything and does not show any error in the java console.
Please, if someone explains to me that I am doing badly or what is missing, I appreciate your comments.
Best Answer
-
The first problem, and probably the most significant is that you are editing managed configuration files in a text editor. You MUST edit managed configuration files using Fusion Middleware Control. Your manually added changes will be ignored and/or rolled back.
The documentation is your friend:
Additional things of note:
1. Your bean JAR file must be signed. If you don't know how to sign a JAR, Google is your friend too: https://www.google.com/search?q=java+sign+jar+with+trusted+certificate
2. Take advantage of the detail that the Java Console exposes. You might need to enable a higher trace level (e.g. 2 or 3). https://www.google.com/search?q=java+console+trace+level In the console look carefully for things like "File not found..." or "Unable to load....". Read those errors carefully. They will almost always give you a clear clue as to why things are failing if the issue is related to not finding/downloading something.
3. The JAR files you downloaded from that example are verrrrrry old. Likely they need to be recreated/recompiled using a newer Java version. So you need the source code.
Answers
-
One required step is to sign the Jar File with a trusted certificate (e.g. verisign or other) I think the current timestamp of the signed jarfile is out of date.
Then it should work.
But fpr your purpose you could use the Webutil libraries from Oracle.
Regards
Holger
-
Holger, I re-signed the jar file with a certificate of my own, I suppose that this should also work, I loaded it again on the server but just as executing the application it does not work and it does not give me any error either.
I'm waiting for your help, thanks.
-
Hello,
When you play with JavaBeans, ALLWAYS display the Java console at runtime to see what happen (or not).
Francois -
As Holger mentioned, rather than using a custom Java Bean you can use the Oracle provided WebUtil. Although this will be somewhat overkill for just one function (upload/download), WebUtil is provided with a pre-signed jar file and is mostly configured out of the box. Further, Oracle supports WebUtil. Oracle will not support your custom Java Bean if you have issues with it.
Also, it is important that you use Java 8. Java 7 is extremely old and is no longer supported. Finally, self-generated certificates should no longer be used. You can make them work, but this is not recommended and will eventually be removed from support in Java. You need a certificate provided from a trusted/known CA (e.g. Verisign, Thawte, etc)
-
You need to verify your jar file in the right way:
DOS> jarsigner -verify <file.jar>
Hope that helps,
Friedhold.
-
Hello! Did this get resolved? I have a similar, maybe the same problem with 12c Forms Builder. I try run a form from this tutorial - https://sites.google.com/site/craigsoraclestuff/oracle-forms---how-to-s/forms-how-to-use-a-calendar-in-a-form , but when triggering JavaBean, nothing happens.
I added the .jar files in C:\Oracle\Middleware\forms\java , as well added them to FORMS_BUILDER_CLASSPATH. Then edited the formsweb.cfg same as user13281377 in this location - C:\Oracle\Middleware\forms\templates\config
But then I figured that this was a wrong cfg, cause I run forms on WebLogicDomain, so I edited this one - C:\Oracle\Middleware\user_projects\domains\base_domain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_12.2.1\config
But nothing changes, the JavaBean does not respond on runtime. Maybe I need to locate the .jar files in different location, what do you think guys?
-
The first problem, and probably the most significant is that you are editing managed configuration files in a text editor. You MUST edit managed configuration files using Fusion Middleware Control. Your manually added changes will be ignored and/or rolled back.
The documentation is your friend:
Additional things of note:
1. Your bean JAR file must be signed. If you don't know how to sign a JAR, Google is your friend too: https://www.google.com/search?q=java+sign+jar+with+trusted+certificate
2. Take advantage of the detail that the Java Console exposes. You might need to enable a higher trace level (e.g. 2 or 3). https://www.google.com/search?q=java+console+trace+level In the console look carefully for things like "File not found..." or "Unable to load....". Read those errors carefully. They will almost always give you a clear clue as to why things are failing if the issue is related to not finding/downloading something.
3. The JAR files you downloaded from that example are verrrrrry old. Likely they need to be recreated/recompiled using a newer Java version. So you need the source code.
-
Thank you, Michael!
I decompiled the Jars I needed, then recompiled with a Java version that worked for my project, signed the Jars and now it works.