Weblogic 10.3 ---- PrintService class is not finding printers

Hi folks,
Am facing an issue in Weblogic 10.3. I have deployed my application which prints the pdf files.
When i am getting print services available in my machine using
*PrintService[] printService =
PrinterJob.lookupPrintServices(); *
its returning printService.length as *0*.
But the same application is working fine in other environments like Oracle Soa Suite 10.1.3.3 and Jdeveloper 10.1.3.3.
Can anybody please suggest on this.
Please find the Sample Code:
import java.awt.print.PrinterJob;
import javax.print.PrintService;
import org.pdfbox.pdmodel.PDDocument;
public class PrintPdf {
public void print(String printerName, String pdfFile) {
PDDocument document = null;
try {
document = PDDocument.load(pdfFile);
PrinterJob printJob = PrinterJob.getPrinterJob();
boolean printerFound = false;
PrintService[] printService = PrinterJob.lookupPrintServices();
System.out.println("printService length: " + printService.length); //* printService.length is returning 0 *
for (int i = 0; i < printService.length; i++) {
System.out.println(i + "==> printService Name: " +
printService.getName());
if (printService[i].getName().indexOf(printerName) != -1) {
printJob.setPrintService(printService[i]);
printerFound = true;
System.out.println("Got Printer");
if (!printerFound) {
System.out.println("Printer Not found");
} else {
printJob.setPageable(document);
printJob.print();
System.out.println("Print Successfull");
} catch (Exception e) {
e.printStackTrace();

Thanks for your help.
When i created a work manager from Deployments -> Configuration -> Workload -> New and the new Work Manager appears in the Application-Scoped Work Managers table. But was not able to see that in Monitering -> Workload Work managers table. Why is that so?
Regards,
Smita

Similar Messages

  • Can not start WebLogic in Eclipse. Error: "Could not find the main class."

    I have installed Eclipse 2.0 and WebLogic Server 6.1. and the WebLogc plug in from GENUITEC (and jdk1.3.1_04, on Win2K Server). After I have done the configuration, the WebLogic start/stop buttons are integried into the Eclipse Toolbar, but when I click on the start button to start Weblogic, it pops up a dialog box "Java Virtual Machine Launcher" with message: "Could not find the main class. Program will exit!"
    Starting WebLogc Server from the Start panel works fine.
    Does any one have seen this before or have a suggestion what I should do?
    Many many thanks in advance.
    Huan

    Weblogic must be started with a full JDK; otherwise
    JSPs and dynamic EJB stubs could not be deployed. The
    error message
    indicates you are attempting to use a JRE. Configure
    Eclipse JRE to point to a JDK. The product
    documentation will help you with this process. It does not work for me. :-(
    I have tried JDK 1.3.1 and 1.4.1: same result: I get a "Could not find the main class: Program will exit"
    For free expert support please consider contacting
    Genuitec at [email protected] If just want any
    answer ask a newsgroup.
    WayneI'll try the support at '[email protected]' :)
    Michel
    Michel Szybist
    [email protected]
    Fax: +33 (0)173729897
    SMS: http://www.szybist.net/

  • CNiFieldPointNetworkModule Class reference not find in Measurement Studio 2009

    Hi all,
    I am having a application on Visual Studio 2003 and Measurement Studio 7.1 .
    I want to migrate this application on Visual Studio 2005 and Measurement Studio 2009. 
    My application is using CNiFieldPointNetworkModule class ,
    I am unable to find the class in  Measurement Studio 2009 include Please provide the
    refrence how to use these file in Measurement Studio 2009.
    Thanks
    Nityanand

    Hello
    Change your definition to the following
    Dim Peaklocation As Variant
    Dim Peakamplitute As Variant
    Dim SD As Variant
    The VB help for this function states that these parameters need to be defined as Variants and not as array of variants. The PeakDetector function will automatically allocate an array of doubles and populate the variant with it. You can then index the variant to obtain the data as you would an array.
    I hope it helps
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Bonjour For Windows not finding printers

    Hi I don't know if I'm using Bonjour right so I thought I'd ask the experts (you guys!)
    I have three printers connected to a desktop running Windows Vista.
    I just got a Macbook Pro and would like to wirelessly print from my Macbook to the printers connected to Vista.
    The guy at the Apple store said Bonjour For Windows would help me do this but when I go into the wizard, it says there are no Bonjour printers.
    How do I make my three printers "Bonjour printers" so I can print to them from my Macbook?
    Thanks!

    I think you would have to have the printers hung from the USB port (or several ports with a powered hub) hanging off a Time Capsule, or the Airport Express routers. Then, they can be shared between PC and Mac.
    You say the printers are connected via USB to the Win box? Can you set up printer sharing on the Win side and then maybe they will be seen by Bonjour. (But you will have to leave your PC on to print to them)
    Or, if any of them have network interfaces, connect them to a switch and print from Mac and PC via your local network.
    Jeff

  • Could not find classloader

    Hi,
    I just installed WLS 8.1 and deployed my EJB jar file using the admin console.
    According to the console the my service has been deployed successfully. However
    looking into the server log I see the following error:
    .DeploymentException: [Deployer:149233]An unexpected error was encountered during
    the deployment process. - with nested exception:
    [weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not find classloader
    for  MINAService.jar in {MINAService.jar=CLNode{[gcl], 18544571->10808772,[MINAService@],[MINAService.jar],[J2EEApplicationContainer$Component(MINAService)]}}
         at weblogic.management.deploy.slave.SlaveDeployer.throwUnexpected(SlaveDeployer.java:2222)
         at weblogic.management.deploy.slave.SlaveDeployer.access$700(SlaveDeployer.java:132)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2364)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2431)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2343)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    The server is running on port 7001. When I try to connect to the server at t3://localhost:7001
    using my EJB client I get an excpetion saying:
    We were unable to get a connection to the WebLogic server at t3://localhost:7001
    Please make sure that the server is running.
    Any idea what's going on?
    Thanks very much.
    Tony.

    My client code was wrong.
    Tony.
    "Tony Blair" <[email protected]> wrote:
    >
    Hi,
    I just installed WLS 8.1 and deployed my EJB jar file using the admin
    console.
    According to the console the my service has been deployed successfully.
    However
    looking into the server log I see the following error:
    .DeploymentException: [Deployer:149233]An unexpected error was encountered
    during
    the deployment process. - with nested exception:
    [weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Could not
    find classloader
    for  MINAService.jar in {MINAService.jar=CLNode{[gcl], 18544571->10808772,[MINAService@],[MINAService.jar],[J2EEApplicationContainer$Component(MINAService)]}}
         at weblogic.management.deploy.slave.SlaveDeployer.throwUnexpected(SlaveDeployer.java:2222)
         at weblogic.management.deploy.slave.SlaveDeployer.access$700(SlaveDeployer.java:132)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2364)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2431)
         at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2343)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:833)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:542)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    The server is running on port 7001. When I try to connect to the server
    at t3://localhost:7001
    using my EJB client I get an excpetion saying:
    We were unable to get a connection to the WebLogic server at t3://localhost:7001
    Please make sure that the server is running.
    Any idea what's going on?
    Thanks very much.
    Tony.

  • Ifs902 doe not find tiff files in search

    Hi gurus,
    i'm have this issue too you:
    I'm creating an application that search for
    files in 9ifs. Some of this files are TIFF type.
    search class is not able to find any kind of files
    of that type.
    There was a problem with the Annotator agent that
    throw a exception when annotating TIFF files, but
    I've changed the Annotator.jar, using now Annotator.jar
    from cmsdk903.
    The Exceptions were not throw anymore but search classes
    can not find the document yet.
    Does anyone knows anything that can help?
    Thanks in advance!
    Felippe.

    Hello Gokce,
    After cmd-f in the Finder you have to click *on the button labeled "Kind"*, don't confuse that with the button right next to Kind is... . Now a pop up menu will open from which you have to choose "Other...". Another menu appears from which you can choose "System Files".
    floba

  • Could not find or load main class weblogic.WLST

    Hi,
    I am trying to run a python script to create JMS components for use with iHub and i got the following error message when i try to run the script:
    C:\ihub\bin>java weblogic.WLST omipmihubwlscript.py weblogicjms Welcome1 http://<servername>:7111 OMIPMIHUBServer
    Error: Could not find or load main class weblogic.WLST
    I have run the setWLSEnv.cmd file and got the following output
    C:\oracle\Middleware2\wlserver_10.3\server\bin>setWLSEnv.cmd
    CLASSPATH="C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\sys_manifest_classpath\weblogic_p
    atch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~2\mod
    ules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~2\modu
    les\NETSFA~1.0_1/lib/ant-contrib.jar;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\sys_man
    ifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic.
    jar;C:\oracle\MIDDLE~2\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1/lib/ant-all.j
    ar;C:\oracle\MIDDLE~2\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~2\patch_ocp37
    1\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\PROGRA~1\Java\JDK17~1.0_1\lib\tools.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~2\WLSER
    V~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~2\modules\features\weblogic.server.modules_10.3.6.0.jar;C:\oracle\MIDDLE~2\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~2\module
    s\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~2\modules\NETSFA~1.0_1/lib/ant-contrib.jar;"
    PATH="C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDD
    LE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\oracle\MIDDLE~2\patch_wls1036\profiles\defa
    ult\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDDLE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\module
    s\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\oracle\MIDDLE~2\patch_wls1036\profiles\default\native;C:\oracle\MIDDLE~2\patch_ocp371\profiles\
    default\native;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64;C:\oracle\MIDDLE~2\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~2\modules\ORGAPA~1.1\bin;C:\PROGRA~1\Java\JDK17~1.0_1\jre\bi
    n;C:\PROGRA~1\Java\JDK17~1.0_1\bin;C:\app\paul.currie\product\11.2.0\client_2\bin;C:\app\paul.currie\product\11.2.0\dbhome_3\bin;C:\Program Files (x86)\PC Connectivity Solution\;C:\Wind
    ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_13\jre\bin;;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x
    64\oci920_8;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64\oci920_8;C:\oracle\MIDDLE~2\WLSERV~1.3\server\native\win\x64\oci920_8"
    Your environment has been set.
    I am totally stuck at this point so any help would be much appreciated.
    Cheers
    Paul

    I have just tested both on a Windows and a Linux server and it works fine.
    D:\oracle\product\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd
    CLASSPATH=D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\oracle\
    product\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\oracle\product\JAVA_C~1\li
    b\tools.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\serve
    r\lib\weblogic.jar;D:\oracle\product\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;D:\oracle\product\MI
    DDLE~1\WLSERV~1.3\server\lib\webservices.jar;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;D:\oracle\pro
    duct\MIDDLE~1\modules\NETSFA~2.0_1/lib/ant-contrib.jar;D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\sys_man
    ifest_classpath\weblogic_patch.jar;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\web
    logic_patch.jar;D:\oracle\product\JAVA_C~1\lib\tools.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.ja
    r;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;D:\oracle\product\MIDDLE~1\modules\features\weblogic.ser
    ver.modules_10.3.5.0.jar;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;D:\oracle\product\MIDDLE~1\mod
    ules\ORGAPA~1.1/lib/ant-all.jar;D:\oracle\product\MIDDLE~1\modules\NETSFA~2.0_1/lib/ant-contrib.jar;
    PATH=D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\native;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles
    \default\native;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server
    \bin;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1\bin;D:\oracle\product\JAVA_C~1\jre\bin;D:\oracle\product\JAVA_C~1\bin
    ;D:\oracle\product\MIDDLE~1\patch_wls1035\profiles\default\native;D:\oracle\product\MIDDLE~1\patch_jdev1111\profiles\def
    ault\native;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\bin
    ;D:\oracle\product\MIDDLE~1\modules\ORGAPA~1.1\bin;D:\oracle\product\JAVA_C~1\jre\bin;D:\oracle\product\JAVA_C~1\bin;C:\
    Program Files\Legato\nsr\bin;C:\PROGRA~2\CA\SHARED~1\ETPKI\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C
    :\Windows\System32\WindowsPowerShell\v1.0\;D:\oracle\Java\current\jre\bin;C:\PROGRA~2\CA\IDENTI~1\PROVIS~1\BIN;C:\Progra
    m Files (x86)\CA\SharedComponents\CAM\bin;D:\oracle\product\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8;D:\oracle
    \product\MIDDLE~1\WLSERV~1.3\server\native\win\x64\oci920_8
    Your environment has been set.
    D:\oracle\product\Middleware\wlserver_10.3\server\bin>java weblogic.WLST
    Initializing WebLogic Scripting Tool (WLST) ...
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands
    wls:/offline>

  • Weblogic not finding javax.naming classes when instantiating bean

    Hello,
              I am developing a JSP which contains a JavaBean.
              This bean is a wrapper for a session EJB, the getProperty() methods in
              the bean call methods on the EJB's remote interface.
              I have tested this bean as a stand alone application by adding a
              main(String[] args) method to it and it works.
              However, when adding the bean to the JSP, the JSP does not show in the
              browser, I get a n internal server error 500 instead.
              It seems that Weblogic is not finding the javax.naming.NamingException
              class when instantiating the bean.
              When looking at the weblogic log, I see the following stack trace:
              Fri Aug 18 15:12:06 EDT 2000:<E> <ServletContext-General> Servlet failed
              with Exception
              java.lang.NoClassDefFoundError: javax/naming/NamingException
              at java.lang.ClassLoader.resolveClass0(Native Method)
              at java.lang.ClassLoader.resolveClass(ClassLoader.java:579)
              at
              weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(GenericClassLoader.java,
              Compiled Code)
              at
              weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
              Compiled Code)
              at
              weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
              Compiled Code)
              at java.beans.Beans.instantiate(Beans.java:194)
              at java.beans.Beans.instantiate(Beans.java:55)
              at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1138)
              at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java,
              Compiled Code)
              at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1554)
              at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java, Compiled Code)
              at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
              Code)
              at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
              at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code)
              at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
              at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
              at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
              Compiled Code)
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
              Code)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
              at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:92)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:191)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:118)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:744)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:692)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:251)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              Any idea on how to fix this?
              Thanks for any help,
              David
              

              yes, weblogicaux.jar is definitely in the weblogic.class.path. i've even tried starting the server from the command line, declaring the classes there. my "trade.xml" document has the URI set as "http://localhost:7001/BizTalkServer". when i enter this on the "BizClient.jsp" form, i get the error discussed below. however, if i enter "http://localhost:7001", even though this is not the explicit location of the BizTalk server, the server returns:
              Thank you! Your trade has been recieved. A BizTalk document has been sent to http://localhost:7001/ with the following information: etc...............
              So there appears to be something wrong with the "/BizTalkServer" setup on my machine. Any ideas?
              Kumar Allamraju <[email protected]> wrote:
              >Make sure weblogicaux.jar is in your weblogic.class.path
              >
              >i.e -Dweblogic.class.path=$WL_HOME/lib/weblogicaux.jar:$WL_HOME/classes etc etc...
              >
              >--
              >Kumar
              >
              >Mike Bachers wrote:
              >
              >> I'm currently struggling with a similar problem, although as a newcomer to WL I'm having some trouble figuring it out. I'm trying to run the BizTalk server example (http://www.weblogic.com/docs51/examples/xml/biztalk/index.html) under Windows 2000 and JDK1.2.2. I'm able to proceed without problems until I submit the form on the "BizClient.jsp" page. At this point, I receive this error:
              >> ------------------------------------------------
              >> There was a problem connecting to the BizTalk server. Exception caught: java.io.FileNotFoundException: Response: '500' for url: 'http://localhost:7001/BizTalkServer'
              >> ------------------------------------------------
              >>
              >> At the same time, the WL console spits this out:
              >> ------------------------------------------------
              >> java.lang.NoClassDefFoundError: javax/naming/NamingException
              >> ....
              >> ------------------------------------------------
              >>
              >> I know this class is in the weblogicaux.jar, and it's included in my classpath. I think David's fix (see below) is getting at my problem, too, but I'm not sure. Anyone relate?
              >>
              >> "David R. Heffelfinger" <[email protected]> wrote:
              >> >Figured it out. The problem was that the beans were in a directory
              >> >in the JAVA_CLASSPATH in weblogic.properties. Moved the directory to
              >> >WEBLOGIC_CLASSPATH and the problem went away.
              >> >
              >> >David
              >> >
              >> >"David R. Heffelfinger" wrote:
              >> >
              >> >> Hello,
              >> >>
              >> >> I am developing a JSP which contains a JavaBean.
              >> >> This bean is a wrapper for a session EJB, the getProperty() methods in
              >> >> the bean call methods on the EJB's remote interface.
              >> >>
              >> >> I have tested this bean as a stand alone application by adding a
              >> >> main(String[] args) method to it and it works.
              >> >>
              >> >> However, when adding the bean to the JSP, the JSP does not show in the
              >> >> browser, I get a n internal server error 500 instead.
              >> >> It seems that Weblogic is not finding the javax.naming.NamingException
              >> >> class when instantiating the bean.
              >> >>
              >> >> When looking at the weblogic log, I see the following stack trace:
              >> >>
              >> >> Fri Aug 18 15:12:06 EDT 2000:<E> <ServletContext-General> Servlet failed
              >> >> with Exception
              >> >>
              >> >> java.lang.NoClassDefFoundError: javax/naming/NamingException
              >> >>
              >> >> at java.lang.ClassLoader.resolveClass0(Native Method)
              >> >>
              >> >> at java.lang.ClassLoader.resolveClass(ClassLoader.java:579)
              >> >>
              >> >> at
              >> >> weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(GenericClassLoader.java,
              >> >> Compiled Code)
              >> >>
              >> >> at
              >> >> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
              >> >> Compiled Code)
              >> >>
              >> >> at
              >> >> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
              >> >> Compiled Code)
              >> >>
              >> >> at java.beans.Beans.instantiate(Beans.java:194)
              >> >>
              >> >> at java.beans.Beans.instantiate(Beans.java:55)
              >> >>
              >> >> at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1138)
              >> >>
              >> >> at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java,
              >> >> Compiled Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1554)
              >> >>
              >> >> at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java, Compiled Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
              >> >> Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
              >> >>
              >> >> at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
              >> >>
              >> >> at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
              >> >> Compiled Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
              >> >> Code)
              >> >>
              >> >> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
              >> >>
              >> >> at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:92)
              >> >>
              >> >> at
              >> >> weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:191)
              >> >>
              >> >> at
              >> >> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:118)
              >> >>
              >> >> at
              >> >> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:744)
              >> >>
              >> >> at
              >> >> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:692)
              >> >>
              >> >> at
              >> >> weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:251)
              >> >>
              >> >> at
              >> >> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
              >> >>
              >> >> at
              >> >> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              >> >>
              >> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              >> >>
              >> >> Any idea on how to fix this?
              >> >>
              >> >> Thanks for any help,
              >> >> David
              >> >
              >
              

  • Java.lang.RuntimeException: Could not find the OffLine WLST class

    Installation of OIM On weblogic.
    oracle/oim/xellerate/setup/setup.xml:443: The following error occurred while executing this line:
    /oracle/oim/xellerate/setup/weblogic-setup.xml:196: java.lang.RuntimeException: Could not find the OffLine WLST class
    at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    at org.apache.tools.ant.Main.runBuild(Main.java:668)
    at org.apache.tools.ant.Main.startAnt(Main.java:187)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
    Tried to run this command ./wlst.sh
    shows
    CLASSPATH=/home/oracle/bea/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/oracle/bea/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/jdk/lib/tools.jar:/oracle/weblogic/server/server/lib/weblogic_sp.jar:/oracle/weblogic/server/server/lib/weblogic.jar:/home/oracle/bea/modules/features/weblogic.server.modules_10.3.0.0.jar:/oracle/weblogic/server/server/lib/webservices.jar:/home/oracle/bea/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/home/oracle/bea/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:
    PATH=/oracle/weblogic/server/server/bin:/home/oracle/bea/modules/org.apache.ant_1.6.5/bin:/oracle/jdk/jre/bin:/oracle/jdk/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/home/oracle/bin:/oracle/jdk/bin
    Your environment has been set.
    CLASSPATH=/home/oracle/bea/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/oracle/bea/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/jdk/lib/tools.jar:/oracle/weblogic/server/server/lib/weblogic_sp.jar:/oracle/weblogic/server/server/lib/weblogic.jar:/home/oracle/bea/modules/features/weblogic.server.modules_10.3.0.0.jar:/oracle/weblogic/server/server/lib/webservices.jar:/home/oracle/bea/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/home/oracle/bea/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar::/oracle/weblogic/server/common/eval/pointbase/lib/pbembedded57.jar:/oracle/weblogic/server/common/eval/pointbase/lib/pbtools57.jar:/oracle/weblogic/server/common/eval/pointbase/lib/pbclient57.jar
    Initializing WebLogic Scripting Tool (WLST) ...
    Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class

    try Problem invoking WLST - Could not find the OffLine WLST class the last post on this thread, he claims to solve the problem...

  • OIM Installn :java.lang.RuntimeException: Could not find OffLine WLST class

    Installation of OIM On weblogic.
    oracle/oim/xellerate/setup/setup.xml:443: The following error occurred while executing this line:
    /oracle/oim/xellerate/setup/weblogic-setup.xml:196: java.lang.RuntimeException: Could not find the OffLine WLST class
         at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
         at org.apache.tools.ant.Task.perform(Task.java:364)
         at org.apache.tools.ant.Target.execute(Target.java:341)
         at org.apache.tools.ant.Target.performTasks(Target.java:369)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
         at org.apache.tools.ant.Main.runBuild(Main.java:668)
         at org.apache.tools.ant.Main.startAnt(Main.java:187)
         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
    Tried to run this command ./wlst.sh
    shows
    CLASSPATH=/home/oracle/bea/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/oracle/bea/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/jdk/lib/tools.jar:/oracle/weblogic/server/server/lib/weblogic_sp.jar:/oracle/weblogic/server/server/lib/weblogic.jar:/home/oracle/bea/modules/features/weblogic.server.modules_10.3.0.0.jar:/oracle/weblogic/server/server/lib/webservices.jar:/home/oracle/bea/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/home/oracle/bea/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:
    PATH=/oracle/weblogic/server/server/bin:/home/oracle/bea/modules/org.apache.ant_1.6.5/bin:/oracle/jdk/jre/bin:/oracle/jdk/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/home/oracle/bin:/oracle/jdk/bin
    Your environment has been set.
    CLASSPATH=/home/oracle/bea/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/oracle/bea/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/jdk/lib/tools.jar:/oracle/weblogic/server/server/lib/weblogic_sp.jar:/oracle/weblogic/server/server/lib/weblogic.jar:/home/oracle/bea/modules/features/weblogic.server.modules_10.3.0.0.jar:/oracle/weblogic/server/server/lib/webservices.jar:/home/oracle/bea/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/home/oracle/bea/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar::/oracle/weblogic/server/common/eval/pointbase/lib/pbembedded57.jar:/oracle/weblogic/server/common/eval/pointbase/lib/pbtools57.jar:/oracle/weblogic/server/common/eval/pointbase/lib/pbclient57.jar
    Initializing WebLogic Scripting Tool (WLST) ...
    Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class
    Edited by: user10213645 on Mar 9, 2010 3:37 PM

    There is an existing Bug 8431390 - WLST NOT WORKING IF WE USE NON-DEFAULT INSTALLATION (WL_HOME OUTSIDE BEA_HOME)
    As per this bug, the issue can be reproduced as follows:
    Steps to reproduce:
    1. Install WLS 10.3GA (essex) kit in a non-default fashion (WL_HOME outside BEA_HOME)
    2. Go to ur $WL_HOME/common/bin directory and execute wlst.cmd
    3. It exits with the following exception:
    java.lang.RuntimeException:could not find the OffLine WLST class
    Hope this helps.
    For more details, refer: http://idm-oracle.blogspot.com/2010/03/javalangruntimeexception-could-not-find.html

  • Getting the error " [java] Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class " while building the O2A 2.1.0 PIP

    Getting the error " [java] Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class " while building the O2A 2.1.0 PIP. I am using the Design Studio 4.3.2 for building the O2A 2.1.0 PIP. Please let me know how to resolve this issue. Here I am enclosing the log file .

    We have basically the same issue when we try to create the interpreter using the embedded method..
    I was able to use the interpreter embedded in a java client as long as the weblogic jars were located in a weblogic install if I tried to use them from a maven repository no luck at all...
    All of this worked easily in 9.2 now in 10.3 it seems more error prone and less documented.
    I have seen close to a 100 posts on issues related to this so is there a document which outlines specifics....
    We / I have used weblogic now for almost 10 years and moving from 8.1 to 9.2 was painful and we expected the move from 9.2 to 10.3 not to be soo bad but its proving to be as painful if not more painful than moving to 9.2. We seem to spend a good bit of our time working around issues in the next new release that were not in the previous one..
    Any help would be appreciated I think we will open a support case but even that is more painful...
    Any help would be greatly appreciated..
    PS: We confirmed that all jars in the startweblogic classpath were in the startup. The server we have the embedded wlst instance is a managed server and we are using the component in a war... Are there any restrictions which we are unaware of.
    Error we get is
    1 [ERROR] com.tfn.autex.order.weblogic.QueueMaintenanceUtility.addQueue():217 Error Adding Queue wowsers JNDI Name wowsers Exception: Invocation Target exception while getting the WLSTOffLineScript path

  • Could not find the OffLine WLST class (WL 10.3)

    Hi,
    I am confused about this scenario, please help me.
    I keep getting the below when I run the wlst.sh script.
    Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class
    So what I did was add weblogic.jar to the classpath in the script. But I still get the same error. However, if I run it from the command line without the -D option, I no longer get that error, but get one about abother missing class.
    Here is my wlst.sh
    # cat wlst.sh
    #!/bin/sh
    # set up WL_HOME, the root directory of your WebLogic installation
    WL_HOME="/exec/products/weblogic/v10.3/bea/wlserver_10.3"
    # set up common environment
    . "${WL_HOME}/server/bin/setWLSEnv.sh"
    CLASSPATH="${CLASSPATH}:${WL_HOME}/common/eval/pointbase/lib/pbembedded57.jar:${WL_HOME}/common/eval/pointbase/lib/pbtools57.jar:${WL_HOME}/common/eval/pointbase/lib/pbclient57.jar:${WL_HOME}/server/lib/weblogic.jar"
    echo
    echo CLASSPATH=${CLASSPATH}
    "${JAVA_HOME}/bin/java" -Dprod.props.file=${WL_HOME}/.product.properties weblogic.WLST $*and here is the properties file it is using
    # cat ${WL_HOME}/.product.properties
    #Mon Nov 30 13:34:33 CET 2009
    JAVA_HOME=/usr/java6_64
    WLS_JAVA_HOME=/usr/java6_64
    JAVAHOME=/usr/java6_64
    PLATFORMHOME=/exec/products/weblogic/v10.3/wlserver_10.3
    WLS_INSTALL_DIR=/exec/products/weblogic/v10.3/wlserver_10.3
    javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
    java.vm.version=2.4
    LOCALE=en
    CONFIGWIZ_HOME=/exec/products/weblogic/v10.3/wlserver_10.3
    java.vm.vendor=IBM Corporation
    javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
    WLS_JAVA_VENDOR=Unknown
    javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
    DOCSWEBROOT=http\://e-docs.bea.com/wls/docs103
    NODEMGR_PORT=5556
    BEAHOME=/exec/products/weblogic/v10.3/bea
    WL_HOME=/exec/products/weblogic/v10.3/bea/wlserver_10.3So to sum up, when after adding weblogic.jar to the classpath, I still get the same error if I run the script where it uses the properties file.
    However, if I run it without using the properties file, then I get
    # java weblogic.WLST
    Exception in thread "main" java.lang.NoClassDefFoundError: weblogic.descriptor.DescriptorClassLoader
            at weblogic.WLST.main(WLST.java:19)
    Caused by: java.lang.ClassNotFoundException: weblogic.descriptor.DescriptorClassLoader
            at java.net.URLClassLoader.findClass(URLClassLoader.java:421)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:652)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:618)
            ... 1 moreSo any ideas on how to get this working would be appreciated.

    Hi,
    If you need access to WebLogic container code on top of WLST scripting API such as the scenario where a plain SE Java class needs to call a remote method on a Stateless/Stateful session bean for example - I find it is easier to include the generated wlfullclient.jar - just don't use this jar in an application managed servlet context.
    For non-EE/ejb/web contexts (SE) use wlfullclient.jar generated from
    $WLS_INSTALL\wlserver_10.3\server\lib>java -jar wljarbuilder.jarThen run your client with the above jar in the classpath like
    java -cp .;wls/wlfullclient.jar org.eclipse.persistence.example.distributed.Clientthank you
    /Michael O'Brien
    http://www.eclipselink.org

  • Can not find class BPELFaultRecoveryContext in 11g

    I have a Java program that uses the class BPELFaultRecoveryContext below
    import com.collaxa.cube.engine.fp.BPELFaultRecoveryContext;
    which resides in the orabpel.jar file. I jar up the java program and put it in the $ORACLE_MIDDLEWARE_HOME/user_projects/domains/soa_domain/lib folder on the SOA server. When I run the bpel process, it will call this java class and now, when the java class runs, it said that it can't find this class BPELFaultRecoveryContext. I searched the server and the orabpel.jar file is there. It's in another directory though.
    The intereresting thing is in this java program, it uses the below classes and they are in the fabric-runtime.jar file. I do not include the fabric-runtime.jar file in the jar file with the java class but the java program is able to locate these 2 classes but not the one above.
    import oracle.integration.platform.faultpolicy.IFaultRecoveryContext;
    import oracle.integration.platform.faultpolicy.IFaultRecoveryJavaClass;
    Do I need to include the orabpel.jar file in the jar file with the java class? Do you have any ideas? Thanks

    import the java class to the class path

  • Running an exe from within Oracle WebLogic 10g R3 does not find dll

    Hi,
    I am facing a strange issue with Oracle WebLogic 10g R3.
    I use the code as shown in Listing 1 below to run a windows based application exe (batch job) from within my web application hosted on Oracle WebLogic 10g Release 3.
    Note that this code woks fine on Tomcat 6.x and OC4J (JDeveloper TP4).
    The exec gets executed but the log of the exe program shows it could not load certain DLLs.
    Note that these DLLs are in the same directoy as the Batch program and this directory is in the PATH.
    Running through simple Java Program Successful*
    When I run the same program from a java program it runs successfully. So this means some WebLogic environment does not get set properly.
    Running directly BatchProg.exe rather than cmd.exe fails*
    Also note that when I run the exe directly e.g. BatchProg.exe rather than through cmd.exe it gives me a error the system did not find the file specified.
    CreateProcess error=2, The system cannot find the file specified with cause java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    Listing 1:*
    String[] commandArgs = new String[|http://forums.oracle.com/forums/] { "cmd.exe", "/C", "BatchProg.exe \"param1\" \"param2\" " },null , l_workingDir)
    Runtime rt = Runtime.getRuntime();
    Process proc;
    proc = rt.exec( commandArgs, envParams, workingDir );
    ProcessIO errStream = new ProcessIO( proc.getErrorStream(), "ERROR");
    ProcessIO outStream = new ProcessIO( proc.getInputStream(), "OUTPUT");
    errStream.start(); // process any errors from the command
    outStream.start(); // process any output from the command
    System.out.println("Error=" +errStream);
    System.out.println("Out" + outStream);
    return (p_waitToFinish ? proc.waitFor() : this.SUCCESS);

    OK.
    I have posted this on the WebLogic Forum.
    Thanx.

  • The system could not find a javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the com.rest.assignment.EmpBean type and application/json mediaType.  Ensure that a javax.ws.rs.ext.MessageBodyWriter exists in the JAX-RS application for the

    Hi,
    Im trying to create a Rest WS with a @GET method that will return me an Emp object. I need the output as a JSON string.
    I have created a dynamic web project and added javax RS jars:
    When im trying to run this, i'm getting the below mentioned error:
    FlushResultHa E org.apache.wink.server.internal.handlers.FlushResultHandler handleResponse The system could not find a javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the com.rest.assignment.EmpBean type and application/json mediaType.  Ensure that a javax.ws.rs.ext.MessageBodyWriter exists in the JAX-RS application for the type and media type specified.
    RequestProces I org.apache.wink.server.internal.RequestProcessor logException The following error occurred during the invocation of the handlers chain: WebApplicationException (500 - Internal Server Error)
    Please help as im stuck with this from long.
    Thanks in advance.
    Below is the code for my service class:
    package com.rest.assignment;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.ws.rs.GET;
    import javax.ws.rs.Path;
    import javax.ws.rs.Produces;
    import javax.ws.rs.core.Application;
    import javax.ws.rs.core.MediaType;
    import javax.ws.rs.core.Response;
    @Path("/restService")
    public class RestService extends Application {   
        @GET
        @Path("/getEmpDetails")
        @Produces(MediaType.APPLICATION_JSON)
        public Response getStringResponse()
            EmpBean empBean = new EmpBean();
            String filePath = "C:/Program Files/IBM/workspace/HelloWorld/src/com/rest/resources/EmpData.properties";
            Properties properties = new Properties();
            try {
                properties.load(new FileInputStream(filePath));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
             Enumeration e = properties.propertyNames();
             String result="";
            String[] empDetailsArr;
            while (e.hasMoreElements()) {
              String key = (String) e.nextElement();
              String empDetails = properties.getProperty(key);
              empDetailsArr=empDetails.split(",");    
              empBean.setFirstName(empDetailsArr[0]);
              empBean.setLastName(empDetailsArr[1]);
              empBean.setEmpId(empDetailsArr[2]);
              empBean.setDesignation(empDetailsArr[3]);
              empBean.setSkillSet(empDetailsArr[4]);
              result = empDetailsArr[1];
            //return empBean;
            return Response.ok(empBean).type(MediaType.APPLICATION_JSON_TYPE).build();
        @Override
        public Set<Class<?>> getClasses() {
            Set<Class<?>> classes = new HashSet<Class<?>>();
            classes.add(RestService.class);
            classes.add(EmpBean.class);
            return classes;
    and my empBean goes like this:
    package com.rest.assignment;
    public class EmpBean {
        private String firstName;
        private String lastName;
        private String empId;
        private String designation;
        private String skillSet;
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
        public String getEmpId() {
            return empId;
        public void setEmpId(String empId) {
            this.empId = empId;
        public String getDesignation() {
            return designation;
        public void setDesignation(String designation) {
            this.designation = designation;
        public String getSkillSet() {
            return skillSet;
        public void setSkillSet(String skillSet) {
            this.skillSet = skillSet;
    Web.xml goes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>restWS</display-name>
    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
      <servlet-name>REST</servlet-name>
      <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class>
      <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>com.rest.assignment.RestService</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>REST</servlet-name>
      <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>
    </web-app>
    When i try to return a string from my get method, it gives me a proper response. i get this exception when im trying to return a JSON response.

    Hi,
    Im trying to create a Rest WS with a @GET method that will return me an Emp object. I need the output as a JSON string.
    I have created a dynamic web project and added javax RS jars:
    When im trying to run this, i'm getting the below mentioned error:
    FlushResultHa E org.apache.wink.server.internal.handlers.FlushResultHandler handleResponse The system could not find a javax.ws.rs.ext.MessageBodyWriter or a DataSourceProvider class for the com.rest.assignment.EmpBean type and application/json mediaType.  Ensure that a javax.ws.rs.ext.MessageBodyWriter exists in the JAX-RS application for the type and media type specified.
    RequestProces I org.apache.wink.server.internal.RequestProcessor logException The following error occurred during the invocation of the handlers chain: WebApplicationException (500 - Internal Server Error)
    Please help as im stuck with this from long.
    Thanks in advance.
    Below is the code for my service class:
    package com.rest.assignment;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.util.Enumeration;
    import java.util.HashSet;
    import java.util.Properties;
    import java.util.Set;
    import javax.ws.rs.GET;
    import javax.ws.rs.Path;
    import javax.ws.rs.Produces;
    import javax.ws.rs.core.Application;
    import javax.ws.rs.core.MediaType;
    import javax.ws.rs.core.Response;
    @Path("/restService")
    public class RestService extends Application {   
        @GET
        @Path("/getEmpDetails")
        @Produces(MediaType.APPLICATION_JSON)
        public Response getStringResponse()
            EmpBean empBean = new EmpBean();
            String filePath = "C:/Program Files/IBM/workspace/HelloWorld/src/com/rest/resources/EmpData.properties";
            Properties properties = new Properties();
            try {
                properties.load(new FileInputStream(filePath));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
             Enumeration e = properties.propertyNames();
             String result="";
            String[] empDetailsArr;
            while (e.hasMoreElements()) {
              String key = (String) e.nextElement();
              String empDetails = properties.getProperty(key);
              empDetailsArr=empDetails.split(",");    
              empBean.setFirstName(empDetailsArr[0]);
              empBean.setLastName(empDetailsArr[1]);
              empBean.setEmpId(empDetailsArr[2]);
              empBean.setDesignation(empDetailsArr[3]);
              empBean.setSkillSet(empDetailsArr[4]);
              result = empDetailsArr[1];
            //return empBean;
            return Response.ok(empBean).type(MediaType.APPLICATION_JSON_TYPE).build();
        @Override
        public Set<Class<?>> getClasses() {
            Set<Class<?>> classes = new HashSet<Class<?>>();
            classes.add(RestService.class);
            classes.add(EmpBean.class);
            return classes;
    and my empBean goes like this:
    package com.rest.assignment;
    public class EmpBean {
        private String firstName;
        private String lastName;
        private String empId;
        private String designation;
        private String skillSet;
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
        public String getEmpId() {
            return empId;
        public void setEmpId(String empId) {
            this.empId = empId;
        public String getDesignation() {
            return designation;
        public void setDesignation(String designation) {
            this.designation = designation;
        public String getSkillSet() {
            return skillSet;
        public void setSkillSet(String skillSet) {
            this.skillSet = skillSet;
    Web.xml goes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>restWS</display-name>
    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
      <servlet-name>REST</servlet-name>
      <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class>
      <init-param>
       <param-name>javax.ws.rs.Application</param-name>
       <param-value>com.rest.assignment.RestService</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>REST</servlet-name>
      <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>
    </web-app>
    When i try to return a string from my get method, it gives me a proper response. i get this exception when im trying to return a JSON response.

Maybe you are looking for