• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Webservices in weblogic -query

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I wrote a simple JAXRPC jse and tried to deploy in weblogic 81 and i am receiving the following exception

<Oct 4, 2005 12:50:25 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "WebServiceS
ervlet" failed to preload on startup in Web application: "pojo_jserpc".
javax.servlet.ServletException: Web Service init() failed: java.lang.NullPointer
Exception


The following is the code snippet of my JSE


/******************************************************************/


public class CurrencyJSE implements currency.CurrencyIntfc , ServiceLifecycle {


ServletEndpointContext ctx = null;
ServletContext servletContext = null;
int maxTry =5;
Hashtable currencyTable = null;




public void init(Object context) throws javax.xml.rpc.ServiceException
{


ctx = (ServletEndpointContext)context;
servletContext = ctx.getServletContext();
/*String env= servletContext.getInitParameter("MAX_TRY");
if(env == null)
{
env="5";
}
System.out.println("MAX TRY="+env);
maxTry = Integer.parseInt(env);*/

currencyTable = new Hashtable();

currencyTable.put("AUD", "30") ;
currencyTable.put("USD", "44") ;
currencyTable.put("SGD", "28") ;
currencyTable.put("MYR", "10") ;
currencyTable.put("CAD", "32") ;
currencyTable.put("INR", "1") ;





}

public String getCurrency(String toCountry , String amount)
{
String value = null;
String result = null;
int currentValue = 0;

result = (String)currencyTable.get(toCountry);

currentValue = Integer.parseInt(amount)* Integer.parseInt(result);

System.out.println("Current value="+currentValue);

value = String.valueOf(currentValue);
return value;
}

public void destroy()
{
System.out.println("CurrencyJSE DESTROYED *********");
}

)
/**********************************************************************/


Thanks
Arvindh
 
reply
    Bookmark Topic Watch Topic
  • New Topic