Using java objects in coldfusion

I have a java object, that needs to be used in a cfm page.
The java object itself references classes from an external jar
file. I've copied the java object class, and the external jar files
in the web-inf/lib directory of coldfusion.
My java object is:
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.params.HttpMethodParams;
public class TestObj{
public TestObj() {
// TODO Auto-generated constructor stub
public boolean Connect(String url)
boolean connected=true;
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(0, false));
try {
// Execute the method.
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
connected=false;
connected=true;
} catch (Exception e) {
connected=false;
} finally {
// Release the connection.
method.releaseConnection();
return(connected);
I'm accessing the object in the following way within the cfm:
<cfobject action="create" type="Java" class="TestObj"
name="tobj">
<cfset connctd=tobj.Connect("
http://some url...")>
I get an error '500 null' when I load this cfm. When I
comment out the code for httpclient and related objects in TestObj
and reload the page, I don't see an error. This makes me think that
httpclient is not accessible to the java object in the coldfusion
environment even though I've copied the related jar files for
httpclient and the other objects in the web-inf/lib directory.
So my question is: Can a java object, being called from a
coldfusion page, reference other java objects available in jar
files in a coldfusion environment?
Any help on this is greatly appreciated.
Thanks

Yes, my test class is in a jar.
Here's the error I'm seeing in exception.log:
"Error","jrpp-2"...
java.lang.NoClassDefFoundError
at TestObj.Connect(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:74)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
at
cfplayer2ecfm1189192416._factor6(C:\Webserver\player\player.cfm:157)
at
cfplayer2ecfm1189192416.runPage(C:\Webserver\player\player.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at
coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
at coldfusion.CfmServlet.service(CfmServlet.java:107)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
---------------------

Similar Messages

  • Using java object in a non java application

    Can you tell me how will i be able to use a java object(how can i instantiate a java class) in a non java application.I have read about COM,DCOM but these are fine only with micrososft platforms .Can anyone offer me alternative solutions...i also have read about CORBA ...kindly pour in your advice

    i have read about it thats true but had i understood it from the material i wouldnt have asked for help ..instead i would i have been working on my project..

  • Using Java Objects in my JSP page... objects are in a different directory

    Hi,
    I would like to call and use an object from a JSP page. The java object is in one directory, the jsp is in another. When I call my object, I get a JSP error that says it can't find the object and lists the directory name as part of the file.
    For example, here are my two files:
    /java/MyObject.class
    /web/page.jsp
    When I make the call to new MyObject(), I get an error message saying _web.MyObject cannot be found.  Any ideas on this?
    Thanks!

    Okay, I figured it out. In case anyone else needs it, here is what I needed to do.
    1) I created my object in a package. The JSP page was looking for the object in _dir directory because a package wasn't specified.  I created a subdirectory in one of the directories in my classpath and named it the same thing that the package was named.
    2) Import the package
    3) Make sure all methods in the classes are public, since only public methods can be accessed from outside the package.
    Thanks for the help, it got me going in the right direction.

  • How to use Java objects in business rules 11g

    I have made one business rule with two XML facts and then follow one doc to create the java facts.But I am unable to use the facts.

    No Java Facts are created,but as I have mentioned XML input and output facts at the time of creation of business rules,so I am not able to use java fact in business rule.
    Edited by: 856272 on Jan 4, 2012 6:22 AM

  • How to use Java threads in ColdFusion

    Hello Everybody,
    I have a question in concerns to threads. We all know that in
    CF8 we have this fantastic tag called <cfthread> which give
    us the ability to create assyncronous code, however, I was
    concerned about earlier versions of ColdFusion, like CF7 and CF
    6.1.
    How can I create a Java thread and use it in my CF code?
    Please, any help is much appreciated. Thanks in advance.
    Alvaro Costa
    Systems Analyst
    [email protected]

    A bean is obtain by <jsp:useBean> tag nd once bean is obtained we can get its property by using getProperty tag.

  • Advantages of using ejb vs java objects for pipeline components?

    hi,
    one of our applications is a fairly simple application. for simplicity sake, we are considering using java objects (accessing database tables) instead of ejbs for our pipeline components.
    before flying with this decision, we'd like to be sure we are not missing something obvious.
    please send me any references/pointers you have that summarize what the advantages of one approach (ejb vs java objects) over the other are.
    thanks!

    Wole, you will get a much better response posting this to
    weblogic.developer.interest.ejb newsgroup.
    Joseph Nguyen
    BEA Support
    "Wole Bankole" <[email protected]> wrote in message
    news:3c9a6a1a$[email protected]..
    hi,
    one of our applications is a fairly simple application. for simplicitysake, we are considering using java objects (accessing database tables)
    instead of ejbs for our pipeline components.
    >
    before flying with this decision, we'd like to be sure we are not missingsomething obvious.
    >
    please send me any references/pointers you have that summarize what theadvantages of one approach (ejb vs java objects) over the other are.
    >
    thanks!

  • What is the BEST practice - use BO or Java Object in process as webservice

    Hi All,
    I have my BP published as web service. I have defined My process input & output as BOs. My BP talks to DB through DAO layer(written in JAVA) which has Java objects. So I have BO as well as java Objects. Since I am collecting user input in BO, I have to assign individual values contained in BO to Java object's fields.
    I want to reduce this extra headache & want to use either of BO or Java object.I want to know What is the best practice - use BO or Java object as process input. If it is BO,how I can reuse BOs in Java?
    Thanks in advance.
    Thanks,
    Sujata P. Galinde

    Hi Mark,
    Thanks for your response. I also wanted to use java object only. When I use java object as process input argument..it is fine. But when I try to create Process web service, I am getting compilation error - "data type not supported".....
    To get rid of this error, I tried to use heir (BO inheriting from java class). But while invoking process as web service, it is not asking for fields that are inherited from java class.
    Then I created Business Object with a field of type java class... This also is not working. While sending request, it is giving an error that - field type for fields from java class not found.
    Conclusion - not able to use java object as process(exposed as web service) input argument .
    What is the Best & feasible way to accomplist the task - Process using DAO in Java & exposed as web service.
    Thanks & Regards,
    Sujata

  • Is it possible to send Java Object as parameter to an applet

    Is there a way to communicate to the applet using java objects instead of String parameters.
    can we do the following while invoking an applet
    <applet code=some.class>
    <param name=name value=object/>
    </applet>
    in applet
    Object obj = (Object) getParameter("name");
    Please le me know if you have any suggestions.
    Thanks!

    in the applet:
    URL url = new URL("mypage.jsp?somearg=somevalue");
    URLConnection conn = url.openConnection();
    conn.connect();
    ObjectInputStream in = new ObjectInputStream(conn.getInputStream());and in the JSP (although servlets would be better for this):
    <%@page import="java.io.*, java.util.*"
    %><% // This is important... if you are going to use JSP, you can't allow any newlines,
    // which is why servlets are better for this type of thing...
    String somearg = request.getParameter("somearg");
    ObjectOutputStream objOut = new ObjectOutputStream(response.getOutputStream());
    objOut.writeObject(someObject);
    objOut.flush();
    objOut.close();
    %>

  • Can scheduled tasks be set up using a Java Object?

    I need to run a script that will create a scheduled task in
    the Coldfusion Administrator CF8. I have used a Java Object to
    register a custom tag and I am wondering if you can do the same
    thing with a scheduled task.

    No special java class/object is needed actually. ColdFusion
    offers a built-in tag for this, <cfschedule>.
    Read more here:
    http://livedocs.adobe.com/coldfusion/8/Tags_r-s_11.html

  • Generation of XML file from Java objects using castor

    I have the following java file(Customer.java).
    public class Customer
         private String ID;
         private FirstName firstName;
         private MiddleName middleName;
         private LastName lastName;
         private ArrayList address;
         public ArrayList getAddress() {
              return address;
         public void setAddress(ArrayList address) {
              this.address = address;
         public FirstName getFirstName() {
              return firstName;
         public void setFirstName(FirstName firstName) {
              this.firstName = firstName;
         public String getID() {
              return ID;
         public void setID(String id) {
              ID = id;
         public LastName getLastName() {
              return lastName;
         public void setLastName(LastName lastName) {
              this.lastName = lastName;
         public MiddleName getMiddleName() {
              return middleName;
         public void setMiddleName(MiddleName middleName) {
              this.middleName = middleName;
    Using castor i have created an xml file(customer.xml) which has the following format.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <customer ID="fbs0001">
    <FIRSTNAME>Fred</FIRSTNAME>
    <MIDDLENAME>B</MIDDLENAME>
    <LASTNAME>Scerbo</LASTNAME>
    - <ADDRESS>
    <FIRSTLINE>No 18, Sheshadri road</FIRSTLINE>
    <SECONDLINE>Gandhinagar Bangalore</SECONDLINE>
    </ADDRESS>
    - <ADDRESS>
    <FIRSTLINE>ITPL</FIRSTLINE>
    <SECONDLINE>Whitefield Bangalore</SECONDLINE>
    </ADDRESS>
    </customer>
    I have used a mapping file to get this output.Is there a way where i can get the output xml in the following format without changing the Java object structure.If yes then please suggest how this can be done.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <customer ID="fbs0001">
    <FIRSTNAME>Fred</FIRSTNAME>
    <MIDDLENAME>B</MIDDLENAME>
    <LASTNAME>Scerbo</LASTNAME>
    </customer>
    <ADDRESS>
    <FIRSTLINE>No 18, Sheshadri road</FIRSTLINE>
    <SECONDLINE>Gandhinagar Bangalore</SECONDLINE>
    </ADDRESS>
    - <ADDRESS>
    <FIRSTLINE>ITPL</FIRSTLINE>
    <SECONDLINE>Whitefield Bangalore</SECONDLINE>
    </ADDRESS>
    I mean the output xml file should have the address as a separate tag not withing the root tag customer.

    Hello,
    Castor's own discussion groups might be able to point you to the solution you're looking for (if this use case is possible using Castor).
    Oracle has its own object-to-XML mapping tool that is part of the TopLink product. It allows you to map existing objects to an existing XML Schema. This can be done visually using the TopLink Workbench, or programmatically using the TopLink APIs. TopLink OXM also supports the JAXB specification.
    Using TopLink OXM to get the desired XML result I would recommend the following. Map the Customer and Address classes to XML, but don't map the relationship between Customer and Address. Then make the calls to the marshaller something like the following:
    marshaller.marshal(aCustomer, System.out);
    for(int x=0; x<aCustomer.getAddress().size(); x++) {
         marshal(aCustomer.getAddress().get(x), System.out);
    Example - Using TopLink OXM to map an existing object model to an existing XML Schema:
    http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp4/howto/ox/index.htm
    For more information on TopLink object-to-XML mapping:
    http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp4/objectxml/index.html
    -Blaise

  • How can I use XStream to persist complicated Java Object  to XML & backward

    Dear Sir:
    I met a problem as demo in my code below when i use XTream to persist my Java Object;
    How can I use XStream to persist complicated Java Object to XML & backward??
    See
    [1] main code
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import com.thoughtworks.xstream.XStream;
    import com.thoughtworks.xstream.io.xml.DomDriver;
    public class PhoneList {
         ArrayList<PhoneNumber> phones;
         ArrayList<Person> person;
         private PhoneList myphonelist ;
         private LocationTest location;
         private PhoneList(String name) {
         phones = new ArrayList<PhoneNumber>();
         person = new ArrayList<Person>();
         public ArrayList<PhoneNumber> getphones() {
              return phones;
         public ArrayList<Person> getperson() {
              return person;
         public void addPhoneNumber(PhoneNumber b1) {
              this.phones.add(b1);
         public void removePhoneNumber(PhoneNumber b1) {
              this.phones.remove(b1);
         public void addPerson(Person p1) {
              this.person.add(p1);
         public void removePerson(Person p1) {
              this.person.remove(p1);
         public void BuildList(){
              location = new LocationTest();
              XStream xstream = new XStream();
              myphonelist = new PhoneList("PhoneList");
              Person joe = new Person("Joe, Wallace");
              joe.setPhone(new PhoneNumber(123, "1234-456"));
              joe.setFax(new PhoneNumber(123, "9999-999"));
              Person geo= new Person("George Nixson");
              geo.setPhone(new PhoneNumber(925, "228-9999"));
              geo.getPhone().setLocationTest(location);          
              myphonelist.addPerson(joe);
              myphonelist.addPerson(geo);
         public PhoneList(){
              XStream xstream = new XStream();
              BuildList();
              saveStringToFile("C:\\temp\\test\\PhoneList.xml",convertToXML(myphonelist));
         public void saveStringToFile(String fileName, String saveString) {
              BufferedWriter bw = null;
              try {
                   bw = new BufferedWriter(
                             new FileWriter(fileName));
                   try {
                        bw.write(saveString);
                   finally {
                        bw.close();
              catch (IOException ex) {
                   ex.printStackTrace();
              //return saved;
         public String getStringFromFile(String fileName) {
              BufferedReader br = null;
              StringBuilder sb = new StringBuilder();
              try {
                   br = new BufferedReader(
                             new FileReader(fileName));
                   try {
                        String s;
                        while ((s = br.readLine()) != null) {
                             // add linefeed (\n) back since stripped by readline()
                             sb.append(s + "\n");
                   finally {
                        br.close();
              catch (Exception ex) {
                   ex.printStackTrace();
              return sb.toString();
         public  String convertToXML(PhoneList phonelist) {
              XStream xstream = new  XStream(new DomDriver());
              xstream.setMode(xstream.ID_REFERENCES) ;
              return xstream.toXML(phonelist);
         public static void main(String[] args) {
              new PhoneList();
    }[2].
    import java.io.Serializable;
    import javax.swing.JFrame;
    public class PhoneNumber implements Serializable{
           private      String      phone;
           private      String      fax;
           private      int      code;
           private      String      number;
           private      String      address;
           private      String      school;
           private      LocationTest      location;
           public PhoneNumber(int i, String str) {
                setCode(i);
                setNumber(str);
                address = "4256, Washington DC, USA";
                school = "Washington State University";
         public Object getPerson() {
              return null;
         public void setPhone(String phone) {
              this.phone = phone;
         public String getPhone() {
              return phone;
         public void setFax(String fax) {
              this.fax = fax;
         public String getFax() {
              return fax;
         public void setCode(int code) {
              this.code = code;
         public int getCode() {
              return code;
         public void setNumber(String number) {
              this.number = number;
         public String getNumber() {
              return number;
         public void setLocationTest(LocationTest bd) {
              this.location = bd;
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(location);
            f.getContentPane().add(location.getControls(), "Last");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
         public LocationTest getLocationTest() {
              return location;
         }[3].
    package test.temp;
    import java.io.Serializable;
    public class Person implements Serializable{
         private String           fullname;
           @SuppressWarnings("unused")
         private PhoneNumber      phone;
           @SuppressWarnings("unused")
         private PhoneNumber      fax;
         public Person(){
         public Person(String fname){
                fullname=fname;           
         public void setPhone(PhoneNumber phoneNumber) {
              phone = phoneNumber;
         public void setFax(PhoneNumber phoneNumber) {
              fax = phoneNumber;
         public PhoneNumber getPhone() {
              return phone ;
         public PhoneNumber getFax() {
              return fax;
        public String getName() {
            return fullname ;
        public void setName(String name) {
            this.fullname      = name;
        public String toString() {
            return getName();
    }[4]. LocationTest.java
    package test.temp;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class LocationTest extends JPanel implements ChangeListener
        Ellipse2D.Double ball;
        Line2D.Double    line;
        JSlider          translate;
        double           lastTheta = 0;
        public void stateChanged(ChangeEvent e)
            JSlider slider = (JSlider)e.getSource();
            String name = slider.getName();
            int value = slider.getValue();
            if(name.equals("rotation"))
                tilt(Math.toRadians(value));
            else if(name.equals("translate"))
                moveBall(value);
            repaint();
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(ball == null)
                initGeom();
            g2.setPaint(Color.green.darker());
            g2.draw(line);
            g2.setPaint(Color.red);
            g2.fill(ball);
        private void initGeom()
            int w = getWidth();
            int h = getHeight();
            int DIA = 30;
            int padFromEnd = 5;
            line = new Line2D.Double(w/4, h*15/16, w*3/4, h*15/16);
            double x = line.x2 - padFromEnd - DIA;
            double y = line.y2 - DIA;
            ball = new Ellipse2D.Double(x, y, DIA, DIA);
            // update translate slider values
            int max = (int)line.getP1().distance(line.getP2());
            translate.setMaximum(max);
            translate.setValue(max-padFromEnd);
        private void tilt(double theta)
            // rotate line from left end
            Point2D pivot = line.getP1();
            double lineLength = pivot.distance(line.getP2());
            Point2D.Double p2 = new Point2D.Double();
            p2.x = pivot.getX() + lineLength*Math.cos(theta);
            p2.y = pivot.getY() + lineLength*Math.sin(theta);
            line.setLine(pivot, p2);
            // find angle from pivot to ball center relative to line
            // ie, ball center -> pivot -> line end
            double cx = ball.getCenterX();
            double cy = ball.getCenterY();
            double pivotToCenter = pivot.distance(cx, cy);
            // angle of ball to horizon
            double dy = cy - pivot.getY();
            double dx = cx - pivot.getX();
            // relative angle phi = ball_to_horizon - last line_to_horizon
            double phi = Math.atan2(dy, dx) - lastTheta;
            // rotate ball from pivot
            double x = pivot.getX() + pivotToCenter*Math.cos(theta+phi);
            double y = pivot.getY() + pivotToCenter*Math.sin(theta+phi);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
            lastTheta = theta;  // save theta for next time
        private void moveBall(int distance)
            Point2D pivot = line.getP1();
            // ball touches line at distance from pivot
            double contactX = pivot.getX() + distance*Math.cos(lastTheta);
            double contactY = pivot.getY() + distance*Math.sin(lastTheta);
            // find new center location of ball
            // angle lambda = lastTheta - 90 degrees (anti-clockwise)
            double lambda = lastTheta - Math.PI/2;
            double x = contactX + (ball.width/2)*Math.cos(lambda);
            double y = contactY + (ball.height/2)*Math.sin(lambda);
            ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
        JPanel getControls()
            JSlider rotate = getSlider("rotation angle", "rotation", -90, 0, 0, 5, 15);
            translate = getSlider("distance from end",  "translate", 0, 100, 100,25, 50);
            JPanel panel = new JPanel(new GridLayout(0,1));
            panel.add(rotate);
            panel.add(translate);
            return panel;
        private JSlider getSlider(String title, String name, int min, int max,
                                  int value, int minorSpace, int majorSpace)
            JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
            slider.setBorder(BorderFactory.createTitledBorder(title));
            slider.setName(name);
            slider.setPaintTicks(true);
            slider.setMinorTickSpacing(minorSpace);
            slider.setMajorTickSpacing(majorSpace);
            slider.setPaintLabels(true);
            slider.addChangeListener(this);
            return slider;
    }OK, My questions are:
    [1]. what I generated XML by XSTream is very complicated, especially for object LocationTest, Can we make it as simple as others such as Person object??
    [2]. after I run it, LocationTest will popup and a red ball in a panel will dsiplay, after I change red ball's position, I hope to persist it to xml, then when I read it back, I hope to get same picture, ie, red ball stiil in old position, How to do that??
    Thanks a lot!!

    Positive feedback? Then please take this in a positive way: if you want to work on persisting Java objects into XML, then GUI programming is irrelevant to that goal. The 1,000 lines of code you posted there appeared to me to have a whole lot of GUI code in it. You should produce a smaller (much smaller) example of what you want to do. Calling the working code from your GUI program should come later.

  • How do you reference a Formular Object on a Crystal Report using Java

    Hi all,
    I am trying to reference an object on my report which contains a Formula field.
    I have read the following 2 threads, but they refer to textObjects:
    [How do you reference a textObject on a Crystal report using Java|Re: How do you reference a textObject on a Crystal report using Java?]
    [Changing the text of ITextObject programatically|Re: Changing the text of ITextObject programatically]
    But I cannot even get those to work. I can reference a object which refers to a database field but as soon as I try
    reference a textObject or reportObject I just get a NULL variable.
    Below is the code I am useing
    IReportObject dbField = reportClientDocument.getReportDefController().findObjectByName("BOB1");
    IReportObject textBob = reportClientDocument.getReportDefController().findObjectByName("BOB2");
    "BOB1" is the name of my DB field Object, and "BOB2" can be a Text box or a Formula item and I just get nothing.
    I have just tested it with a FieldHeadingObject and that returns a valid object, so clearly I am going about this the wrong way
    for objects I place on the reports which are not driven by the database items.
    Ultimately what I want to do is reference an object in the Report Footer which will contain the RecordCount of the number of
    records contained in the report, which I am them going to use to determine if the report holds data,
    if it does I will print it, else ignore it and move on the the next report. I am doing this so that I can at an extra filter to split
    a report up into groups and produce a sinlge PDF for each group instead of one massive PDF containing all the groups.
    So if someone has a solution to any of my problems I would be very greatful, and I dont mind being told Im an idiot and should
    rather do it another way, as long as you supply that other way
    Thanks for the help
    Darren
    Edited by: Darren Jackson on Dec 16, 2009 7:29 PM
    Forgot to add am using CR4Ev2 SP3

    Right I have made some headway.
    Firstly, Im an idiot. I was making changes and setting up test fields on my report, but then when running the app, I had it looking at
    the backup report, which would explain why all the new textbox fields were not being found.
    The stupiditity did force me to delve deep and work out a fair bit of how the reports work, so cant complain too much. BUT, I am still
    not able to return values of Formula fields and formulas extra. Could someone tell me if this is even possible. I get retrieve the formula field
    name, and properties but not its value once the report has been populated. Am I wasting my time?
    Well I will continue dismantling my reports till I find the answer, or someone points me in the right direction.
    If any one is interested this is the code I used to drill down to my text boxes:
    IReportObject recCount = reportClientDocument.getReportDefController().findObjectByName("TB1");
    ITextObject obj_RecCount = (ITextObject) recCount;
    System.out.println(obj_RecCount.getName());
    Paragraphs objP = obj_RecCount.getParagraphs();
    for (int i = 0; i < objP.size(); i++){
         ParagraphElements pE = objP.getParagraph(i).getParagraphElements();
         for (int j = 0;j < pE.size(); j++){
              IParagraphTextElement pEE = (ParagraphTextElement) pE.getParagraphElement(j);
              System.out.println(pEE.getText());
    Cheers

  • Reg XML generation from java objects using SAX 2.0

    i'm using java 1.6 and i've imported following class to generate XML from java objects
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    the following class has been imple her to create a Xml file and tag elements ,
    OutputFormat of = new OutputFormat("XML", "iso-8859-1", true);
    XMLSerializer serializer = new XMLSerializer(fos, of);
    ContentHandler hd = serializer.asContentHandler();
    hd.startDocument();
    everything works fine but i'm getting warrnin reg the serializer and outputformat
    warring is:
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    com.sun.org.apache.xml.internal.serialize.OutputFormat is Sun proprietary API and may be removed in a future release
    HOW CAN I AVOID DS WARRING PLZ HELP REG DS
    thanks ,
    with regards,
    Rajesh.S

    I've been having the same problem. Here is what i found:
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6476630]
    Hope that helps (or at least helps you feel better).

  • [Urgent] using javafx object in java project

    Suppose I here created a very simple java project and the main file is like below,
    public class test {
        public static void main(String[] args){
                System.out.println("Hello World!");
    }and in this particular java project, I need to use another javafx object which is defined as (the javafx and java file are in the same package),
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Circle;
    var stage: Stage = Stage {
        title: "Declaring Is Easy!"
        scene: Scene {
            width: 300
            height: 250
            content: [
                Circle {
                    centerX: 150  centerY: 120 radius: 80
                    fill: Color.MAROON
                    stroke: Color.INDIANRED
                    strokeWidth: 10.0
                }, //Circle
                Rectangle {
                    x: 25, y: 80 width: 250, height: 80
                    arcWidth: 20 arcHeight: 20
                    fill: Color.web("#6699ff")
                    stroke: Color.web("#003399")
              strokeWidth: 5.0
                } //Rectangle
            ] //Content
        } //Scene
    } //StageSo how could I achieve this?
    Regards.

    Thanks for your reply.
    But would you please elaborate on this sentence: create the fx class using Class.forName("....").newInstance()?
    Indeed I implemented an interface which was extended by the javafx class, and in the main java file I need to write following codes to use this object,
    Context context = FXLocal.getContext();
            FXClassType instance = context.findClass("packageName.JavaFXClass");
            ObjectValue obj = (ObjectValue)instance.newInstance();
            JavaInterface ji = (JavaInterface)obj.asObject();The problem that I encountered right now is, the exception was thrown at context.findClass("javatest.MyChart");, since it's not able for the compiler to find the JavaFXClass.class.
    I checked the folder build\classes\packageName and noticed that both my main JavaClass and JavaInterface have been compiled with .class file, while the JavaFXClass was not, which means the file JavaFXClass.class doesn't exist.
    What's the solution?

  • Acrobat standard 9.0 error while enabling commets option using Java script object

    I'm using the below java script code in my VB 6.0 application for enabling commets options in the PDF file
    Dim oJSO As Object
    Set oJSO = mPDDoc.GetJSObject
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    It is working fine till Acrobat 8.0. Now I'm trying with Acrobat 9.0 standard edition, it is throwing scripting error 'An unhandled Win32 exception occured in Acrobat.exe[308].
    Can anyone suggest the way to enable 'comment' options in Acrobat Standard 9.0 using Java Script Object?
    Thanks

    I get much the same problem with VB6, Acrobat 9 Pro and WinXP SP3. When I single step the line:
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    in debug I go to the error handler for my Sub. Inspecting the VB Err object has Number = -2147417851 and Description = "Automation error
    The server threw an exception." I get a Microsoft crash notice about Acrobat a short while later.
    I've experimented with the JavaScript debugger in Acrobat and you can execute Collab.showAnnotToolsWhenNoCollab = True and reference the value of Collab.showAnnotToolsWhenNoCollab in the console. The problem appears only when accessing Acrobat Javascript through the Interapplication Communication API.
    If anyone can help it would be appreciated. I tried Adobe's Acrobat support and they were no help at all.

Maybe you are looking for

  • Can't get Airplay to work on iTunes 11.0.2

    Anyone know any fix? I have a bunch of Airport Express 802.11n (1st Gen) that I need to play stuff on. Have lots of people over and now I have no way to play music. Can't seem to connect to any of the Airport Expresses. What gives?

  • How to call a standard BOR method in a program.

    Hi All, How to call a standard BOR method in a program. For example I have to call BOR method ISUSMORDER.Release in my program but don't know how to call. Also, plz tell me how to capture the Exceptions in case of BOR method. Plz help me out in this.

  • I can download a program but wont instal

    I downloaded a free trail of a DJ software i am thinking of buying, but after i downloaded it, i click to open and it said i couldn't install because its says this program can not be run is DOS mode. Can someone help me? Im on my first mac and am abs

  • Version 8

    How do I get back Itunes version 8. My computer is not compatible with the new Itunes 10

  • Scanning in "Preview" not working.

    When trying to scan I get message "Preview quit unexpectedly." I ran Disk Utility and got this: "Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired." What