Java program in Jsp

Dear Friends,
I am new to jsp
Can embed java program in my jsp page ?
my java program contains outputstream, printwriter etc.,
can i put those in jsp program ?
please help me.
Thanks in advance
yours
rajesh

Of course you can. That's the whole point of JSP... Hence the name "Java Server Page".
JSP is designed to allow Java to interact with your page. You can instantiate classes and do anything you could normally do from within a non-jsp java app.
Michael

Similar Messages

  • How to call stand Alone java program from jsp

    Hello all...
    I want to use the stand alone java program in jsp page. I compiled the java program and place the class file in classes folder under web-inf. But when i try to instantiate the java class inside jsp it is not recognizing the class. Where might be the problem
    Plz help....
    Shamim

    hi , this is dheeraj.. i need to know that how to execute java code and class in jsp.. if anyone know about if bt tell me.. i just know that we can use java code by java beans in jsp.. if you know any knowledge regarding this topic please send me.....

  • Getting error when calling Java program from JSP page.

    Hi All,
    I'm getting below error msg, previously the page use to display and also java program use to run properly, but suddenly today i came across this error. May be some settings have been changed on my server, since number of developers uses this common webserver here.
    Any help would be much appreciated. Pls let me know if if anyone requires much info regarding this one.
    javax.servlet.ServletException: sun/tools/javac/Main
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at java.lang.Throwable.fillInStackTrace(Compiled Code)
         at java.lang.Throwable.(Compiled Code)
         at java.lang.Exception.(Compiled Code)
         at javax.servlet.ServletException.(Compiled Code)
         at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
         at javax.servlet.http.HttpServlet.service(Compiled Code)
         at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
         at org.apache.tomcat.core.Handler.service(Compiled Code)
         at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
         at org.apache.tomcat.facade.RequestDispatcherImpl.doForward
    Root cause:
    java.lang.NoClassDefFoundError: sun/tools/javac/Main
         at org.apache.jasper.compiler.SunJavaCompiler.compile(Compiled Code)
         at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
         at org.apache.jasper.servlet.JspServlet.doLoadJSP(Compiled Code)
         at org.apache.jasper.servlet.JasperLoader12.loadJSP(Compiled Code)
         at org.apache.jasper.servlet.JspServlet.loadJSP(Compiled Code)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Compiled Code)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
         at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
    Message was edited by:
    shukla_arvind

    did u happen to upgrade ur jdk?????

  • How can i execute java program in JSP ?

    att
    thanks

    try to use:
    Runtime.getRuntime().exec("command line");
    where "command line" is your command to execute your program.

  • JSP codes for running a JAVA program

    hello...
    does anyone know the JSP codes for running a Java program from my web page?? i mean i already have my java program compiled... and i just want this java program to run in the background when I click on a button or a link...
    Any idea about this?
    plz advice..
    avi

    yes... u r somewhat right... but this runs on Jakarta Tomcat...
    i'm using the Apache Http Server together with the ServletExec AS which enable the Apache server to run JSP..
    I've created a package where i've put my classes...
    WEB-INF/classes/tbd(package name)/my classes
    and i've added.. package name.. in my java program..
    and then in jsp... i've written..
    <%@ page import="tdb.*"%>
    <jsp:useBean id="exec" class="tdb.textdb" />
    <%exec.convert_data();%>
    but when i run the page it says the package does not exist...
    can anyone tell where to place the folder WEB-INF so that it can run fine?
    thx
    avi

  • How can i  use  this  java program to access from  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }here i need to generate the strings like 'enter value1' and respective text boxes dynamically . i should use this java program as business logic and a jsp page for view.
    following given is my text file input.eqn
    input:enter value1:arg1
    input:enter value2:arg2
    input:enter value3:arg3
    constant:enter constant1:arg4
    constant:enter constant2:arg5
    equation:enter equation:(arg1+arg2)*(arg3+arg4)*arg5
    result:

    Why do you double post ? http://forum.java.sun.com/thread.jspa?threadID=646988&tstart=0
    Why dint that answer satisfy you ? And why dint you say so in that thread rather than posting the same question again ?
    ram.

  • How can i  apply this  java program for  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }//my text file name is: "input.eqn" (given below)
    input:Enter Value1:arg1
    input:Enter Value2:arg2
    input:Enter Value3:arg3
    constant:arg4
    constant:arg5
    Equation:arg1+arg2+arg3
    result:

    how can i apply this java program for a jsp pagewhy do you want to do this ?
    Your program reads from a file on the disk and formats based on a patterm.
    Jsp is not intended for such stuff.
    ram.

  • Need help with jsp that uses a java program

    Hi, sorry for my english but i am italian.
    I've got a problem: i use java builder and i have a java program(this program has got a main and includes libraries) about graphich on tree, this program visualizes these trees and makes operations on these.
    Now i must use JSP so that a client can see this program (this program is on the server) and can interact with it.
    I can't use applet.I must use only jsp.
    Who can tell me how can i start???
    Thanks.

    If you are not allowed to use an applet, then you are limited by what can be achieved with HTML in a browser.
    You would have to figure out how to render it with HTML, then program your jsp to write out this html programatically.

  • JSP Unable to Load Class (posted in Java Programming for 5 Dukes)

    I hope this isn't a violation of forum etiquette, but I posted my question in Java Programming at http://forum.java.sun.com/thread.jsp?forum=31&thread=203255
    I realize now that it may have been wiser to post it here, but I have some replies already and it makes more sense just to inlcude the link.
    Can anyone assist with the question at http://forum.java.sun.com/thread.jsp?forum=31&thread=203255
    It's worth 5 dukes.

    Try changing <tagclass>E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag</tagclass> to <tagclass>tags.ExampleTag</tagclass>
    because <tagclass> tag is for the class name and not the location of class file
    And make sure your ExampleTag.class file is in
    \WEB-INF\classes\tag\ExampleTag.class
    B!

  • Calling jsp page from a java program

    Hello,
    Is it possible to call a JSP page from a java program? If so, please let me know how it is possible.
    I have a JSP page that inserts 10 records in a database based on the attribute given to the page. When the java program is executed all the 10 records need to be inserted.
    The JSP page is already running fine in Tomcat.
    Thanks and Regards,
    Prasanna.

    MVC has applied the standard of seperate your view , model and controller. I believe nobody will insert data from jsp page,better practice should be inserted from your database layer, normally is like DAO layer. so you should pass your data from jsp to your backend.
    hopefully it's help u

  • Java code in jsp source files is not allowed in ojsp.next mode.

    Hi,
    I’m working on WC Spaces Customization library “com.acme.custom.webcenter.spaces.war”. From time to time, when I deploy the library to WC Server, it errors out.
    weblogic.management.DeploymentException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    If I try to login the Spaces, I get “Java code in jsp source files is not allowed in ojsp.next mode.” Should I stop the Spaces server before the deployment? In this case, other people won’t have accesses to Spaces? The deployment error doesn’t happen all the time.
    oracle.jsp.parse.JavaCodeException: Line # 6, oracle.jsp.parse.JspParseTagScriptlet@5b9864ca
    Error: Java code in jsp source files is not allowed in ojsp.next mode.
    at oracle.jsp.parse.JspParseTagCore.createNode(JspParseTagCore.java:263)
    at oracle.jsp.parse.JspUtils.createChildNodes(JspUtils.java:2489)
    at oracle.jsp.parse.JspParseTagFile.createTree(JspParseTagFile.java:475)
    at oracle.jsp.parse.OracleJsp2Java.transformImpl(OracleJsp2Java.java:535)
    at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:593)
    at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:691)
    at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:490)
    at oracle.jsp.runtimev2.JspPageCompiler.parseAndGetTreeNode(JspPageCompiler.java:457)
    at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:624)
    at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:645)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:385)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:802)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:726)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    Buildfile: C:\JDeveloper\mywork\LamwWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\build.xml
    =======
    init-wls:
    deploy-shared-lib:
    [echo] ----------------------------
    [echo] C:\JDeveloper\mywork\myuserconfigfile.secure C:\JDeveloper\mywork\myuserkeyfile.secure claptd01:7001 C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions/WebCenterSpacesSharedLibExtension/deploy/exploded WC_Spaces com.acme.custom.webcenter.spaces
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
    [exec]
    [exec] PATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\native;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1\bin;C:\oracle\MIDDLE~1.5\JDK160~1\jre\bin;C:\oracle\MIDDLE~1.5\JDK160~1\bin;C:\Program Files\PHP52\;C:\Program Files\Common Files\OTG;C:\oracle\product\10.2.0\client_1\bin;C:\oracle\ora_adi\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\MSSQL7\BINN;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\glassfish3\jdk\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Vim\vim73;c:\apache\ant\bin;c:\jboss\bin;C:\Apache\apache-cxf\bin;C:\glassfish\bin;C:\Program Files\QuickTime\QTSystem\;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32\oci920_8
    [exec]
    [exec] Your environment has been set.
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\oracle\MIDDLE~1.5\utils\config\10.3\config-launch.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbytools.jar;;
    [exec]
    [exec] Initializing WebLogic Scripting Tool (WLST) ...
    [exec]
    [exec] Welcome to WebLogic Server Administration Scripting Shell
    [exec]
    [exec] Type help() for help on available commands
    [exec]
    [exec]
    [exec] Deploy started at Wed Mar 28 12:25:08 2012
    [exec]
    [exec] Connecting to t3://claptd01:7001 with userid weblogic ...
    [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
    [exec]
    [exec] Warning: An insecure protocol was used to connect to the
    [exec] server. To ensure on-the-wire security, the SSL port or
    [exec] Admin port should be used instead.
    [exec]
    [exec] Location changed to edit tree. This is a writable tree with
    [exec] DomainMBean as the root. To make changes you will need to start
    [exec] an edit session via startEdit().
    [exec]
    [exec] For more help, use help(edit)
    [exec] You already have an edit session in progress and hence WLST will
    [exec] continue with your edit session.
    [exec]
    [exec] Starting an edit session ...
    [exec] Started edit session, please be sure to save and activate your
    [exec] changes once you are done.
    [exec] Deploying application from C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\deploy\exploded\com.acme.custom.webcenter.spaces.war to targets WC_Spaces (upload=true) ...
    [exec] <Mar 28, 2012 12:25:10 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, com.acme.custom.webcenter.spaces [archive: C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\deploy\exploded\com.acme.custom.webcenter.spaces.war], to WC_Spaces .>
    [exec] You have an edit session in progress, hence WLST will not
    [exec] block for your deployment to complete.
    [exec] Started the Deployment of Application. Please refer to the returned WLSTProgress object or variable LAST to track the status.
    [exec]
    [exec] ### ### ###: Deploy done
    [exec]
    [exec] 0
    [exec]
    [exec] ### ### ###: Status of Deploy
    [exec]
    [exec] Current Status of your Deployment:
    [exec] Deployment command type: deploy
    [exec] Deployment State : running
    [exec] Deployment Message : [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
    [exec]
    [exec]
    [exec] ### ### ###: Saving
    [exec]
    [exec] Saving all your changes ...
    [exec] Saved all your changes successfully.
    [exec]
    [exec] ### ### ###: Activating
    [exec]
    [exec] Activating all your changes, this may take a while ...
    [exec] The edit lock associated with this edit session is released
    [exec] once the activation is completed.
    [exec] This Exception occurred at Wed Mar 28 12:25:18 EDT 2012.
    [exec] weblogic.management.DeploymentException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    [exec]      at weblogic.deploy.event.DeploymentEventManager.sendVetoableDeploymentEvent(DeploymentEventManager.java:337)
    [exec]      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.fireVetoableDeploymentEvent(AbstractOperation.java:781)
    [exec]      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:216)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
    [exec]      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    [exec]      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    [exec]      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    [exec] Caused by: weblogic.deploy.event.DeploymentVetoException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    [exec]      at weblogic.application.library.LibraryDeploymentListener.verifyLibrary(LibraryDeploymentListener.java:123)
    [exec]      at weblogic.application.library.LibraryDeploymentListener.vetoableApplicationActivate(LibraryDeploymentListener.java:58)
    [exec]      at weblogic.application.library.LibraryDeploymentListener.vetoableApplicationDeploy(LibraryDeploymentListener.java:64)
    [exec]      at weblogic.deploy.event.VetoableDeploymentEvent$2.notifyListener(VetoableDeploymentEvent.java:70)
    [exec]      at weblogic.deploy.event.DeploymentEventManager.sendVetoableDeploymentEvent(DeploymentEventManager.java:335)
    [exec] None
    [exec] #########################################################
    [exec] ##### Deployment Failed #########
    [exec] ##### Contact support with Exception Stack #########
    [exec] #########################################################
    [exec]
    [exec]
    [exec] Exiting WebLogic Scripting Tool.
    [exec]
    [exec] <Mar 28, 2012 12:25:18 PM EDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    [echo] ----------------------------
    [echo] Restarting the app
    [echo] ----------------------------
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
    [exec]
    [exec] PATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\native;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1\bin;C:\oracle\MIDDLE~1.5\JDK160~1\jre\bin;C:\oracle\MIDDLE~1.5\JDK160~1\bin;C:\Program Files\PHP52\;C:\Program Files\Common Files\OTG;C:\oracle\product\10.2.0\client_1\bin;C:\oracle\ora_adi\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\MSSQL7\BINN;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\glassfish3\jdk\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Vim\vim73;c:\apache\ant\bin;c:\jboss\bin;C:\Apache\apache-cxf\bin;C:\glassfish\bin;C:\Program Files\QuickTime\QTSystem\;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32\oci920_8
    [exec]
    [exec] Your environment has been set.
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\oracle\MIDDLE~1.5\utils\config\10.3\config-launch.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbytools.jar;;
    [exec]
    [exec] Initializing WebLogic Scripting Tool (WLST) ...
    [exec]
    [exec] Welcome to WebLogic Server Administration Scripting Shell
    [exec]
    [exec] Type help() for help on available commands
    [exec]
    [exec]
    [exec] Redeploy of Spaces Application started at Wed Mar 28 12:25:21 2012
    [exec]
    [exec] Connecting to t3://claptd01:7001 with userid weblogic ...
    [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
    [exec]
    [exec] Warning: An insecure protocol was used to connect to the
    [exec] server. To ensure on-the-wire security, the SSL port or
    [exec] Admin port should be used instead.
    [exec]
    [exec] Redeploying application webcenter ...
    [exec] <Mar 28, 2012 12:25:28 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, webcenter#11.1.1.4.0 [archive: null], to WC_Spaces .>
    [exec] [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
    [exec] ..........................................Failed to redeploy the application with status failed
    [exec] Current Status of your Deployment:
    [exec] Deployment command type: redeploy
    [exec] Deployment State : failed
    [exec] Deployment Message : java.lang.Exception: [DeploymentService:290036]Deployment for request id '1332951945158' is deferred since target 'WC_Spaces' is disconnected.
    [exec] No stack trace available.
    [exec] None
    [exec] #########################################################
    [exec] ##### ReDeploy Spaces Failed #########
    [exec] ##### Contact support with Exception Stack #########
    [exec] #########################################################
    [exec]
    [exec]
    [exec] Exiting WebLogic Scripting Tool.
    [exec]
    [exec] <Mar 28, 2012 12:27:34 PM EDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    BUILD SUCCESSFUL
    Total time: 2 minutes 31 seconds
    Edited by: 891549 on Mar 29, 2012 12:01 PM

    I don't think that this error is based on ojsp.next mode. The first error I see is that the application can't be undeployed. After that you get the 'ava code in jsp source files is not allowed in ojsp.next mode.' error. As you said this only happens sometimes which also point to an other problem and not to the jsp error.
    Have you ask this on the {forum:id=354} forum?
    For me it's more a deployment/redeployment question.
    Timo

  • How to detect that i am already running a java program

    hi
    i am writing this java program. my problem is i don't
    want to run more than one program at any time, so i
    need a way to detect whether I am already running the program whenever I want to run the program.
    Is there any way to do this in java ?
    thanks for you help

    Look at this thread:
    http://forums.java.sun.com/thread.jsp?forum=31&thread=169912

  • Compiling / Running a Java file in JSP

    Hi,
    ok, I have a jsp page, which we will call page 1. Once I go to that page, I all I want it to do is compile a certain file.java, and then run the file.java. The user doesn't actually know that this is going on in the background. Page 1 automatically redirects the user to page 2 (also a jsp page).
    The java program that I created (that was previously compiled and ran) creates a special javascript file. After running the file.java in page #1, the java file creates a javascript file that will be used in page 2 to display a tree node (group of information).
    so, right now, I'm trying to figure out how to write the jsp code that will tell how to compile and run a java file. I was thinking about using javabeans before, but I think you HAVE to actually display the contents of the java file into the jsp (I think). Anyhow, thanks for the help!

    sorry about being ambiguous before. What I mean by
    running a java file was that I already created a java
    file. I don't want to hava my java statements inside
    the jsp file. I just want the jsp file have a command
    in it that would call a java file, tell the java file
    to compile and run. All the jsp file would do
    (hopefully) is just give commands for a seperate java
    file to compile and run. Thanks again for any help!Ok, so this other java file has some entry-point method, like main(), right? So call it...
    <%
    YourJavaClass.main(appropriateArgumentsGoHere);
    %>
    or better yet, it's an object you can use:
    <%
    YourJavaClass x = new YourJavaClass();
    x.callSomeMethodHere(withAppropriateArgumentsHere);
    x.callAnotherMethodMaybe();
    %>
    You don't need the jsp file to "compile" this java file, you'd already have compiled it beforehand, and it's class bytecode needs to be in your classpath (on the server side) of course.

  • "at" UNIX Command in Java Program

    Friends,
    1. "at" command in UNIX execute Unix command at a scheduled time. 2. For each user there will be a table maintained internally which can be accessed by "at" with "-l" argument.
    3. A mail will be sent to the owner with the output of the commands as a message.
    I tried to run the "at" command of Unix in JSP, which gets succesfully executed in Oracle 10g App Server container (Installed in Solaris machine). I have tested the successful execution of command with the log file. But I haven't got any mail for the output. If anyone had any idea, please help me.
    The code I have wtitten is
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(new String[] {"sh","-c","at 2115 Dec 7 < /export/home/usr1/abc.sh"});
    InputStream stderr = proc.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    logger.info("<ERROR>");
    while ( (line = br.readLine()) != null)
    logger.info(line);
    logger.info("</ERROR>");
    int exitVal = proc.waitFor();
    logger.info("Process exitValue: " + exitVal);
    My doubts are:
    1. Who is the owner of the output of "at"command, which gets executed under Oracle 10g App Server container?
    2. If no one is the owner, then where will the output of "at" command will go?
    3. Is there any other way to execute "at" command of UNIX in java program? If so, then please help me.
    Thanks in advance.
    regards
    Nandha Kumar.M

    filestream I have to ask - what's a chav ?
    I have doubts abut what it is :-)
    Seriously though, what is that an abbreviation for?
    That's a new one to me.
    http://www.chavscum.co.uk
    chavs are roughly analogous to rednecksI wouldn't use that analogy. While both may lack certain social graces, rednecks typically don't receive ASBOs.
    Chavs favor small cars with lots of bling whereas rednecks are likely to drive a pickup or a large sedan.
    Chavs have pitbulls in their yards (gardens), rednecks an '84 Mustang LX on cinder blocks.
    etc, etc.
    Message was edited by:
    filestream
    Message was edited by:
    filestream

  • How to read files on server from a java program?

    Hello,
    I am fairly new to JSP programming. I have an issue with reading files. I am trying to call method of a normal java file from a jsp program. The method I am trying to call does some IO operation on Files. I have the files in the same directory as my class files on server that is in WEB-INF/classes folder. In my java program, I am giving just the file name to open because the files and the classes are in the same directory. But this is not working.
    What exactly should I do to read a file from a java program, that is running on the server?
    Any help is appreciated.
    Thanks,
    Krishna

    String realFilePath = application.getRealPath("/WEB-INF/myFile.txt");
    File fileToOpen = new File(realFilePath);
    out.println(fileToOpen.getAbsolutePath() + ": exists? " + fileToOpen.exists());in this case "application" is a reference to the ServletContext.
    It is an implicit variable in a JSP. In a servlet:
    ServletContext application = getServletConfig().getServletContext();

Maybe you are looking for