Problem with getProperty

hello,i have created this jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"  pageEncoding="ISO-8859-1"%>  <jsp:useBean id="mybean" scope="page" class="pak.Prog" /> <jsp:setProperty name="mybean" property="*" /> <HTML> <HEAD> <TITLE>service simulator</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .Style1 {font-family: Arial, Helvetica, sans-serif} --> </style> </HEAD> <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <FORM METHOD=POST ACTION="pagejsp.jsp"> <table width="490" height="549" border="0" align="center" background="../images/interface2.gif" >  <tr>  <td width="484" height="543">  <div align="center">  <p><textarea name="textarea" cols="40" rows="10"></textarea></p>  <p>  </p>  </div>  <table width="432" border="0">  <tr>  <td width="302"><div align="center">  <input type="submit" name="Submit" value="SEND">  </div></td>  <td width="120"><input type="submit" name="Submit2" value="ERASE"></td>  </tr>  </table>  </td>  </tr> </table> <!-- ImageReady Slices (Untitled-1.html) --> </FORM> </BODY> </HTML>and also i have created this java class which am using as bean:
package pak;   import java.io.*; import java.util.Iterator; import java.util.StringTokenizer; import java.util.List; import org.jdom.*; import org.jdom.input.*;       public class Prog {  String text,kw,msg; static org.jdom.Document doc; static Element services; String message; public Prog(){} public void setTextarea (String chaine) { text=chaine; System.out.println(text); } public String getTextarea() {  StringTokenizer tok = new StringTokenizer(text, " "); int nv = tok.countTokens(); msg = ""; //key word//  kw = tok.nextToken().toString(); // /**reste du message//  for (int i = 1; i < nv; i++) {  msg += (tok.nextToken().toString() + " "); }  // **fin reste du message**//  // ***lecture du fichier xml   SAXBuilder sxb = new SAXBuilder(); try {  doc = sxb .build(new File(  "C:/Aymen/eclipseworkspace/projet web/src/pak/services.xml")); } catch (Exception e) {  }  services = doc.getRootElement(); List service = services.getChildren("service"); Iterator k = service.iterator();   while (k.hasNext()) {  Element courant = (Element) k.next(); if (courant.getChild("nom").getText().equals(kw)) {  message=(courant.getChild("text").getText()); }  }  System.out.println(message); return(message); } }and this is the xml file am using in the bean:
<services>
     <service>
              <nom>service1</nom>
              <text>salut</text>
     </service>
     <service>
              <nom>service2</nom>
              <text>bonjour</text>
      </service>
      <service>
              <nom>service3</nom>
              <text>hi</text>
      </service>
       <service>
              <nom>service4</nom>
              <text>hello</text>
      </service>
</services>              but i have a problem when i try to use getPropety which means also when i try to use getTextarea (that i have defined in the java class).i couldn't get the result of the gettextarea method and make it appears in the textarea of the jsp
page. So my question are:
how shall i proceed to make the getTextarea method work?
what shall i do to make the result of the program appears in the text field of the jsp page?
can i use a setProperty tag and a getProperty tag in the same time?
thanks a lot for your help :)

Your code uses two IndividualName beans.
The first is instantiated by the <jsp:useBean> and the reference is stored in the page context under the key "individualName". The useBean also creates a scripting variable called individualName and sets it to the same reference.
When you code
individualName = (IndividualName)customer.getName();the scripting variable is overwritten and now refers to a different IndividualName object returned by customer.getName().
The<jsp:getProperty name="individualName"..../> retrieves the bean reference from the page context, not from the scripting variable. This is the original bean instantiated by the useBean, not the one from customer.getName().
That's why getProperty doesn't work but scripting directly does.
Given what you're doing, perhaps it's better not to code <jsp:useBean>. Either don't use getProperty, or add the reference to the page context.
e.g.<%
IndividualName individualName = (IndividualName) customer.getName();
%>
<input size="15" maxlength="15" value='<%=individualName.getFirstName()%>' name="FNAME">or
<%
IndividualName individualName = (IndividualName) customer.getName();
pageContext.setAttribute("individualName", individualName);
%>
<input size="15" maxlength="15" value='<jsp:getProperty name="individualName" property="firstName"/>' name="FNAME">

Similar Messages

  • Problem with java beans and jsp on web logic 6.0 sp1

              HI ,
              I am using weblogic6.0 sp1.
              i have problem with jsp and java beans.
              i am using very simple java bean which stores name and email
              from a html form.
              but i am getting following errors:
              Full compiler error(s):
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              "userbn"); //[ /SaveName2.jsp; Line: 7]
              ^
              3 errors
              in which directory should i place java bean source file(.java file)
              here is my jsp file:
              <%@ page language = "java" contentType = "text/html" %>
              <html>
              <head>
              <title>bean2</title>
              </head>
              <body>
              <jsp:usebean id = "ud" class = "userbn" >
              <jsp:setProperty name = "ud" property = "*" />
              </jsp:usebean>
              <ul>
              <li> name: <jsp:getProperty name = "ud" property = "name" />
              <li> email : <jsp:getProperty name = "ud" property = "email" />
              </ul>
              </body>
              <html>
              here is my bean :
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              import java.io.*;
              public class userbn implements Serializable
                   private String name ;
                   private String email;
                   public void setName(String n)
                        name = n;
                   public void setEmail(String e)
                        email = e;
                   public String getName()
                        return name;
                   public String getEmail()
                        return email;
                   public userbn(){}
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              pls help me.
              Thanks
              sravana.
              

              You realy can do it like Xiang says, but the better way is to use packages. That's
              the way BEA is designed for. If you use packages you can but your bean classes
              in every subfolder beneath Classes. Here for example we have the subfolders test
              and beans:
              You have to declare the package on top of your Bean Source Code:
              package test.beans;
              In your JSP you don't need the import code of Xiang. You only have to refer the
              path of your bean class:
              <jsp:useBean id="testBean" scope="session" class="test.beans.TestBean" />
              There are some other AppServers that only can deploy Java Beans in packages. So
              if you use packages you are always on the right side.
              ciao bernd
              "sravana" <[email protected]> wrote:
              >
              >Thank you very much Xiang Rao, It worked fine.
              >Thanks again
              >sravana.
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >><%@ page import="userbn" language = "java" contentType = "text/html"
              >>%> should
              >>work for you.
              >>
              >>
              >>"sravana" <[email protected]> wrote:
              >>>
              >>>HI ,
              >>>
              >>>I am using weblogic6.0 sp1.
              >>>
              >>>i have problem with jsp and java beans.
              >>>
              >>>i am using very simple java bean which stores name and email
              >>>
              >>>from a html form.
              >>>
              >>>but i am getting following errors:
              >>>
              >>>________________________________________________________________
              >>>
              >>>Full compiler error(s):
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              >>>"userbn"); //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>3 errors
              >>>
              >>>____________________________________________________________
              >>>
              >>>in which directory should i place java bean source file(.java file)
              >>>
              >>>here is my jsp file:
              >>>--------------------------------------------------------
              >>>
              >>><%@ page language = "java" contentType = "text/html" %>
              >>><html>
              >>><head>
              >>><title>bean2</title>
              >>></head>
              >>><body>
              >>><jsp:usebean id = "ud" class = "userbn" >
              >>><jsp:setProperty name = "ud" property = "*" />
              >>></jsp:usebean>
              >>><ul>
              >>><li> name: <jsp:getProperty name = "ud" property = "name" />
              >>><li> email : <jsp:getProperty name = "ud" property = "email" />
              >>></ul>
              >>></body>
              >>><html>
              >>>
              >>>-------------------------------------------------------------
              >>>
              >>>here is my bean :
              >>>
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>import java.io.*;
              >>>
              >>>public class userbn implements Serializable
              >>>{
              >>>
              >>>     private String name ;
              >>>
              >>>     private String email;
              >>>
              >>>     public void setName(String n)
              >>>     {
              >>>
              >>>          name = n;
              >>>     }
              >>>
              >>>     public void setEmail(String e)
              >>>     {
              >>>
              >>>          email = e;
              >>>     }
              >>>
              >>>     public String getName()
              >>>     {
              >>>
              >>>          return name;
              >>>     }
              >>>
              >>>     public String getEmail()
              >>>     {
              >>>
              >>>          return email;
              >>>     }
              >>>
              >>>     public userbn(){}
              >>>}
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>pls help me.
              >>>Thanks
              >>>sravana.
              >>>
              >>
              >
              

  • Problem with file zipping!

    I have problem with my zip files. all that i need is a simple zipping of files. here's is what i am doing
    //this mehod takes 2 arugments, first argument is the file which is to be zipped and the second argument is the name of the zip file
    public void makeZIP(File fileToZip, String zfileName) throws IOException{
    try{
    byte[] buff = new byte[BUF_SIZE];//BUF_SIZE =128
    int cnt=0;
    FileInputStream swcConvFis = new FileInputStream(fileToZip);
    ZipEntry swcConvZipEntry = new ZipEntry(zfileName);
    ZipOutputStream swcConvZipOutputStream = new ZipOutputStream(swcConvFos);
    swcConvZipOutputStream.putNextEntry(swcConvZipEntry);
    while((cnt = swcConvFis.read(buff,0,BUF_SIZE)) != -1){
    swcConvZipOutputStream.write(buff,0,cnt);
    swcConvFis.close();
    swcConvZipOutputStream.closeEntry();
    }catch(NullPointerException npe){npe.printStackTrace();}
    whis code is a part of the servlet code that has to send the zipped file to the applet. What's happening is i am able to zip the files. but when i try to open the zip file it gives me a an error window saying " cannot open file: it does not appear to be valid archive."
    ofcourse the file is zipped on a linux machine and i am trying to open it in windows...it think this shouldn't be a problem though!!
    please somebody throw some light on this. i have searched the archives but not helpful sofar.
    thanks
    sri

    the outputToApplet is the ObjectOutputStream object.
    at the applet's reading end this is what i am doing
    ObjectInputStream intputFromServlet = new ObjectInputStream(connect.getInputStream());
    //code to read the output files from the servlet
    byte[] buff = new byte[BUF_SIZE];
    int cnt = 0;
    ArrayList getOutputFilesFromServlet = (ArrayList) inputFromServlet.readObject(); // at the servlet end i am writing outputToApplet.writeObject(send2Files), send2Files is an ArrayList object that has one .txt file and another .zip file
    System.out.println("total no.of files "+getOutputFilesFromServlet.size()); //shows 2
    Iterator getOutputFilesFromServletIterator = getOutputFilesFromServlet.iterator();
    while(getOutputFilesFromServletIterator.hasNext()){
                   File file = (File)getOutputFilesFromServletIterator.next();
    String fname = file.getName();
    System.out.println("received "+fname);//shows correct file names
                   try{
                        File nfile = new File(getOfile.getParent()+System.getProperty("file.separator")+fname);//puts the files in the requested directory on the client machine
                        FileOutputStream toFile = new FileOutputStream(nfile);
    //reading the files uploaded by the applet
                        while( (cnt = dump.read( buff )) > -1 ){
                             if(cnt<BUF_SIZE){
                             toFile.write( buff, 0, cnt );
                                  toFile.close();
                                  break;
                             toFile.write( buff, 0, cnt );
              }catch(Exception e){e.printStackTrace();}
    System.out.println("finished reading all files from the servlet....");
              }//while(it.next)
    not only the zip file even the other text file is not downloaded properly....(i.e) it shows some junk characters instead of the actual file context. so maybe there is mistake in the way that i am reading the files...but what i am doing at applet's end is just a mirror reflection of what i am doing at the servlet's end. you got me!! hope i am not confusing!
    any suggestions!!

  • Problems with I/O on Unix Server

    HAllo
    I have a Problem with reading/writing on the Server my Tomcat is running.
    My Application does not find the properties file allthough i tried to get my path with System.getProperty("user.dir"), and also tried to set an absolute path too.
    It is also not able to create a new file.
    My Question: What rights do applications running in tomcat have by dafault?
    How cat i change this rights?
    And how do the path have to look in my code if i want to set it fix?
    I tried thid ones:
    "/mydir/myfile.txt"
    "\\mydir\\myfile.txt"

    Tomcat is a regular application that has the same rights as the user executing it. Does Tomcat run as a user who has access to the directory you are trying to read/write from?

  • Problems with a thread that records dvd on suse linux

    PLEASE HELP
    I am using SuSE linux, and I record dvd+/- RW with the program growisofs.
    By command line on the linux shell, growisofs records normally, but when I try to use the same line cone that I use in the shell in a java thread, it never stops recording, I mean, it records all data, but it apparently does not close the dvd session, for the grenn light on the drive never stops blinking, and I have to stop the proccess manually, because it never releases the dvd drive.
    I use the thread in a large program, but for debugging this I have made a simple program, whose error is the same.
    the code is:
            String s = "/usr/local/bin/growisofs -speed=1 -M /dev/dvdram  -V MIS27 -A growisofs -P MedImServer " +
               " -p MedImServer -sysid Linux -J -R -l -relaxed-filenames -allow-lowercase -allow-multidot  /windows/C/online";
           Process p;
                try {
                    p = Runtime.getRuntime().exec(s);
                    p.waitFor();
                catch (IOException ex) {
                    JOptionPane.showMessageDialog(null,"erro no runtime");
                    System.exit(0);
                catch (InterruptedException ex1) {
                    JOptionPane.showMessageDialog(null,"erro no waitfor");
                    System.exit(0);
                }with JBuilder 9 debug, I realized that it freezes at the moment of "p.waitFor()".
    I thought that it was a problem with the recording software, but it is not: the same command line that I use in the program I have used in the Linux shell and it recorded perfectly. The program does not require any user interaction but the command line I wrote before. The problem with the Java program is that it records all data, but never returns from the process. It's not a problem with the software, for it records perfectly when it's not called within the Java program, so I imagine that it is some funny thing in either the Runtime.getRuntime().exec(...) or the p.wait().
    Better yet:
    Is there a way to record dvds with a java command instead with an exteranal program?
    This would be the heaven...
    IF it is possible, do it require some sun package?
    Thans
    Tiago

    Did you mean like this?
            Process p = null;
            String s = null;
            File f;
            try {
                f = new File(pathtmp);
                f.mkdir();
                if(VERBOSE) Log.info(GRAVA_LOG_MARK + "Pasta " + f.getPath() + " criada");
                for (Iterator iter = estudos.iterator(); iter.hasNext(); ) {
                    HashMap item = (HashMap) iter.next();
                    String id = (String) item.get("id_paciente");
                    String dt_hr = (String) item.get("dt_hr_estudo");
                    String estudo = id + "." + dt_hr;
                    File dir = new File(distriOff.path);
                    String[] arquivos = dir.list(new FiltroInicio(estudo));
                    for (int i = 0; i < arquivos.length; i++) {
                        File src = new File(distriOff.path + arquivos);
    File dest = new File(pathtmp + arquivos[i]);
    try {
    Util.copy(src, dest);
    catch (Throwable ex) {
    Log.error(mensagem + " " + ex);
    prop.enviaMsg(mensagem + " " + ex);
    throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);
    String os = System.getProperty("os.name");
    String modo;
    if(midia.getEspaco_disponivel_midia() == midia.getTamanho_midia()) {
    //primeira gravagco
    modo = "-Z";
    else {
    //gravagco de novas segues
    modo = "-M";
    String speed = "-speed=1";
    String cmd = "/usr/local/bin/growisofs " + speed + " " + modo + " " + dvdDevice + " "
    +" -V " + prop.getIdMidiaAtual() + " -A growisofs -P MedImServer "
    +"-p MedImServer -sysid " + os + " -J -R -l -relaxed-filenames -allow-lowercase -allow-multidot " + pathtmp;
    p = Runtime.getRuntime().exec(cmd);
    p.waitFor();
    catch (IOException ex){
    Log.error(mensagem + " " + ex);
    prop.enviaMsg(mensagem + " " + ex);
    throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);
    catch (InterruptedException ex) {
    Log.error(mensagem + " " + ex);
    prop.enviaMsg(mensagem + " " + ex);
    throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);
    try
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    // Lj saida padrco do comando
    while ( (s = stdInput.readLine()) != null)
    Log.info(GRAVA_LOG_MARK + s);
    catch (IOException ex)
    Log.error(mensagem + " " + ex);
    prop.enviaMsg(mensagem + " " + ex);
    throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);
    try
    BufferedReader stdErr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    // Lj qualquer erro do comando
    while ( (s = stdErr.readLine()) != null) {
    Log.info("Processo de Gravagco: " + s);
    if((s.indexOf("failed") != -1) || (s.indexOf("error") != -1) || (s.indexOf("unable") != -1)) {
    Log.error(mensagem + " " + s);
    prop.enviaMsg(mensagem + " " + s);
    throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + s);
    catch (IOException ex)
    Log.error(mensagem + " " + ex);
    prop.enviaMsg(mensagem + " " + ex);
    throw new ExcecaoDistribuicao(ExcecaoDistribuicao.ERRO, mensagem + " " + ex);
    I tried to execute it, and it indeed doesn't freeze, but it doesn't record a thing either...
    now it doesn't even wait for the thread, which is VERY weird: it does not record a thing!!! It just passes by the line 'p.waitFor()'...
    Any sugestion?
    By the way, thanks for helping me...
    Tiago

  • Problem with x:transform function : translation with XSLT

    I've got a problem with this code :
    This is the XML file :
    <%@taglib prefix="x" uri="http://java.sun.com/jstl/xml"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <c:import var="xslDoc" url="test.xsl"/>
    <x:transform  xslt ="${xslDoc}">
      <students>
      <student id="1">
       <name>
         <first>John</first>
         <last>Smith</last>
         <middle>T</middle>
       </name>
       <grade>
         <points>72</points>
         <letter>C</letter>
       </grade>
      </student>
    </students>
    </x:transform>This is the XSLT :
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="students">
      <html>
      <head>
      <title>XSLT Transform</title>
      </head>
      <body>
       <table border="1">
       <tr><th>First</th><th>Last</th>
    <th>Points</th><th>Letter</th></tr> 
       <xsl:apply-templates/>
       </table>
       </body>
      </html>
    </xsl:template>
    <xsl:template match="student">
      <tr>
       <td><xsl:value-of select="name/first"/></td>
       <td><xsl:value-of select="name/last"/></td>
       <td><xsl:value-of select="grade/points"/></td>
       <td><xsl:value-of select="grade/letter"/></td>
      </tr>
    </xsl:template>
    </xsl:stylesheet>I use NetBeans 3.5.1 for compiling and testing, and on my machine all works fine.
    But when i upload the code on the server i''ve this type of error :
    HTTP Status 500 - Internal Server Error
    exception
    org.apache.jasper.JasperException: access denied (java.util.PropertyPermission org.xml.sax.driver read)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:457)
         at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:576)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.security.AccessControlException: access denied (java.util.PropertyPermission org.xml.sax.driver read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
         at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
         at java.lang.System.getProperty(System.java:572)
         at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:81)
         at org.apache.taglibs.standard.tag.common.xml.TransformSupport.getSource(TransformSupport.java:280)
         at org.apache.taglibs.standard.tag.common.xml.TransformSupport.getSource(TransformSupport.java:276)
         at org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(TransformSupport.java:159)
         at org.apache.taglibs.standard.tag.el.xml.TransformTag.doStartTag(TransformTag.java:104)
         at org.apache.jsp.test_jsp._jspService(test_jsp.java:78)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:98)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:457)
         at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:576)
         at java.lang.Thread.run(Thread.java:536)
    org.apache.jasper.JasperException: access denied (java.util.PropertyPermission org.xml.sax.driver read)It seems a permission problem, but my experience with JSP is very poor , i've asked to control to my host
    the policy of the folders but they didn't respond me yet.
    Any suggestion ?
    Thx for reading, and sorry for my rusty english :-P

    Thanks.
    I've already tried to insert the whole path. You mean this,right ?
    <c:import var="xslDoc" url="http://www.domain.net/examples/test.xsl"/>I've searched a lot with google but i haven't find anything.
    I've not searched a lot into the jakarta site, I'll do tomorrow, now it's
    a bit late (1:45 AM in Italy :-0 ), so i think that i'll go to sleep.
    Thanks for responding so soon!
    I'll wait for your new infos.
    Thanks again.
    read you tomorrow.

  • [F8] Problem with scrip when targeting player 8

    When I target the flash 8 player my scripts wont work and I
    cant figure out why. Here is what I have (forgive me if my
    explanations arent up to snuff)
    On my tracker button
    Code:
    on (rollOver) {
    startDrag("/tracker", true);
    On my first frame
    Code:
    mover = getProperty("scrollingobject", _x);
    On my second frame
    Code:
    mouseh = getProperty("/tracker", _x);
    mousev = getProperty("/tracker", _y);
    if (Number(mousev)>325 and Number(mousev)<348) {
    movevalue =
    (Number(movevalue*5)+Number(((mouseh-320)/-12)))/10;
    setProperty("/alert", _visible, true);
    } else {
    movevalue = 0;
    setProperty("/alert", _visible, false);
    On my third frame
    Code:
    mover = Number(mover)+Number(movevalue);
    if (Number(mover)>1250) {
    mover = 0;
    if (Number(mover)<0) {
    mover = 1250;
    setProperty("/scrollingobject", _x, mover);
    gotoAndPlay(59);
    Basicaly the text scrolls right and left in conjuction with
    the "tracker" button. I learned how to do this from one of the
    flash kit files that I will try and locate.
    But the problem with this is that it only works in the flash
    6 player and I need to target the flash 8 player
    Any responce would be great.
    P.S. My fla can be found here
    http://www.myapartmentbar.com/F8prob.fla
    http://www.myapartmentbar.com/F8prob.fla">http://www.myapartmentbar.com/F8prob.fla

    Long shot, but...
    Open Audio Midi Setup in Applications>Utilities, see the input & output options & KHz setting there, some things will change it for their own use, then not set it back.
    Open Console in Applications>Utilities & see if there are any clues or repeating messages when this happens.

  • Possible problem with StringTokenizer?

    Hi all
    I am having a problem with StringTokenizer and I would like your comments.
    This is a simple class to put the class path folders into an array:
    import java.io.*;
    import java.util.*;
    class TestThis1   {
       public static void main( String plist[] ) {
          String value = System.getProperty( "java.class.path" );
          System.out.println( "\n" );
          System.out.println( value );
          System.out.println( "\n" );
          StringTokenizer st = new StringTokenizer( value, ";" );
          String valueArray[] = new String[ st.countTokens() ];
          System.out.println( "folders in class path: " + st.countTokens() + "\n" );
          int i = 0;
          import java.io.*;
    import java.util.*;
    class TestThis1   {
       public static void main( String plist[] ) {
          String value = System.getProperty( "java.class.path" );
          System.out.println( "\n" );
          System.out.println( value );
          System.out.println( "\n" );
          StringTokenizer st = new StringTokenizer( value, ";" );
          String valueArray[] = new String[ st.countTokens() ];
          System.out.println( "folders in class path: " + st.countTokens() + "\n" );
          int i = 0;
          while( st.hasMoreTokens() ) {
             System.out.println( st.nextToken() );
             valueArray[i++] = st.nextToken();
             System.out.println( st.nextToken() );
             valueArray[i++] = st.nextToken();
    Output:
    D:\java\Viewer_JPro\ckv7\classes\;D:\j2sdk1.4.0\Coroutine for Java 2002\Coroutin
    e\Coroutine4Java.jar;D:\j2sdk1.4.0\Coroutine for Java 2002\JavaDDE\JavaDde.jar;D
    :\j2sdk1.4.0\Coroutine for Java 2002\Java2COM\Java2COM.jar;D:\j2sdk1.4.0\Corouti
    ne for Java 2002\JPrint\JPrint.jar;X:\JTOpen\lib\jt400.jar;X:\Java\wdt400tb.jar;
    D:\j2sdk1.4.0\jre\lib\rt.jar;D:\j2sdk1.4.0\lib\dt.jar;D:\j2sdk1.4.0\lib\tools.ja
    r;D:\j2sdk1.4.0\jre\lib\ext\Coroutine4Java.jar;D:\j2sdk1.4.0\jre\lib\ext\dnsns.j
    ar;D:\j2sdk1.4.0\jre\lib\ext\jai_codec.jar;D:\j2sdk1.4.0\jre\lib\ext\jai_core.ja
    r;D:\j2sdk1.4.0\jre\lib\ext\ldapsec.jar;D:\j2sdk1.4.0\jre\lib\ext\localedata.jar
    ;D:\j2sdk1.4.0\jre\lib\ext\mlibwrapper_jai.jar;D:\j2sdk1.4.0\jre\lib\ext\sunjce_
    provider.jar;D:\j2sdk1.4.0\jre\lib
    folders in class path: 19
    D:\java\Viewer_JPro\ckv7\classes\
    D:\j2sdk1.4.0\Coroutine for Java 2002\JavaDDE\JavaDde.jar
    D:\j2sdk1.4.0\Coroutine for Java 2002\JPrint\JPrint.jar
    X:\Java\wdt400tb.jar
    D:\j2sdk1.4.0\lib\dt.jar
    D:\j2sdk1.4.0\jre\lib\ext\Coroutine4Java.jar
    D:\j2sdk1.4.0\jre\lib\ext\jai_codec.jar
    D:\j2sdk1.4.0\jre\lib\ext\ldapsec.jar
    D:\j2sdk1.4.0\jre\lib\ext\mlibwrapper_jai.jar
    D:\j2sdk1.4.0\jre\lib
    Exception in thread "main" java.util.NoSuchElementException
            at java.util.StringTokenizer.nextToken(StringTokenizer.java:232)
            at com.accuchekinc.util.TestThis1.main(TestThis1.java:25)There are 19 folders in the classpath. However the nextToken() method is skipping some of them.
    Further st.hasMoreTokens() should prevent the loop from overrunning the list of tokens but doesn't.
    Does anyone have any ideas? What did I do wrong?
    Thanks all
    Bill

    while( st.hasMoreTokens() ) {
    System.out.println( st.nextToken() );
    valueArray[i++] = st.nextToken();
    }It looks like you're calling nextToken() twice each
    time through the while loop, but only checking to see
    if it exists once. This would be better:
    while(st.hasMoreTokens()) {
    String tok = st.nextToken();
    System.out.println(tok);
    valueArray[i++] = tok;
    Duhh............ Thanks! It was a long day.
    That makes senses. It is not like say String.length() which returns a set value. Ask and learn.

  • Problem with PJC (Print Dialog) - Forms 10g

    I have a problem with my PJC for Forms 10g r2. When I try to connect and run my PJC (raise Print dialog and put printer name in some text item) I get following message:
    oracle.forms.net.ConnectionException: Forms session <2> aborted: unable to communicate with runtime process.
         at oracle.forms.net.ConnectionException.createConnectionException(Unknown Source)
         at oracle.forms.net.HTTPNStream.getResponse(Unknown Source)
         at oracle.forms.net.HTTPNStream.doFlush(Unknown Source)
         at oracle.forms.net.HTTPNStream.flush(Unknown Source)
         at java.io.DataOutputStream.flush(Unknown Source)
         at oracle.forms.net.StreamMessageWriter.run(Unknown Source)
    When I started application, on Java console I saw this message, so I think the server configuration is fine (I change everything I need in Default.env and FormsWeb.cfg files):
    Loading http://devsrv/forms/java/jESPrintDialog.jar from JAR cache
    What can I change with server configuration or deploying my project to this PJC can work normaly?
    Thanks....

    Hi and thanks!
    I resolve one part of my problem. Tt was about diferent compiler (in JDeveloper 10.1.3 compiler is 1.5 and in my oc4j server JRE is earlier version, so it can`t work normaly).
    I comiled PJC in 1.4 version of compiler and now I can start and run my PJC.
    But, there is another problem:
    this is my part of java code (note: everything work fine except one line when I want to get printer name from select printer dialog):
    try {
    boolean b;
    PrinterJob job = PrinterJob.getPrinterJob();
    b = job.printDialog();
    try {
    return job.getPrintService().getName();
    catch (Exception e) {
    System.out.println("Error: "+e.getMessage());
    return "My error:";
    } catch (Exception e) {
    System.out.println("ERROR: " + e.getMessage());
    return "Problem with PJC [esoft]";
    So, when pjc want to get back printer name
    return job.getPrintService().getName();
    i get following error (on Java console):
    java.lang.NoSuchMethodError
         at happypjc.PDialog.getProperty(PDialog.java:50)
         at oracle.forms.handler.UICommon.onGet(Unknown Source)
         at oracle.forms.engine.Runform.onGetHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Can you give me some hint about it. Everything is OK now, except this (very important) peace of code!
    best regards
    mret

  • Problem with attribute id in taglib

    <req:headers id="hdrs">
              <jsp:getProperty name="hdrs" property="name"/> = <jsp:getProperty
              name="hdrs" property="header"/>
              </req:headers>
              When the JSP gets compiled it throws an error that is does not know about
              property "hdrs". Why?
              

              Try limiting the length of the session id.
              This is in either the weblogic.xml/web.xml
              files. You can get the dtd in the 6.0 doc.
              "Thierry Cools" <[email protected]> wrote:
              >Hi I have a problem with the session id that is generated in tha address bar
              >of my brower
              >When I start my application the following link appears
              >
              >http://127.0.0.1:7001/ebpp_beans/enterLogonInformation.do;jsessionid=Olw9VMc
              >0I1Z52YMgycyD23c8L4Ch2FurHLwbV2WhZw731dR3mBtJ|8186718416288373359/-140823374
              >1/7001/7002
              >
              >It seems that Weblogic 6.0 generates '/' characters in the session id.
              >This has for consequences that the servlet engine is taking the session id
              >in its context path, so that none of my links are working anymore.
              >
              >Could someone give me a clue to solve this problem
              >Thanks,
              >Thierry
              >
              >--
              >
              >Thierry Cools
              >
              >Senior Java Developer
              >S1 Brussels
              >Kleine Kloosterstraat, 23
              >1932 st. Stevens-Woluwe
              >Belgium
              >Tel : +32 2 200 43 82
              >Email : [email protected]
              >
              >
              >
              

  • Loadmovie, problem with  (_droptarget ==)

    Hi all
    I have problem with loadmovie that drive me crazy!. I made a
    drag and drop quiz (attached) that works perfectly but when I load
    it in another movie it doesn’t work anymore!
    The code that doesn’t work is:
    if (getProperty("/face1", _droptarget) == "/box3")…
    when the drag touch the target it should stay there.
    I attached the fla. If you have an idea it would be a great
    help!
    Thanks
    Herny

    Yep you can resize a movieclip dimensions on a percentage
    scale by using _xscale & _yscale which is applied from the
    registration point of the movieclip. For example, I reduce the
    scale of the movieclip below by 50% both horizontally and
    vertically...

  • Problems with Oracle Web Logic 10.3.6, certificates and proxies

    Good morning.
    We are trying to establish a SSL connection using Apache Cxf and WebLogic Server 10.3.6.
    For that, we are passing through a proxy. Using Apache Tomcat, the test is ok, we can connect to the endpoint correctly. But in WebLogic 10.3.6, we have problems with the certificates.
    In our code, we are loading the certificates programatically.
    The web-services-config.xml is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans
         xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"
         xmlns:http="http://cxf.apache.org/transports/http/configuration"
         xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:jaxws="http://cxf.apache.org/jaxws"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans">
         <jaxws:client address="@SNE.SNE_WS_URL@"
              serviceClass="com.bankia.sne.ws.clientes.buzonAPESNE.APESNEBuzonWSTipoPuerto"
              id="puertoAPESNEBuzonWS" />
         <http:conduit name="@SNE.SNE_WS_URL@">
              <http:client Connection="Keep-Alive" AutoRedirect="true"
                   ProxyServerType="HTTP" ProxyServerPort="@SNE.PROXY_PORT@"
                   ProxyServer="@SNE.PROXY_HOST@" />
              <http:proxyAuthorization>+
                   <sec:UserName>@SNE.PROXY_USER@</sec:UserName>
                   <sec:Password>@SNE.PROXY_PASSWORD@</sec:Password>
              </http:proxyAuthorization>
              <http:tlsClientParameters>
                   <sec:cipherSuitesFilter>
                        <!-- these filters ensure that a ciphersuite with export-suitable or
                             null encryption is used, but exclude anonymous Diffie-Hellman key change
                             as this is vulnerable to man-in-the-middle attacks -->
                        <sec:include>.*EXPORT.*</sec:include>
                        <sec:include>.*EXPORT1024.*</sec:include>
                        <sec:include>.*WITHDES_.*</sec:include>
                        <sec:include>.*WITHNULL_.*</sec:include>
                        <sec:exclude>.*DHanon_.*</sec:exclude>
                   </sec:cipherSuitesFilter>
              </http:tlsClientParameters>
         </http:conduit>
    </beans>
    That's the code used for establish the CXF connection:
    private void configuraConexion(Buzon buzon){
              try {
                   LOGGER.debug("Configurando conexión con el sevicio Web para el buzón con id " + buzon.getId() + " ...");
                   Client client = ClientProxy.getClient(puertoAPESNEBuzonWS);
                   HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
                   TLSClientParameters tlsParams = httpConduit.getTlsClientParameters();
                   Certificado certificado = buzon.getCertificado();
                   byte[] bytes = certificado.bytesCertificado();
                   CertificadoSerializable certSerializado = (CertificadoSerializable)Serializador.desserializar(bytes);
                   //Cargamos el truststore de disco
                   TrustManagerFactory trustFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
                   KeyStore truststore = KeyStore.getInstance(Propiedades.getProperty(KEY_SERVICIO_WEB_ALMACEN_TRUSTSTORE));
                   String contrasenia = Propiedades.getProperty(KEY_SERVICIO_WEB_TRUSTORE_PASSWORD);
                   // -- provide your truststore
                   File ficheroTruststore = null;
                   String rutaTrustore = Propiedades.getProperty(KEY_SERVICIO_WEB_TRUSTORE_RUTA) Propiedades.getProperty(KEY_SERVICIO_WEB_NOMBRE_TRUSTSTORE);
                   LOGGER.debug("rutaTrustore --> " + rutaTrustore);
                   if (rutaTrustore!=null){+
                        ficheroTruststore = new File(rutaTrustore);
              URL url = null;
                   if(ficheroTruststore == null || !ficheroTruststore.exists()){
                        url = Localizador.getResource(Propiedades.getProperty(KEY_SERVICIO_WEB_NOMBRE_TRUSTSTORE));
                        ficheroTruststore = new File(url.getPath());
                        truststore.load(url.openStream(), contrasenia.toCharArray());
                   }else{
                        truststore.load(new FileInputStream(ficheroTruststore), contrasenia.toCharArray());                    
                   LOGGER.info("[ServicioWSBuzonAPESNEImpl.configuraConexion] Fichero truststore.pks recuperado de "+ficheroTruststore.getPath());
                   trustFactory.init(truststore);
                   TrustManager[] tm = trustFactory.getTrustManagers();
                   tlsParams.setTrustManagers(tm);
                   //Cargamos el Keystore de base de datos
                   KeyStore keyStore = KeyStore.getInstance(Propiedades.getProperty(KEY_SERVICIO_WEB_TIPO_ALMACEN_KEYSTORE));
                   keyStore.load(null, certificado.getContrasenia().toCharArray());
                   keyStore.setKeyEntry(certificado.getAlias(), certSerializado.getClavePrivada(), certificado.getContrasenia().toCharArray(), certSerializado.getCadena());
                   // set our key store+
                   // (used to authenticate the local SSLSocket to its peer)
                   KeyManagerFactory keyFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
                   keyFactory.init(keyStore, certificado.getContrasenia().toCharArray());
                   KeyManager[] km = keyFactory.getKeyManagers();
                   tlsParams.setKeyManagers(km);
                   httpConduit.setTlsClientParameters(tlsParams);
                   LOGGER.debug("Conexión configurada satisfactoriamente");
              }catch (Exception e) {
                   LOGGER.error("Error al configurar la conexión del servicio Web", e);
                   throw new WSBuzonException("Error al configurar la conexión del servicio Web: " + e.getMessage());
    We don't know how to solve this issue? Please, could you help us?
    Thanks in advance,
    Jaime.
    Edited by: j2eedevelopment on 10-jul-2012 10:05

    Hi Zack, thanks for the answer.
    I've cleaned the code below.
    Our problem is the following: we wan't to use many keystores, in function the user who is connected in the application. For that reason, we wan't to give the keyStore from Java Client, because we've saw that, in WebLogic, you can select one keystore, but only one. For that reason, we wantto change the keystore in run time execution, dinamically.
    The problem we have found are the following:
    1) If we configure WebLogic with the correct keystore and trustore, we are not able to change keysotre and trustore in runtime execution, so we have to us always the same keystore and we don't want this.
    2) Also, I'm trying now to use JaxWS instead Apache Cxf, and I've tried to put the ssl properties of the system with the following code:
    System.setProperty(JAVAXNETSSLTRUST_STORE, trustore);
    System.setProperty(JAVAXNETSSLTRUST_STORE_PASSWORD, trustStorePassword);
    System.setProperty(JAVAXNETSSLKEY_STORE, keyStore);
    System.setProperty(JAVAXNETSSLKEY_STORE_PASSWORD, keyStorePassword);
    System.setProperty(JAVAXNETSSLKEY_STORE_TYPE, keyStoreType);
    Thanks in advance,
    Jaime.

  • JNDI problem with Sun Application Server

    I am trying to call a extremely simple EJB from a remote computer. But everytime I run the client I get a Class castException. I have used Weblogic and Jboss in the past and I never had any problem with JNDI. I included all the files except for the descriptor. Please help, this is driving me nut.
    Here is the exception i get:
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at clients.testEjbTest.main(testEjbTest.java:42)
    The remote Interface :
    package ejb.test;
    import javax.ejb.*;
    public interface Test extends javax.ejb.EJBObject{
    public String getResult() throws java.rmi.RemoteException;
    The Home interface is:
    package ejb.test;
    import javax.ejb.*;
    public interface TestHome extends javax.ejb.EJBHome{
    public Test create() throws java.rmi.RemoteException, CreateException;
    The Bean is:
    package ejb.test;
    import javax.ejb.*;
    public class TestBean implements javax.ejb.SessionBean {
    public TestBean() {}
    public String getResult() { return "hello";}
    public void ejbActivate() {  }
    public void ejbPassivate() {  }
    public void ejbRemove() {  }
    public void ejbCreate() throws CreateException {  }
    public void setSessionContext(javax.ejb.SessionContext sessionContext) { }
    The client is:
    public class testEjbTest {
    public testEjbTest() { }
    public static void main(String[] args) {
    try{
    Properties env = new Properties();
    env.setProperty("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory" );
    env.setProperty("java.naming.provider.url", "iiop://192.168.0.102:3700");
    InitialContext ic = new InitialContext(env);
    Object objref = ic.lookup("TestBean");
    Object tt = PortableRemoteObject.narrow(objref, ejb.test.TestHome.class);
    }catch(Exception e){e.printStackTrace();}

    Hi,
    I am new to this Forum.
    I have an application running on Weblogic.
    I want to shift to using SunOne as the Webserver and weblogic as application server.
    But when I deploy the application I am getting this ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow.
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.elsevier.portal.admin.web.proxy.LoginProxy.getLoginSession(LoginProxy.java:156)
         at com.elsevier.portal.admin.web.proxy.LoginProxy.authenticateUser(LoginProxy.java:48)
        at com.elsevier.portal.admin.web.actions.LoginAction.login(LoginActi
    on.java:201)
         at com.elsevier.portal.admin.web.actions.LoginAction.execute(LoginAction.java:80)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java
    :1482)
          at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
    525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:807)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
         at org.apache.catalina.core.StandardWrapperValve.invokeServletServic
    e(StandardWrapperValve.java:771)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    warning: CORE3283: stderr: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostVal
    ve.java:209)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
         at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)The code snippet is as follows�.
    protected LoginSession getLoginSession() throws ApplicationException {
    LoginSessionHome home = null;
    LoginSession object = null;
    try {
    home = (LoginSessionHome) (PortableRemoteObject.narrow(ProxyUtil.getEJBHome(getProperties().getProperty(DataCoreConstants.LOGIN_JNDI_NAME),getProperties()),LoginSessionHome.class));
    object = home.create();
    catch(ClassCastException cse){
    cse.printStackTrace();
    logger.error("Class Cast Exception is thrown while casting the Object to                      LoginSessionHome");
    logger.error(cse);
    throw new ApplicationException(ExceptionConstants.CLASS_CAST_EXCEPTION);
    return object;
    }Same method is running on weblogic without any problem�
    Help needed urgently.
    Regards,
    Neha.

  • Tunneling and problem with unknown host exception

    hello! i've got a problem with https. i use jdk 1.5.0, jboss-4.0.4.ga-patch1, soap.
    and i'm going crasy.. i've testet my client code at our network and it works fine. but if i want to get jobs from the server of our customer, my client throw an "unknown host exception: firm".
    i wonder why it hasn't the full host. the url may look like this: https://firm.sub.com:443/ and while the client connects to the server, i depugged it and the host is correct: firm.sub.
    but after the connection, when the client want to get something from the server (when it wants to communicate with the server over soap) it crashs.
    my client code looks like this:
    private ClientInterfaceEndpoint getClientInterface() throws ServiceException {
    QName serviceQName = new QName(DOCSERVER_NAMESPACE, CLIENT_INTERFACE_SERVICENAME);
    URL wsdlUrl = getClientInterfaceWsdlUrl();
    log.info("*******WSDLURL host: " + wsdlUrl.getHost()); // out: firm.sub
    log.info("*******WSDLURL port: " + wsdlUrl.getPort()); // out: 443
    URL mapping = getClass().getClassLoader().getResource("META-INF/DocumentServer_Mapping.xml");
    log.info("*******MappingURL path: " + mapping.getPath());
    if (wsdlUrl.toString().toLowerCase().contains("https")) {
    if (null == getConfig().getTruststore() || getConfig().getTruststore().equalsIgnoreCase("")) {
    throw new RuntimeException("No or incorrect TruststorePath in the docclient-config");
    File tmp = new File(getConfig().getTruststore());
    if (!tmp.isFile() || !tmp.canRead()) {
    throw new RuntimeException("The truststore at the 'TruststorePath' isn't a file or can't be read.");
    System.setProperty(SYS_PROPERTY_KEY_TRUST, getConfig().getTruststore());
    System.setProperty(SYS_PROPERTY_KEY_TRUST_PW, config.getTruststorePass());
    ServiceFactoryImpl factory = null;
    factory = (ServiceFactoryImpl) ServiceFactory.newInstance();
    Service clientInterfaceService = null;
    try {// create the service for the ClientInterface
    clientInterfaceService = factory.createService(wsdlUrl, serviceQName, mapping, new URL(config.getServerURL())); //, new URL(config.getServerURL())
    log.info("*******ClientInterFaceService WSDL URL Host: " + clientInterfaceService.getWSDLDocumentLocation().getHost()); // out:firm.sub
    log.info("*******ClientInterFaceService WSDL URL Port: " + clientInterfaceService.getWSDLDocumentLocation().getPort()); // out: 443
    } catch (ServiceException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (MalformedURLException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (Exception e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    }// getting the ClientInterfaceEndpoint
    ClientInterfaceEndpoint clientInterface = (ClientInterfaceEndpoint) clientInterfaceService.getPort(ClientInterfaceEndpoint.class);
    return clientInterface;
    protected URL getClientInterfaceWsdlUrl() {
    URL url = null;
    String urlString = getConfig().getServerURL() + CLIENT_INTERFACE_URI + "?wsdl";
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty(SYS_PROPERTY_KEY_PKGS);
    if (handlers == null) {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS);
    else {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS.concat("|").concat(handlers));
    try {
    url = new URL(urlString);
    log.info("*******URL host: " + url.getHost());
    log.info("*******URL port: " + url.getPort());
    log.info("*******URL path: " + url.getPath());
    } catch (MalformedURLException e) {
    log.fatal("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString);
    throw new RuntimeException("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString, e);
    System.setProperties(properties);
    return url;
    }if it's usefull: the customer use a apache server (not tomcat) where a the server is and the client at another system the jboss.
    The customer told me: if i want to connect the client via http i have to tunnel.. maybe i have to tunnel using https too?
    have i to generate the endpoint classes a second time, extra for https?
    or doesn't soap like host like "firm.sub"?
    can anyone help me please?!
    sorry, my english isn't very well...

    sorry, it's not the same error. The output is: Unable to connect to any host due to exception: java.net.socket.exception: java.net.socket.exception: Unregcognized windows socket error: 10106: create.

  • Problems with JApplet, jar-Archive, packages and IE5

    Hello!
    I have a problem with a JApplet and Internet Explorer 5. I made a jar archive of my classes. The classes are
    members of a package. The jar archive also contains images.
    The structure of the archive:
    com/mycomp/myapp/DemoApplication.class
    com/mycomp/myapp/DemoApplet.class
    <more classes>
    com/mycomp/myapp/images/hp_logo.gif
    com/mycomp/myapp/images/test.gif
    <more images>
    The archive is stored locally in a directory which contains also the html file.
    I used the sdk 1.3.1 to compile the classes.
    My problem: when I start the html file on NT with IE5, I get the error message below:
    I try to create a label containing an icon with:
    topLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("images"+fs+"hp_logo.gif")));It works on Sun with Netscape 4.67 and SDK 1.3.1 installed.
    Should I move the images directory inside the jar archive to another place or is the html code not correct?
    The error message:
    java.lang.NullPointerException
         at javax.swing.ImageIcon.<init>(Unknown Source)
         at com.mycomp.myapp.DemoApplication.initComponents(DemoApplication.java:158)
         at com.mycomp.myapp.DemoApplication.<init>(DemoApplication.java:55)
         at com.mycomp.myapp.DemoApplet.<init>(DemoApplet.java:24)
         at java.lang.Class.newInstance0(Native Method)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)The html file:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
    <html>
      <head>
        <title>DemoApplet</title>
      </head>
      <body>
    <BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#37a1a7">
          <h1>DemoApplet</h1>
          <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <SCRIPT LANGUAGE="JavaScript"><!--
        var _info = navigator.userAgent; var _ns = false; var _ns6 = false;
        var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
        var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0)));
        var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
        if (_ie == true) document.writeln('<OBJECT classid="clsid:CAFEEFAC-0013-0001-0000-ABCDEFFEDCBA" WIDTH = 695 HEIGHT = 525  codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0"><NOEMBED><XMP>');
        else if (_ns == true && _ns6 == false) document.writeln('<EMBED type="application/x-java-applet;jpi-version=1.3.1"  CODE = com.mycomp.myapp.DemoApplet CODEBASE = "." ARCHIVE = "DemoApplet.jar,classes12.zip" WIDTH = 800 HEIGHT = 600  scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET  CODE = com.mycomp.myapp.DemoApplet CODEBASE = "." ARCHIVE = "DemoApplet.jar,classes12.zip" WIDTH = 695 HEIGHT = 525></XMP>
    <PARAM NAME = CODE VALUE = com.mycomp.myapp.DemoApplet >
    <PARAM NAME = CODEBASE VALUE = "." >
    <PARAM NAME = ARCHIVE VALUE = "DemoApplet.jar,classes12.zip" >
    <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.3.1">
    <PARAM NAME="scriptable" VALUE="false">
    </APPLET>
    </NOEMBED></EMBED></OBJECT>
    <!--
    <APPLET CODE = DemoApplet CODEBASE = "." ARCHIVE = "DemoApplet.jar,classes12.zip" WIDTH = 695 HEIGHT = 525>
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
      </body>
    </html>Thank you for your help!
    Gruesse,
    Torsten

    seems like it couldn't find the image file... try to give it the absolute path to the file first to see if this is the root of the problem... and then try to find alternative ways to not give it the absolute path...

Maybe you are looking for