Cannot Import Java Classes

I am trying to do the sample contact walkthrough in FLEX
builder. For the Java Adapter.
http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00000138 .html
I cannot get any import statements to work for the java class
files. I have tried this using the FDS as a J2EE application
running in tomcat, I have tried with the standalone JRUN version of
the FDS app.
I have put the contact files everywhere I can think of, in
the server classes folder, in the project, in the default web
folder and nothing I try works. I have even setup the project to
compile on the server and I get nothing. Everytime, I get errors.
I did the tutorial from the JDJ magazine:
http://java.sys-con.com/read/210991.htm
I cant get that java connection to work either. Please
someone help me.
The flex code is below.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.data.DataService;
import mx.collections.ArrayCollection;
import samples.contact.Contact;
public var ds:DataService;
[Bindable]
public var contacts:ArrayCollection;
//public var contact:Contact;
]]>
</mx:Script>
<mx:DataGrid id="dg" editable="true">
<mx:columns>
<mx:DataGridColumn dataField="contactId" headerText="Id"
editable="false"/>
<mx:DataGridColumn dataField="firstName"
headerText="First Name"/>
<mx:DataGridColumn dataField="lastName" headerText="Last
Name"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>

Ken, thank you for replying, I have had absolutly nothing but
problems trying to get this 'simple' thing to work.
Here is my code.
In the remote-config.xml file, I have this code:
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="SimpleJava">
<properties>
<source>javaSamples.SimpleMath</source>
</properties>
</destination>
</service>
Here is my MXML file: (Called new.MXML)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:RemoteObject id="math" destination="SimpleJava">
<mx:method name="doMath" concurrency="last"
result="fillTxt(event.result as int)"/>
</mx:RemoteObject>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent
private function fillTxt(b: int):void{
txtResult.text = (String)
//comment
]]>
</mx:Script>
<mx:Panel x="10" y="24" width="250" height="200"
layout="absolute" title="Simple Math with Java">
<mx:Label x="10" y="10" text="Input Number to
Multiply:"/>
<mx:TextInput x="10" y="36" id="txtNumber"
maxChars="1"/>
<mx:Label x="10" y="126" id="txtResult"/>
<mx:Label x="10" y="100" text="Your Number will appear
below:"/>
<mx:Button x="10" y="66" label="Multiply by 2"
click="math.doMath(txtNumber.text)"/>
</mx:Panel>
</mx:Application>
Here is my SimpleJava.java file:
package javaSamples;
//import java.util.*;
* @author jsanders
public class SimpleMath {
public int doMath(String a){
int new_a = Integer.parseInt(a.trim());
int b = new_a * 2;
return b;
//changesd
Like I said I have had absolutly nothing but problems with
this. Yesterday, I was getting send failures, So I did some
reasearch found some folks who said that they had the same problem,
and they had to hard code the app name into the services-config.xml
file. The file used to have {context.root} in it, and that variable
was set to /flex, now I hardcoded this line into the my-amf channel
definition to get rid of the send failure error.
<channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint uri="
http://{server.name}:{server.port}/flex/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
As you can see what should say:
http://{server.name}:{server.port}/{context.root}
Now says:
http://{server.name}:{server.port}/flex.
This was the only way I could get the send error to go away.
Now I worry that I might have broken something else. Since I
removed all references to {context.root} in that file.
{context.root} is defined in the flex-config.xml file, like
this:
<context-root>/flex</context-root>
I have tried it with or without the '/' in the value of the
context.root variable.
I have played with the remoting-config file, and I know that
I am accessing the destination.
I have played with the <source> option of the
destination, and I know that I am finding the class and making a
good connection.
I am using the JRUN install of FDS on my box, and yesterday
at the end of the day after getting the context.root situation
sorted out, I got a different error something like major.minor
versioning errors.
So the Java guys here at work told me that the JRUN version
packaged with FDS was 1.4, and I used 1.5 to compile my java class.
So I recompiled this morning with the 1.4 sdk. Now I dont get that
error about the major minor versioning anymore.
Now I get nothing. I use firefox, and all the browser tells
me is 'transferring data from localhost' Nothing else. It just sits
there and does nothing.
When I did the debug on it, I got into a loop on the
UIComponent.as file in the callLaterDispatcher(event:Event)
function.
Any clues what might be causing this new hang up. Basically
the machine just hangs. Is there a problem with the result from the
Method I am calling in the MXML? Did I do something wrong with the
Event as Int thing?
Again any help would be appreciated.

Similar Messages

  • Cannot import Java classes to form

    I am using Forms Forms [32 Bit] Version 10.1.2.0.2 (Production).
    I want to use the Persian Calendar from this web-site http://persiancalendar.sourceforge.net/.
    I download the stuff and there are 2 JAR files.
    I did this:
    -- Put the JAR files in my E:\Ora_Dev_10g_R2\forms\java directory
    -- Made an entry of these 2 in the E:\Ora_Dev_10g_R2\forms\server\formsweb.cfg file
    Now, when I open a form and got IMPORT JAVA CLASSES, I Can't see the classes.
    The directory structure of the 2 JAR files (after expanding is like this):
    persiancalendar.jar
    -> E:\Ora_Dev_10g_R2\forms\java\persiancalendar\com\ghasemkiani\util
    -> under util there is the sub-dir icu
    icu4j_3_2_calendar.jar
    -> E:\Ora_Dev_10g_R2\forms\java\icu4j_3_2_calendar\com\ibm\icu
    -> under icu there are these sub-directories impl, lang, math, text, util
    The E:\Ora_Dev_10g_R2\forms\java is in my CLASSPATH:
    C:\>echo %CLASSPATH%
    .;e:\Ora_Dev_10g_R2;*e:\Ora_Dev_10g_R2\forms\java*;D:\Program Files\QuickTime\QTSy
    stem\QTJava.zip;

    Scott,
    I agree with Abdetu, you should create your own thread for your question. However, to set an environment variable in UNIX you declare the variable and then export it. For example, in your default profile you could add the following:
    FORMS_BUILDER_CLASSPATH='Your Path Here'
    export FORMS_BUILDER_CLASSPATHCraig...
    Edited by: CraigB on Feb 4, 2011 11:24 AM

  • Error While Importing Java Classes

    I have Forms 6i and when i am trying to import Java classes i am getting the following error
    "PDE-UJI001 FAILED TO START THE JVM".
    i think i have not set the path and classpath properly.i am having Windows 2000 server as my OS. please help me how to solve this problem

    The Java Importer tool needs the JDK 1.2.2 to be installed on
    the machine to run properly. This JDK can be downloaded from the
    Sun web site at http://www.sun.com
    If there is no JDK 1.2.2, the Java Importer tool cannot be started.
    Either that or its not being found in the classpath.
    Regards
    Grant Ronald
    Forms Product Management

  • Error while importing java class into oracle forms 10g

    Hi
    I have generated a web service client using jdeveloper 10g. It consists of complex type methods. I am trying to import the class files using java importer in oracle form 10g. I am able import all of them successfully except one. That one is the main method. Please see the error and suggest me how to overcome this error.
    Exception occurred: java.lang.NoClassDefFoundError: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    Thanks in advance

    Do you see oracle/jdeveloper listed in "Import Java Classes" when you try to import?
    If not, make sure you add C:\DevSuiteHome_1\jdev\lib\jdev.jar to FORMS_BUILDER_CLASSPATH in registry
    Also excetion indicates: oracle/jdeveloper/webservices/runtime/WrappedDocLiteralStub
    If you typing it - type: oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub

  • Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec

    I have created a BPEL process in which i have used DB Adapter when i try to deploy the soa suite coposite i am getting the following error.
    [09:36:10 PM] Error deploying archive sca_TicketBooking_rev1.0.jar to partition "default" on server soa_server1 [http://utl-7c8735e613f:8001]
    [09:36:10 PM] HTTP error code returned [500]
    [09:36:10 PM] Error message from server:
    There was an error deploying the composite on soa_server1: [JCABinding] [TicketBooking.TicketBooking/1.0]Unable to complete unload due to: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec.
    [09:36:10 PM] Check server log for more details.
    [09:36:10 PM] Error deploying archive sca_TicketBooking_rev1.0.jar to partition "default" on server soa_server1 [http://utl-7c8735e613f:8001]
    [09:36:10 PM] #### Deployment incomplete. ####
    [09:36:10 PM] Error deploying archive file:/D:/Personal/OracleWork/RnDProjects/TicketBooking/TicketBooking/deploy/sca_TicketBooking_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)
    I already created the data source and JNDI Name in the DBAdapter but still getting the error while deploying the application.
    One mistake that i think i have made after creating the data source now the DBAdapter.rar file taking the path as follows.
    Source Path:     C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ was\ DbAdapter. rar
    Deployment Plan: C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ was\ Plan. xml
    initially the path was as follows:
    Source Path:     C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ DbAdapter. rar
    Deployment Plan: C:\ Oracle\ Middleware\ Oracle_SOA1\ soa\ connectors\ Plan. xml
    Please help me i have googled a lot but can't find the answer anywhere.
    Thanks in advance

    Mate ,
    Just check the health status and state of DB Adapter in the deployments of WLAdminConsole.
    If its inactive , redeploy and update it ,also make sure its targeted to the right server.

  • How to run the imported java class in form

    Help!!!!!
    Pls help me to run the imported java class in forms.
    Package is created in forms while imported one class called
    singlexml.class and that package has one procedure and one
    function.
    I just wanted to run that class.I mean the new package.
    Thanks
    Anil

    Hi,
    It is because the converter works on byte code and it only supports a subset of the Java language (see the JC specifications). It is kind of like compiling you code on Java 6 and trying to run it on Java 5. The JCDK outlines the required compiler version.
    Cheers,
    Shane

  • Importing Java class problem!

    Hello
    I have problem by Importing java class into form. When I select in Forms Builder from menu: Programs/Import Java Classes it returns error: PDE-UJI001 JVM not able to create!
    Can someone know what I must do to fix that problem?
    Thanks, Chrity

    It is a shame because it, probably, contains no special 1.5 new instruction at all.
    Maybe it would be possible to try replacing the current JDK/JRE of your <ORACLE_HOME>/jdk installation after a safe backup of course.
    You probably have a very little chance that it works, and it also won't be supported.
    Francois

  • Import Java Classes impossible?!

    Hello all!
    I tried in Forms 6i to use the option "import Java Class". But i always get the error-message PDE-UJI001, which I didn't find in any documentation. This error occurred on two different systems, in Win2000 and Win98.
    null

    Hi Martin!
    I had the same problem like you. What you have to do is the following.
    One solution is to read the metalink, search for the exception and import java classes.
    The second solution is:
    setting the classpath to the importer.jar file and to your directory where the classes you want to import are.
    And you have to set the path to jre\classic and jre\bin.
    For more questions, feel free to ask

  • Import Java Classes

    Hello,
    Is anybody knows where i can find documentation about the Import Java Classes functions in Forms9i.
    What they are, how to implement them, etc. ?

    Hi,
    did you check teh online help for the Java Importer?
    also:
    http://otn.oracle.com/products/forms/pdf/forms_in_java_world.pdf
    http://otn.oracle.com/products/forms/pdf/javaimporter.pdf
    Frank

  • How to import java Classes in report Builder

    Hi, I want to import classes from a jar file into Report Builder (10 g). I'm not able to find my JAR in -- Program --> Import Java Classes option.
    I have set the classpath pointing to my JAR.

    Hello,
    To import the Java classes:
    Add your jar in the REPORTS_CLASSPATH
    Launch Reports Builder.
    Note:
    You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
    Choose Program > Import Java Classes to display the Import Java Classes dialog box.
    Regards

  • How to import java Classes in report Builder 10g

    How to import java Classes in report Builder 10g .....
    Arshad

    Hello,
    To import the Java classes:
    Add your jar in the REPORTS_CLASSPATH
    Launch Reports Builder.
    Note:
    You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
    Choose Program > Import Java Classes to display the Import Java Classes dialog box.
    Regards

  • "Import Java Classes"in Oracle6i Forms

    Hello
    I have two questions regarding importing java classes in Forms 6i
    1- How we can add my own class to this list, so that I can import it directly in form 6i and use it?
    2- When these classes are used in form development, are they fully imported to client side or only class wrapper is ported to forms. I m asking this question, cuz I want to develop my application with all bussiness logic(Java classes) in middle tier ie Form Server.
    Can anyone guide me in this regard
    Thanks in advance
    Asif

    OK answers to the questions are:
    1) If your class is on the classpath it will be picked up by the Java importer but you have to restart Forms if you add the class to the path
    2) THe java importer is for middle tier. In Forms, all ofthe application logic is on the middle tier and if you want it integrate this with Java the importer will create a PLSQL wrapper to call the Java - in pretty much the same way as ORA_FFI. (So NOT imported into the client)
    There are some white papers on OTN.
    Regards
    Grant

  • Importing java classes into jsp page

    I'm trying to import java classes inside my jsp page, while doing that i am getting compilation error "package uma.natarajan.javaclasses" not found. I don't know where to copy the java files. i'm keeping my jsp files under public_html folder
              

    Hi uma,
              create uma\natarajan\javaclasses under weblogic_home\myserver and copy java
              classes(u want to import) to uma\natarajan\javaclasses and then u try.
              Concept is the java classes u import should be present in a classpath. Hope
              this may help u,
              Arun,
              [email protected]
              "uma natarajan" <[email protected]> wrote in message
              news:3a490bcb$[email protected]..
              > I'm trying to import java classes inside my jsp page, while doing that i
              am getting compilation error "package uma.natarajan.javaclasses" not found.
              I don't know where to copy the java files. i'm keeping my jsp files under
              public_html folder
              

  • PDE-UJ1001, while trying to import java classes.

    Hi,
    When I try to import java classes into forms using the java
    importer, I get an error stating PDE-UJ1001-Failed to create
    JVM. I tried installing a patch in Developer 2000(Path 4a). But
    still it doesnt work. Could anybody guide me in this?
    Thanks,
    Karthick.

    am getting similar error - my dba has suggested that oracle developer uses the jvm from ie4 but i'm sure that cant be true as i thought the jvm was built in.
    could somebody out there clarify this or inform me whats missing..
    error
    from dev 6i forms builder (6.0.8.11.3) on 8i (8.1.7.2.0) when trying to select option 'import java classes' from program menu returns error 'PDE-UJ1001 Failed to create the JVM.'
    regards and thanks in anticipation....
    vin ferguson

  • Problem When Import Java Class -compilation error

    Hi all
    I made a java class that has methods to return Screen width and Height .
    package tarek;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    public class Screen
    Dimension dim ;
    public Screen()
    dim = Toolkit.getDefaultToolkit().getScreenSize();
    public double getWidth()
    double w = dim.getWidth();
    return w;
    public double getHeight()
    double h=dim.getHeight();
    return h;
    I made the jar file " screen.jar" and make it ready to use in form builder
    I opened form builder and make import java class (From program>import java class>choose the class anc click import)
    The class now imported successfully and the PL/SQL package body is:
    PACKAGE Screen /* tarek.Screen */ IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    END;
    Now I made a button on the form and i WRITE THIS CODE TO INVOKE THE CLASS on when_button_pressed
    DECLARE
         vScreen_Class ORA_JAVA.JOBJECT;     
    BEGIN
         vScreen_Class := SCREEN.NEW;
    END;
    My problem is I have compilation error
    error 306 AT LINE 5 , COLUMN 25
    wrong number or types of argument in call to "NEW"
    I do not know what is the reason of this compilation error?
    Is it because the method in java return "double datatype" while in oracle return "number datatype"
    Please help
    Edited by: [email protected] on Dec 28, 2009 10:24 AM

    Sarah, I ca not move my thread to JDeveloper because it is not java issue. The problem is with my PL/SQL code and the way I make Import Java class to forms Builder. The Java code is OK.
    Andreas Thank you so much for replying. In fact I made a full compile "Ctrl+Alt+K". but still error
    The following is the package Body
    PACKAGE BODY Screen IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    args JNI.ARGLIST;
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    args := NULL;
    RETURN (JNI.NEW_OBJECT('tarek/Screen', '()V', args));
    END;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getHeight', '()D', args);
    END;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getWidth', '()D', args);
    END;
    BEGIN
    NULL;
    END;
    ---------------------------------------------------------------------------------

Maybe you are looking for

  • Apps running in the background

    It seems to be if you have the app linked to a watch complication or you have it on your glances page, then those apps loads much faster.  I figure they are always running so the data can be displayed on the watch face or quickly at a glance. So if y

  • How can i set this comparison in formula node

    a=[0,100] a<=5          => x=1 5<a<=10    => x=2 10<a<=95  => x=3 95<a<=98  => x=4 a>98          => x=5 Thank you. Solved! Go to Solution.

  • FN key not working brand new today :(

    just got my spectre today and I cant for the life of me figure out how to get the FN key working i have checked on the site for some sort of driver for it but there is none so i assume its built into the bios but its not like any bios i have ever see

  • Unbale to open report in CMC after upgrade BOXi 3.1

    Hi, When i run my crystal reports i am getting this error in event viewer I have only crystal reports 2008 no webi,nothing else I have recently upgraded from BOXI 3.1  sp5 to sp7 Error in Event Viewer : Faulting application name: hdump_ia32.exe, vers

  • 2.2.4 Problems

    I am getting these errors after the upgrade. I never got these before. javax.jdo.JDODataStoreException: ORA-01006: bind variable does not exist NestedThrowables: java.sql.SQLException: ORA-01006: bind variable does not exist I am running this code wh