java class instantiation problem

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

  1. #1

    Default java class instantiation problem

    i have a custom java class in [cfroot]..webinf/classes. the class works fine
    on my dev box, but fails to instantiate on my prodcution box. both boxes have
    the exact same features-- CFMX 7, mysql -- except the production box is running
    server 2003, and the dev box is running XP

    I;ve pasted below the error I get when I call the java class. I;m fairly sure
    this is not a cf code issue since this is the same code that works on the dev
    box. Based on the last line of the error: Caused by:
    java.lang.NullPointerException
    at PPReaderWEB.<init>(PPReaderWEB.java:41)-- it seems JRUN is looking for the
    ..java file which is in the same class dir. Is there a setting to tell it to
    load these classes? any help would be greatly appreciated.


    Object Instantiation Exception.
    An exception occurred when instantiating a java object. The cause of this
    exception was that: .

    The error occurred in C:\Inetpub\wwwroot\index.cfm: line 128

    126 : <cfswitch expression = "#session.nowProcessLogs#"><!---TO DO: passing
    the sourceSite to the java objects is redundant. axe it--->
    127 : <cfcase value="partyPoker">
    128 : <cfset objPPReader =
    createObject("java","PPReaderWEB").init(javacast(" String","partyPoker"),
    javacast("String",session.userName_pp) )>
    129 : </cfcase>
    130 : <cfcase value="pokerStars"> <!--- for now invoking bogus PSReaderWEB
    -- idnetical to PPReaderWEB and using pplogs --->

    Please try the following:

    * Check the ColdFusion documentation to verify that you are using the
    correct syntax.
    * Search the Knowledge Base to find a solution to your problem.

    Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
    Gecko/20050317 Firefox/1.0.2
    Remote Address 24.61.12.168
    Referrer
    Date/Time 01-Jul-05 01:04 AM
    Stack Trace
    at cfindex2ecfm944125949.runPage(C:\Inetpub\wwwroot\i ndex.cfm:128) at
    cfindex2ecfm944125949.runPage(C:\Inetpub\wwwroot\i ndex.cfm:128)

    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at coldfusion.runtime.java.JavaProxy.CreateObject(Jav aProxy.java:128)
    at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy .java:56)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.jav a:1627)
    at cfindex2ecfm944125949.runPage(C:\Inetpub\wwwroot\i ndex.cfm:128)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java :152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(Inclu deTag.java:343)
    at coldfusion.filter.CfincludeFilter.invoke(Cfinclude Filter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:210)
    at coldfusion.filter.PathFilter.invoke(PathFilter.jav a:86)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilt er.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:50)
    at coldfusion.filter.BrowserDebugFilter.invoke(Browse rDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
    er.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
    at coldfusion.CfmServlet.service(CfmServlet.java:105)
    at coldfusion.bootstrap.BootstrapServlet.service(Boot strapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:349)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:457)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:295)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)
    Caused by: java.lang.NullPointerException
    at PPReaderWEB.<init>(PPReaderWEB.java:41)
    ... 31 more


    JJBBDD Guest

  2. Similar Questions and Discussions

    1. Dynamic Class Instantiation with getDefinitionByName
      Ok so I am trying to follow the following example in instantiating a class dynamically: ...
    2. Coldfsuion + Java Instantiation Exception
      Hi, This is the error I am getting: An exception occurred when instantiating a java object. The cause of this exception was that: . when I...
    3. WebService class instantiation
      I have a question regarding WebService class instantiation through ActionScript for Flex. Everywhere I have seen the WebService class...
    4. Class Instantiation in PHP5
      I need to do something like the following with php5.0.1 and it's not working no matter what I try... Any suggestions? class foo extends blah{...
    5. PHP dynamic class instantiation like Java
      I've leafed through the docs and user comments on php.net, but haven't been able to find anything related to this. Is there a way to dynamically...
  3. #2

    Default java class instantiation problem

    i have a custom java class in [cfroot]..webinf/classes. the class works fine
    on my dev box, but fails to instantiate on my prodcution box. both boxes have
    the exact same features-- CFMX 7, mysql -- except the production box is running
    server 2003, and the dev box is running XP

    I;ve pasted below the error I get when I call the java class. I;m fairly sure
    this is not a cf code issue since this is the same code that works on the dev
    box. Based on the last line of the error: Caused by:
    java.lang.NullPointerException
    at PPReaderWEB.<init>(PPReaderWEB.java:41)-- it seems JRUN is looking for the
    ..java file which is in the same class dir. Is there a setting to tell it to
    load these classes? any help would be greatly appreciated.


    Object Instantiation Exception.
    An exception occurred when instantiating a java object. The cause of this
    exception was that: .

    The error occurred in C:\Inetpub\wwwroot\index.cfm: line 128

    126 : <cfswitch expression = "#session.nowProcessLogs#"><!---TO DO: passing
    the sourceSite to the java objects is redundant. axe it--->
    127 : <cfcase value="partyPoker">
    128 : <cfset objPPReader =
    createObject("java","PPReaderWEB").init(javacast(" String","partyPoker"),
    javacast("String",session.userName_pp) )>
    129 : </cfcase>
    130 : <cfcase value="pokerStars"> <!--- for now invoking bogus PSReaderWEB
    -- idnetical to PPReaderWEB and using pplogs --->

    Please try the following:

    * Check the ColdFusion documentation to verify that you are using the
    correct syntax.
    * Search the Knowledge Base to find a solution to your problem.

    Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
    Gecko/20050317 Firefox/1.0.2
    Remote Address 24.61.12.168
    Referrer
    Date/Time 01-Jul-05 01:04 AM
    Stack Trace
    at cfindex2ecfm944125949.runPage(C:\Inetpub\wwwroot\i ndex.cfm:128) at
    cfindex2ecfm944125949.runPage(C:\Inetpub\wwwroot\i ndex.cfm:128)

    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at coldfusion.runtime.java.JavaProxy.CreateObject(Jav aProxy.java:128)
    at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy .java:56)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.jav a:1627)
    at cfindex2ecfm944125949.runPage(C:\Inetpub\wwwroot\i ndex.cfm:128)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java :152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(Inclu deTag.java:343)
    at coldfusion.filter.CfincludeFilter.invoke(Cfinclude Filter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:210)
    at coldfusion.filter.PathFilter.invoke(PathFilter.jav a:86)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilt er.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:50)
    at coldfusion.filter.BrowserDebugFilter.invoke(Browse rDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
    er.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
    at coldfusion.CfmServlet.service(CfmServlet.java:105)
    at coldfusion.bootstrap.BootstrapServlet.service(Boot strapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:349)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:457)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:295)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)
    Caused by: java.lang.NullPointerException
    at PPReaderWEB.<init>(PPReaderWEB.java:41)
    ... 31 more


    JJBBDD 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