• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Stuck sending Message to JMS Queue

 
Ranch Hand
Posts: 66
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote the following code to send a text message to JMS Queue:

I got the following error:

I'm using Jdeveloper 11g and Weblogic 10.3.4. Could some one please point out my mistake(s)?
 
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at line 50: you assign null to the "env" variable. Then in line 52 (where the error occurred) you tried to call a method on that variable. You can't call a method of a null value.

The fix is to assign something other than null to "env" in line 50.
 
Debojit Sinha
Ranch Hand
Posts: 66
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:Look at line 50: you assign null to the "env" variable. Then in line 52 (where the error occurred) you tried to call a method on that variable. You can't call a method of a null value.

The fix is to assign something other than null to "env" in line 50.



Jesus, I deserve to be shot! Thanks a lot man, for pointing out what kind of prize numbskull i am.
 
Paul Clapham
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should I mark this as "solved", then?
 
Debojit Sinha
Ranch Hand
Posts: 66
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, please. Sorry for wasting everybody's time like this, I'm so embarrassed.
 
Paul Clapham
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes the "second pair of eyes" is helpful. Stick around here and maybe you can provide a similar service to some other unfortunate.
 
reply
    Bookmark Topic Watch Topic
  • New Topic