calling java object from cf

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default calling java object from cf

    Hi there, I am trying to call a java object from cf script but its not
    working. I know the class should be in web_root/WEB-INF/classes folder and i've
    my class in C:\Program Files\Apache Group\Apache2\htdocs\WEB-INF\classes
    folder. where C:\Program Files\Apache Group\Apache2\htdocs\ is the web-root.
    thats wut web-root means in this case, doesnt it? so ya, i get the error
    'Object Instantiation Exception. Class not found: extractor' I tried putting
    this class in another folder and put that path in the classpath in the
    administrator and that worked fine, but the problem with this method is that, i
    would've to restart the cf server everytime i compile my java file. any
    suggestions? thank you

    shahzad Guest

  2. Similar Questions and Discussions

    1. PLJava - Perl embeded into Java (calling Perl from Java) - 1sr release - call for tests and review, please.
      Recently on perlmonks.com I have posted a prototype of Perl embeded into Java (#372197="Embeding Perl into Java to use CPAN modules directly from...
    2. Calling JAVA service from .NET
      Hi, I have a question, somebody with exposure please answer. I need to call a JAVA webservice from C# (VS.6 & SOAP tool kit or VS.net). The Java...
    3. Calling a Java Web Service From C#
      Our client has a web service that we need to call to return us information about their customers. We pass in state and customer account number and...
    4. [newbie]Calling .net from Java
      Hello, i'm using Axis for accessing a c# webservice and all works fine. Now i must use a much smaller library for accessing the ws from an applet...
    5. calling a Java class from ASP
      I program java and asp, but my question is why do you want to call a java class from an ASP file and not just display it in an applet. Also can you...
  3. #2

    Default Re: calling java object from cf

    wow, doesn't anybody know anything about this either?


    shahzad Guest

  4. #3

    Default Re: calling java object from cf

    > thats wut web-root means in this case, doesnt it? so ya, i get the error
    > 'Object Instantiation Exception. Class not found:
    And is that directory in the classpath?
    > administrator and that worked fine, but the problem with this method is that, i
    > would've to restart the cf server everytime i compile my java file.
    I'm not quite sure what you mean, here.

    But you can tell CF to reload class files every time, instead of caching
    them in RAM. in your jrun-web.xml file, change the <reload /> node to be
    true.

    --

    Adam
    Adam Cameron Guest

  5. #4

    Default Re: calling java object from cf

    Hi thanks for the direct Sarge, that worked fine :) I don't have <reload />
    tag in jrun-web.xml file Adam. Would you mind telling me how i can put that tag
    in the file? i really don't want to restart the cf server every single time I
    do a new compile of my Java code. I don't know any XML. thank you very much
    for your help guys

    shahzad Guest

  6. #5

    Default Re: calling java object from cf

    Sarge:
    Any idea why your posting never made it onto the NNTP feed? I got everything
    else in the thread, just not your one. Odd.

    Has anyone at Macromedia confessed to be responible for administration of
    these forums yet?

    Adam

    Adam Cameron Guest

  7. #6

    Default Re: calling java object from cf

    > tag in jrun-web.xml file Adam. Would you mind telling me how i can put that tag
    > in the file? i really don't want to restart the cf server every single time I
    > do a new compile of my Java code. I don't know any XML. thank you very much
    > for your help guys
    This is my jrun-web.xml file. Theonly change I have made from the one that
    installs by default is uncommenting the <reload /> and <compile /> nodes.
    Yours will be similar, I should have thought...

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE jrun-web-app PUBLIC "-//Macromedia, Inc.//DTD jrun-web 1.0//EN"
    "http://www.macromedia.com/dtd/jrun-web.dtd">


    <!-- ================================================== =========== -->
    <!-- This XML file contains web application elements that are -->
    <!-- specific to the JRun Application Server -->
    <!-- ================================================== =========== -->
    <jrun-web-app>

    <!-- This setting is used in JRun SP to get CF to work correctly. -->
    <!-- Without this line, CF on JRun SP1 doesn't work -->
    <!-- If the server doesn't have the SP installed, JRun just ignores -->
    <!-- this line -->
    <enable-jrun-web-services>false</enable-jrun-web-services>


    <!-- session persistence needs to be disabled due to our classloader
    setup -->
    <session-config>
    <persistence-config>
    <active>false</active>
    </persistence-config>
    </session-config>


    <reload>TRUE</reload>

    <compile>TRUE</compile>
    <!--
    <virtual-mapping>
    <resource-path>/cfsuite</resource-path>
    <system-path>q:/coretests</system-path>
    </virtual-mapping>
    -->

    </jrun-web-app>


    --

    Adam
    Adam Cameron Guest

  8. #7

    Default Re: calling java object from cf

    nope, that didn't seem to do anything, I still had to restart cfserver to see
    the new change. Following is my jrun-web.xml file
    --------------------------------------------------------------------------------
    ---------------------------------------------- <?xml version='1.0'
    encoding='ISO-8859-1'?> <!DOCTYPE jrun-web-app PUBLIC '-//Macromedia, Inc.//DTD
    jrun-web 1.0//EN' 'http://www.macromedia.com/dtd/jrun-web.dtd'> <!--
    ================================================== =========== --> <!-- This XML
    file contains web application elements that are --> <!-- specific to the
    JRun Application Server --> <!--
    ================================================== =========== -->
    <jrun-web-app> <!-- This setting is used in JRun SP to get CF to work
    correctly. --> <!-- Without this line, CF on JRun SP1 doesn't work -->
    <!-- If the server doesn't have the SP installed, JRun just ignores -->
    <!-- this line -->
    <enable-jrun-web-services>false</enable-jrun-web-services> <!--
    ================================================== ========= --> <!-- Virtual
    path mappings allow a resource path to be mapped --> <!-- to a different
    physical location (i.e. not necessarily --> <!-- within the web
    application root). A resource-path can --> <!-- end with a wild card
    '*' indicating that all resources --> <!-- paths that start with the
    given path will be resolved using --> <!-- the system path.
    --> <!--
    ================================================== ========= -->
    <virtual-mapping> <resource-path>/WEB-INF</resource-path>
    <system-path>C:/CFusionMX7/wwwroot/WEB-INF</system-path> </virtual-mapping>
    <!-- session persistence needs to be disabled due to our classloader setup
    --> <session-config> <persistence-config> <active>false</active>
    </persistence-config> </session-config> <reload>TRUE</reload>
    <compile>TRUE</compile> </jrun-web-app>
    -------------------------------------------------------- thanks

    shahzad Guest

  9. #8

    Default Re: calling java object from cf

    ***BUMP***

    I am having this exact same issue, both in Windows with CF 7.0 and Unix with CF 6.1.

    Anyone have any more feedback on this issue?

    bobo111 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139