Problem loading a custom class in workflow
Hi.
my configuration is DB 8.1.7
workflow 2.6.0
I want to execute an external java, and to do that i wrote a simple class (based on API specification)
I receive that error when I run Loadjava on a that very simple class.
JAVA CLASS OWF_MGR.pippo
On line: 0
ORA-29521: referenced name oracle/apps/fnd/wf/WFAttribute could not be found
here the test class.
import java.io.*;
import java.sql.*;
import java.math.BigDecimal;
import oracle.sql.*;
import oracle.jdbc.driver.*;
import oracle.apps.fnd.common.*;
import oracle.apps.fnd.wf.engine.*;
import oracle.apps.fnd.wf.*;
public class pippo extends WFFunctionAPI {
public boolean execute(WFContext pWCtx){
ErrorStack es = pWCtx.getWFErrorStack();
try
WFAttribute lAAttr = new WFAttribute();
WFAttribute lIAttr = new WFAttribute();
loadActivityAttributes(pWCtx, itemType, itemKey, actID);
loadItemAttributes(pWCtx);
lAAttr = getActivityAttr("AATTR");
lIAttr = getItemAttr("IATTR");
java.lang.Runtime myRun = java.lang.Runtime.getRuntime();
myRun.exec("dir ");
lIAttr.value((Object)"NEWVALUE");
setItemAttrValue(pWCtx, lIAttr);
catch (Exception e)
es.addMessage("WF","WF_FN_ERROR");
es.addToken("MODULE",this.getClass().getName());
es.addToken("ITEMTYPE",itemType);
es.addToken("ITEMKEY",itemKey);
es.addToken("ACTID",actID.toString());
es.addToken("FUNCMODE",funcMode);
es.addToken("ERRMESSAGE",e.getMessage());
return false;
return true;
It seems to me that something is not correctly loaded in the DB.
Thank You.
Hi Marco,
I'm not familiar with the "oracle.apps.fnd" package hierarchy, but you can check what java classes are loaded into the database by logging in as the SYS user and issuing the following query:
select
DBMS_JAVA.LONGNAME(OBJECT_NAME)
,OBJECT_TYPE
from
DBA_OBJECTS
where
OBJECT_TYPE like 'JAVA%'
Hope this helps you.
Good Luck,
Avi.
Similar Messages
-
Problem loading JNDI custom resources after migration from WS6.1 to WS 7.0
We have a web application that uses a handful of custom resources that works fine on Sun Web Server 6.1, but after we migrate to 7.0, it fails. The error is that it cannot find the Factory class that we use to create the custom resources. If we put a .jar file in the server's classpath so it can find the Factory class, we get a perplexing error that the custom resources don't match in the config files, when they're identical.
Here are the details:
The error we get when we just do the migration without any changes is:
*WEB7021: Class [edu.umn.cidrap.admin.repository.RepositoryFactory] not found*
After we add the .jar to the server classpath, that goes away, but we get:
*WEB7018: res-type mismatch for resource [bean/UrlRepository]. res-type in server.xml [<package>.UrlRepository] does not match res-type in web.xml [<package>.UrlRepository]*
The <package> matches identically.
Any help with this would be appreciated.
DaveYes, it's odd.
I ran across a similar problem upgrading an application in Tomcat, from version 5 to 6. The gist of the problem there seemed to be that the class loaded into JNDI was loaded by the server's classloader while the class using it was loaded by a different classloader (one for the web app) and that, in Java, the same class loaded by different class loaders is different. Or something like that.
The solution that worked there was to make sure that Tomcat could not find the class, which I think caused it to be loaded by the web app class loader. But I'm out of my league on that and my memory is not what it should be.
I don't know if that's the case here, but the error message -- two identical classes generating a message that they're not the same -- brings up that bad memory.
Nonetheless, I'm still stumped.
Dave -
Accessing custom classes from JSP
Hi Guys,
I am having some problems accessing my custom classes from my JSP.
1) I've created a very simple class, SimpleCountingBean that just has accessors for an int. The class is in the package "SimpleCountingBean". I compiled this class locally on my laptop and uploaded the *.class file to my ISP.
2) I've checked my classpath and yes, the file "SimpleCountingBean/SimpleCountingBean.class" is located off of one of the directories listed in the classpath.
3) When I attempt to use this class in my JSP, via the following import statement:
import "SimpleCountingBean.*"
I get the following compile error
java.lang.NoClassDefFoundError: SimpleCountingBean/SimpleCountingBean
I'm pretty sure that my classpath is properly setup because when I purposely garble the import statement, I get the "package not found" compile error.
Do I need to upload some other files in addition to the class file? Any suggestions would of course be appreciated.
Sonny.Trying to get some clearer view.. so don't mind..
So you uploaded all your .jsp files into your account which is:
home/sonny
and it compiles and work. But custom classes doesn't seems to be working, where did you place your classes?
From my knowledge of tomcat, classes are normally placed in, in this case:
home/sonny/web-inf/classes
Maybe it differs from windows enviroment to *nix enviroment.. well, I'm just saying out so if its not the case.. don't mind me. -
Unable to load your custom module provider's module-factory-class
I am having a problem while I deploy my application. it gives me following error:
Unable to load your custom module provider's module-factory-class com.bea.p13n.descriptor.module.ConfigModuleFactory
Dont know how to resolve it. the class is in p13n_system.jar file, I have added that jar as a library in deployment but still it shows the same error.
Added it in classpath as well but same error. (Dont know exactly how to add in class path, i have added just in "Start Server" tab's classpath)
Any help will be greatly appreciatedBelow link might be helpful.
http://kr.forums.oracle.com/forums/thread.jspa?threadID=1049509&tstart=0
Regards,
Anandraj
http://weblogic-wonders.com/ -
Custom class loader and local class accessing local variable
I have written my own class loader to solve a specific problem. It
seemed to work very well, but then I started noticing strange errors in
the log output. Here is an example. Some of the names are in Norwegian,
but they are not important to this discussion. JavaNotis.Oppstart is the
name of my class loader class.
java.lang.ClassFormatError: JavaNotis/SendMeldingDialog$1 (Illegal
variable name " val$indeks")
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.lang.ClassLoader.defineClass(ClassLoader.java:431)
at JavaNotis.Oppstart.findClass(Oppstart.java:193)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at JavaNotis.SendMeldingDialog.init(SendMeldingDialog.java:78)
at JavaNotis.SendMeldingDialog.<init>(SendMeldingDialog.java:54)
at JavaNotis.Notistavle.sendMelding(Notistavle.java:542)
at JavaNotis.Notistavle.access$900(Notistavle.java:59)
at JavaNotis.Notistavle$27.actionPerformed(Notistavle.java:427)
JavaNotis/SendMeldingDialog$1 is a local class in the method
JavaNotis.SendMeldingDialog.init, and it's accessing a final local
variable named indeks. The compiler automatically turns this into a
variable in the inner class called val$indeks. But look at the error
message, there is an extra space in front of the variable name.
This error doesn't occur when I don't use my custom class loader and
instead load the classes through the default class loader in the JVM.
Here is my class loading code. Is there something wrong with it?
Again some Norwegian words, but it should still be understandable I hope.
protected Class findClass(String name) throws ClassNotFoundException
byte[] b = loadClassData(name);
return defineClass(name, b, 0, b.length);
private byte[] loadClassData(String name) throws ClassNotFoundException
ByteArrayOutputStream ut = null;
InputStream inn = null;
try
JarEntry klasse = arkiv.getJarEntry(name.replace('.', '/')
+ ".class");
if (klasse == null)
throw new ClassNotFoundException("Finner ikke klassen "
+ NOTISKLASSE);
inn = arkiv.getInputStream(klasse);
ut = new ByteArrayOutputStream(inn.available());
byte[] kode = new byte[4096];
int antall = inn.read(kode);
while (antall > 0)
ut.write(kode, 0, antall);
antall = inn.read(kode);
return ut.toByteArray();
catch (IOException ioe)
throw new RuntimeException(ioe.getMessage());
finally
try
if (inn != null)
inn.close();
if (ut != null)
ut.close();
catch (IOException ioe)
}I hope somebody can help. :-)
Regards,
Knut St�reI'm not quite sure how Java handles local classes defined within a method, but from this example it seems as if the local class isn't loaded until it is actually needed, that is when the method is called, which seems like a good thing to me.
The parent class is already loaded as you can see. It is the loading of the inner class that fails.
But maybe there is something I've forgotten in my loading code? I know in the "early days" you had to do a lot more to load a class, but I think all that is taken care of by the superclass of my classloader now. All I have to do is provide the raw data of the class. Isn't it so? -
Problem loading modified classes from CLASSPATH using system class loader
Hi,
I am facing problem to load the modified classes from CLASSPATH.
I have set my CLASSPATH to a directory whose classes will be modified frequently. After the server(web/app) is started, the system class loader, using which am trying to load the classes from the directory where the CLASSPATH is set, am not able to load the modified files without the server restart.
Do I need to have a custom class loader to fix this.
Please help me.
Thanks,
SureddyDo I need to have a custom class loader to fix this.Yes.
-
Problems loading nib files after class is split into a static library.
I've recently split a project so that the common re-usable controls are in their own class library. My original application project now references these using a cross project reference.
However, since I have split the projects up, my original project crashes when it loads main.xib because it cannot find one of the custom classes which is defined in the library project.
When I first split up the projects, I noticed that there were problems with the nib files not being able to find the IB outlets of the custom classes, but I managed to get around these by going importing the relevant library class files manually (File > Read Class Files…).
I have made sure that all of the nib files compile without warning, so as far as I can tell, Interface Builder is able to read the necessary class headers, but when I try to run the app, it crashes saying that there is an unknown class in the Interface Builder file and that the class is not coding compliant.
Are there any steps I've missed or advice on how to troubleshoot this?I did a bit of digging. The reason why this wasn't working is because the class in question was referenced by the nib files, but not in code. Therefore, while the code compiled and there were no warnings with the nib files, the linker was not linking the classes because no code used them directly.
This can be fixed by going to the Project Settings, and on the Build tab, underneath the Linking heading, adding -ObjC to the Other Linker Flags section. -
Problem Using Custom Classes in UCCX8.5.1 SU3
Dear All,
My team is facing problem in using Java custom classes for UCCX 8.5.1 SU3
The problem is that we have created some conditional prompts for currency in different languages, our custom java class contains two mathods GetEnglishString(parameter set) and GetUrduString(parameter set). We are able to use/call both methods one by one and both at same time in CCX Editor and validate the script successfully but when we set the script as application it failed.
We tried to use both methods one by one and found that script with GetEnglishString is working ok but when we place GetUrduString (alone as well) MIVR logs say that method is unknown altough CCX Editor does not give us any error. We triend to restard Administration and Engine Services several time but to no avail. If somebody know the reason and solution kindly share it ASAP.
Regards
Kashif SurhioHi
In that case I would double check you have uploaded the file, and restart the server completely. In testing we found that restarting the engine didn't always reload the classes.
Aaron -
I'm creating a custom class to retrieve some data using URLoader.
My code is below, doing this from memory, plz ignore any minor typos.
The challenge I'm encountering: when my custom class calls the loader, the event handler takes over. At which point the context of my code leaves the function and it's not clear to me how I then return the data retrieved by the loader. I sense that I'm breaking the rules of how ActionScript really runs by putting a loader in a separate class; at least, that's my primitive understanding based upon the reading I've done on this.
So can I do this? I am trying to create a clean separation of concerns in my program so that my main program doesn't get clogged up with code concerned with retrieving remote data.
Thanks!
Main program;
import bethesda.myLoader;
var ldr:myLoader = new myLoader;
var data:String = myLoader.getData("someurl");
My custom class:
package bethesda {
public class myLoader {
function myLoader(url:String):String {
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(url);
loader.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event):void {
var ld:URLLoader = new URLLoader(event.target);
data = loader.load(); // here's where I don't know what to do to get the data back to my main programI think you are on the right track in abstracting loading from other code.
Your class may be like that:
package
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class myLoader extends EventDispatcher
// declare varaibles in the header
private var loader:URLLoader;
private var url:String;
public function myLoader(url:String)
this.url = url;
public function load():void {
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(url);
loader.addEventListener(Event.COMPLETE, completeHandler);
loader.load(request);
private function completeHandler(e:Event):void
dispatchEvent(new Event(Event.COMPLETE));
public function get data():*{
return loader.data;
Although, perhaps the best thing to do would be to make this class extend URLLoader. With the example above you can use the class as following:
import bethesda.myLoader;
import flash.events.Event;
var ldr:myLoader = new myLoader("someurl");
ldr.addEventListener(Event.COMPLETE, onLoadComplete);
ldr.load();
function onLoadComplete(e:Event):void {
var data:String = ldr.data; -
Detecting when exception was thrown using custom class loader
Hello all,
I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
Thanks!
Edited by: user9355666 on Sep 28, 2010 10:48 PMuser9355666 wrote:
I think I'm missing something fundumental, forgive me for being slow...
This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it. -
Engine having problems loading nested classes
Hi all,
We are having the strangest problem:
We are using PAPI to create an instance of a process by passing a complex class, that we have defined, in the BeginIn argument set. Some classes are loaded successfully by the JVM, others cause the Engine to throw a ClassNotFoundException. Here's an example:
ClassA has 3 members:
ClassA
---ClassB
---ClassC
---LinkedList<ClassD>
Classes A, B, and C are all loading fine. Class D cannot be found.
Here's another example:
ClassA has 3 members, ClassD contains instance of ClassE:
ClassA
---ClassB
---ClassC
---ClassD
---ClassE
Again, Classes A, B, C, and D are all loaded, but ClassE cannot be found.
All classes are in the same JAR file, in the same package, and all are cataloged into BPM under the same directory.
I'm using BPM 6.0.3 on Weblogic 10.0.0.1
The PAPI code is being called from a different server than the engine is running on.
Any ideas why nested classes are causing this kind of problem?
Thanks,
-KenOK
Here is another twist to whoever may be reading this thread.
When the EJB containg the PAPI call and the BPM Engine are on the same Weblogic server, the code works fine. When the EJB and the Engine are on different Weblogic servers, the Engine throws the "ClassNotFoundException". It is definitely the remote Weblogic server containing the Engine that is throwing the Exception.
It seems as though the engine and the PAPI code are having difficulty communicating through RMI... -
Can I dinamicly load a class with custom class loader ?
Can I dinamicly load a class with custom class loader ?
Hi,
I was wondering if you found answer to your question, and also were you using your custom class loader inside a signed applet as I am in a similar situation, and was wondering if you could help me. An example would be great...
Thanks a lot.
Regards. -
Parsing XML in a Custom Class Problem
Hi, I am trying to parse an XML file from a class within my web app. It isn't a servlet, just a custom class to parse the xml.
However, I keep getting a null document printed when I try to print the document to the log file. This is the class:public class XMLParser
Document document;
public XMLParser()
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(true);
factory.setNamespaceAware(true);
try
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(new File("SiteDescriptor.xml"));
catch(SAXException sxe)
// Error generated during parsing
Exception x = sxe;
if(sxe.getException() != null)
x = sxe.getException();
x.printStackTrace();
catch(ParserConfigurationException pce)
pce.printStackTrace();
catch(IOException ioe)
ioe.printStackTrace();
System.out.println("\n\n\n\n\n\n\n"+document+"\n\n\n\n\n");
}I know this code works as I use the exactly the same code in another application with the same XML file.
This is the XML file:
<root host="http://localhost:8080">
<branch name="Home Page" shortname="/" type="Home Page" instanceid="44987" typeid="1227">
<branch name="Films Archive" shortname="/films" type="Branch" instanceid="96354" typeid="1778">
<leaf name="Evil Dead" shortname="/films/evil_dead" type="Films" instanceid="58985" typeid="1147"/>
<leaf name="1984" shortname="/films/1984" type="Films" instanceid="49741" typeid="1147" />
</branch>
</branch
</root>And this is what I get when i print the document to the log file:
[#document: null]
Does anyone know why I cant get the class to read the document? I'm not getting any file not found exceptions or any other errors in the log.
Cheers,
PaulHi duffymo, I have tried as you suggested. I created a ServletContextListener implementation and in my web.xml file I have defined the XML file as a <context-param> and I have also defined the listener.
The ServletContextListener implementation creates the XML file as a resource using getResourceAsStream() and passes the InputStream to my parser. However, the parser still doesn't seem to work and prints out a null document in the log file: [#document: null]. Any ideas??
The web.xml file:
<context-param>
<param-name>siteDescriptor</param-name>
<param-value>/WEB-INF/SiteDescriptor.xml</param-value>
</context-param>
<listener>
<listener-class>cms.beans.InitializeXML</listener-class>
</listener>
......and the ServletContextListener is:
public class InitializeXML implements ServletContextListener
static InputStream in = null;
public void contextInitialized(ServletContextEvent sce)
ServletContext context = sce.getServletContext();
String siteDescriptor = context.getInitParameter("siteDescriptor");
try
in = context.getResourceAsStream(siteDescriptor);
catch(Exception e)
context.log("Error creating xml resource: " + e);
public void contextDestroyed(ServletContextEvent sce)
public static InputStream getXMLResource()
return in;
}Thanks,
Paul -
Problem when loading simple java class in Oracle
Hi,
I am using loadjava to load the java class in the oracle database. But it is failing. Can some one please help me out with this.
Command.
loadjava -thin -user username/password@zrtph0ja:1521:database -resolve firstProcedure.class
Errors:
Error while computing shortname of firstProcedure
ORA-06550: line 1, column 13:
PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Error while computing shortname of firstProcedure
ORA-06550: line 1, column 13:
PLS-00201: identifier 'DBMS_JAVA.SHORTNAME' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
ORA-29521: referenced name java/io/PrintStream could not be found
ORA-29521: referenced name java/lang/Object could not be found
ORA-29521: referenced name java/lang/String could not be found
ORA-29521: referenced name java/lang/StringBuffer could not be found
ORA-29521: referenced name java/lang/System could not be found
loadjava: 7 errors
Please help.
Regards
Sudhir
nullU havent installed JServer in ur DBMS.
Read the Oracle 8i JServer Manual for
manually installing the Oracle JVM. -
Netscape 's inconsistency in the loading of applets/classes
Please I will appreciate any help.
I am using Netscape version 4.75 on a Windows NT platform to launch my application.
My application is a collection of java classes and applet classes and a gif file all zipped
into an archive ( zip -o ). These classes are written in the old java version 1.0.2
(unfortunately).The problem is that when it is launched from a netscape browser,
sometimes all the classes get loaded but other times the loading fails. The zip file is not compressed since we realized that it was failing more often with a compressed zip file.
SO we removed the zip file... This is how we are launching the application now but this,
too, creates a problem because there are incidents of partial or incomplete loading of
the classes. This application has been in use for over 3 years now, what can I do?
Please help!
Ike EkeThanks for you quick response.
I have not tried a jar. Can I jar these classes that were written in java 1.0.2?
I have recommended that the application be upgraded to 1.1.x but they say there is
no money to do that, The customer would not fund it.
This problem does not occur on IE but we do not support IE any way. We run on HP,SUN,
and Windows NT platforms but this problem occurs only on NT. This is a production problem
so it occurs very where there is an NT machine ( over 200 NT users out there).
This is the version of Netscape that was chosen by the customer and yes it occurs on other netscape versions as well. I thought that jar files came with the emergence of java 1.1.x.
If it is possible to jar this outdated version of java classes, then I am willing to try it but
what is required to do this?
Thanks again
Ike
Maybe you are looking for
-
How to add criteria in vendor evaluation
Hi friends, For vandor evaluation , I wants to add 'Criteria' how can i add it. Regards, Mahesh.
-
Bookmark in PDF and Postscript
I put bookmarks in the report for the PDF output. If I output to postscript and later on reconstruct the PDF file the bookmarks are lost. Does anybody know if I can put bookmarks info in the postscript file? Thanks Alex
-
WHERE Predicate line works in Aqua Data Studio, not in Report Builder
I'm trying to get a query working in report builder which will pull data back when run in Aqua Data Studio. It returns a NULL set when working with the same data source from report builder. Here is the WHERE clause: --WHERE SYSDATE < :REM_DATE --
-
When I select iPhoto to open the application, a message comes up saying, "iPhoto is unable to open this library," and the only option available is to quit. I don't know what library iPhoto is attempting to open, but all I want to do is just start iPh
-
Powershell and SCCM Task Sequences
I previously posted this to the Powerwshell forum so hopefully cross posting isn't breaking any rules.... Does anyone know if there is any way to modify the sequence propery of an sms_tasksequencepackage object with Powershell? I am trying to migrat