How to keep the servlet java code the JSP engine generated?

Hello there!
          I am using some JSP in a web application, and would like to take a llok
          at the servlet java files th weblogic JSP engine generated.
          In my weblogic.properties file I have the following line:
          "# Set up WebLogic JSP properties
          weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
          weblogic.httpd.initArgs.*.jsp=\
          pageCheckSeconds=1,\
          compileCommand=F:/VisualCafeEE/bin/sj.exe,\
          workingDir=F:/weblogic/myserver/classfiles,\
          verbose=true,\
          keepgenerated=true"
          However, the only things I can find are the class files compiled from
          the servlet java files.
          Any suggestions?
          Thanks.
          Jeff.
          

Moerover, if you follow the example web.xml Weblogic provides
          (http://www.weblogic.com/docs51/classdocs/sample_web_xml.html), the parser
          would complaint big time.
          The <servlet> and <context-param> tags have to be switched.
          Jeff
          "John J. Feigal" wrote:
          > I'm not sure why, but specifying keepgenerated=true in weblogic.properties
          > did not do the job for us.
          >
          > We had to add the following to our application's web.xml file:
          >
          > <!-- keepgenerated initArg to JSPServlet -->
          > <context-param>
          > <param-name>weblogic.jsp.keepgenerated</param-name>
          > <param-value>true</param-value>
          > </context-param>
          >
          > --
          > John J. Feigal Voice (651)766-8787 (main)
          > Sr. Technical Consultant (651)766-7249 (direct)
          > Ensodex, Inc. Fax (651)766-8792
          > 4105 N. Lexington Ave., Suite 150 email [email protected]
          > Arden Hills, MN 55126 WebSite http://www.ensodex.com
          >
          > "Jong Lee" <[email protected]> wrote in message
          > news:[email protected]...
          > >
          > > You have the init arg "keepgenerated" tunred on in weblogic.properties.
          > > The java file should be kept in the same directory of your jsp file.
          > >
          > > You can also use "jspc" to generate the java source.
          > > i.e:
          > > "java weblogic.jspc -keepgenerated yourjspfile"
          > >
          > >
          > >
          > >
          > >
          > > Jeff Wang <[email protected]> wrote:
          > > >Hello there!
          > > >
          > > >I am using some JSP in a web application, and would like to take a llok
          > > >at the servlet java files th weblogic JSP engine generated.
          > > >
          > > >In my weblogic.properties file I have the following line:
          > > >
          > > >"# Set up WebLogic JSP properties
          > > >weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
          > > >weblogic.httpd.initArgs.*.jsp=\
          > > > pageCheckSeconds=1,\
          > > > compileCommand=F:/VisualCafeEE/bin/sj.exe,\
          > > > workingDir=F:/weblogic/myserver/classfiles,\
          > > > verbose=true,\
          > > > keepgenerated=true"
          > > >
          > > >However, the only things I can find are the class files compiled from
          > > >the servlet java files.
          > > >
          > > >Any suggestions?
          > > >
          > > >Thanks.
          > > >
          > > >Jeff.
          > > >
          > >
          

Similar Messages

  • Is it true that JSP creates Servlet java code?

    I am working with JSP.
    My web server is tomcat.
    Is it true that JSP creates Servlet java code of JSP files when it executes? If so how can I view them?

    Yes..it is true..
    to find out..do this..
    on purpose leave a bug in ur jsp that will generate a compilation error. So in ur browser some exception will be shown.That exception message will have the clue to the java file (e.g
    error in compiling _XYZ.java).You can manually search for this file..
    (If the copilation is successful, then this java file is deleted by the server.)

  • Java code and jsp interaction

    Hi,
    How does one interact between java code and jsp page.That is, if the java code does say database connection, the web page should tell that the connection has been made,just like an application but this will work on the web server not in the console.Kindly let me know.
    As

    Just curious but where do these questions come from? A course you are taking or you are building something for a hobby?
    If you are building some small simple web-app it's probably quicker to embed code right onto your JSP page.
    There are various levels of abstracting your web-app separating display from logic from the model.
    The following are techniques from simple web-apps to more complicated ones.
    -Embedding script right into your JSP
    -Using beans
    -Using custom tags ( I think there are some standard ones now, struts seems to be a popular buzzword)
    -Including a servlet to handle your requests redirect, update bean content grab info form your database and forward to a JSP. (Read up on model 2 architecture.)
    To include as much detail as possible would be to write a book. Fortunately many have so I don't have to fit one in this tiny reply box.
    Hope that was somewhat useful.

  • How to get personnel number of the user in the wd java code in Leave reques

    Hi all,
    we are using the standard Leave Request Applicatin ESS.
    can any one please tell me how to get the personnel number of the user in the WD java code?
    cause i have pass the pernr number to a bapi and get the details.
    please help me its urgent.
    thanks in advance.

    Hi Madhu,
    Create a model for the particular bapi in wd java and acess it in your component. Then pernr parameter will be available in the context and u can pass value for the parameter (pernr) to the model and get the output.
    If you hav any doubt, please let me know.
    Regards,
    Jithin

  • How to get ther servlet name from the Httprequest / servletContext

    Hi,
    How can I get the servlet name from the Http Request / Servlet conext?
    Arthik

    I have a requirement to call the business logic either in local server / external server.
    Local / External server
    The original / main request is made to the server from the client and from the server if the main request requires some resource (second request from server side) available in the external server then I need to make a URL connection. If the requested resource is the local resource then I need to by-pass the HTTP call. So I need to verify the server name , port with the originally requested server.Then I need to check if the request servelt is available in local or not.
    Can you please help me.

  • Urget Help --- Please give me the core java code that connects to UNIX ser

    Can anyone provide the core java code that connects UNIX server after verifying credentials and allow to implements UNIX commands through java program?

    no, you don't want to do that.
    You want to connect yourself, which Java is quite capable of doing, rather than go through some 3rd party client program that's not only specific to a particular operating system but not guaranteed to be installed at any particular machine or if it is to be installed in such a way that you can start it from your Java program.
    And then there's the little matter of figuring out the external API to use that program in the way you intent to (if it has one).

  • How to keep MS excel icon in the dock at iMac of guest sharing account

    Dear All
    May i know how to keep MS excel icon in the dock at iMac of guest sharing account.
    Thank a lot
    Raymond

    It's normal for the Guest account to return to a default state after logging out. Applications can still be opened from the Applications & other folders.
    You can add things to the Dock, & make other changes, using Workgroup Manager 10.8
    although it's not especially intuitive or forgiving. Post again if you want to try it.

  • When redeeming a voucher, once I've inserted the 16 digit code, the redeem button is "greyed" out so I cannot go any further

    When redeeming a voucher, once I've inserted the 16 digit code, the redeem button is "greyed" out so I cannot go any further
    What could be wrong? I have redeemed vouchers numerous times before
    I have tried logging out and back in again but the same thing happens?

    Hello,
    the SMTP was set on "none." I selected the server and now it seems to work. The thing is--- is that this seems to be a recurring thing with the SMTP server not staying selected. I deleted and reestablished my exchange account about a month ago because mail would not send (the button was not greyed) but the mail would not send. the same thing was the problem, the SMTP switching to none. Thanks for your help, at least now I know what is causing the problem. sure wish it would stop switching to "none".
    Thanks again
    LM

  • 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

  • Converting  JAVA  code to JSP

    Hi every one, I am new to JSP I have a code in JAVA which is used to generate an image from a temporary file of size 34.1MB.
    I am unable to convert that JAVA code into JSP,can anyone help me in this regard
    Here is my code
    import java.awt.image.*;
    import java.io.*;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class ExampleCreate {
        public static void main(String[] args) throws Exception {
            final int H = 2530;
            final int W = 3630;
            int[] pixels = createPixels(W*H);
            BufferedImage image = toImage(pixels, W, H);
            display(image);
            ImageIO.write(image, "jpg", new File("static.jpg"));
      static int[] createPixels(int size) throws Exception{
           int[] pixels = new int[size];
           int[] colors = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,104,106,108,110,112,114,116,118,120,122,124,126,0xff0000,0x00ff00,0x0000ff,0x00000f,0xfff000,0xff00ff,0xffffff,0xf00000};
           FileReader fr = new FileReader("SST.tmp");
           BufferedReader br = new BufferedReader(fr);
           String text = br.readLine();
           int c = 0;
           for(int i = 0; i < size; ++ i){
                     text = br.readLine();
                     c = Integer.parseInt(text);
                     if(c < 0)
                          c = 0;
                     pixels[i] = colors[c];
           br.close();
       return pixels;
        static BufferedImage toImage(int[] pixels, int w, int h) {
            DataBuffer db = new DataBufferInt(pixels, w*h);
            WritableRaster raster = Raster.createPackedRaster(db,
                w, h, w, new int[] {0xff0000, 0xff00, 0xff}, null);
            ColorModel cm = new DirectColorModel(24, 0xff0000, 0xff00, 0xff);
            return new BufferedImage(cm, raster, false, null);
        static void display(BufferedImage image) {
            final JFrame f = new JFrame("");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JLabel(new ImageIcon(image)));
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }thanks&regards
    Mahender

    According to me just convert ths code to servlet and instead of displaying the image with BufferedImage just stream it (the image) to the browser. This will be useful to catch the general idea.

  • Hi frnds i want to help in servlet,java bean and JSP

    hi friends i'm right now in M.SC(IT) and i want to do project in SERVLET,,JAVA BEANS and JSP ,
    so pls give me a title about that
    NOTE: I develop a project in group(2 persons there)
    my email id is : [email protected] , [email protected] , [email protected]

    You cannot pair your iPod to a cell phone, so forget about it.
    The only way you can get free WiFi is to hang out at a Denny's, a Starbucks, or a truck stop, and I don't think your parents would approve....

  • How to do implement the FrameAccess.java code in my project

    Iam doing an project in java for inserting the videos into oracle9i and searching the inserted videos using the frames of the videos inserted.I have done the project to insert and search the videos.But i have been asked to put an EXTRACT button to extract all the frames of the video being inserted.Please help me to implement the FrameAccess.java coding in my existing coding.I have pasted my coding(VideoInsert.java) and FrameAccess.java(used to extract frames) coding.
    The VideoInsert.java when executed will contain browse button to choose the video file(only .mpg files) to be inserted into the database.After selecting the file and when we press open button in the Open dialog box,the video will be played in jmf player in a separate window and the filepath of the video will be included in the textbox.Now what i need is,an extract button should be placed and when it is clicked,the frames of the corresponding selected video has to be extracted in the location where the project files are stored i.e.,the FrameAccess.java coding has to be executed.
    Please help me if anyone knows how to implement the above concept.
    VideoInsert.java
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import oracle.sql.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.sql.BLOB ;
    import symantec.itools.multimedia.ImageViewer;
    public class VideoInsert extends javax.swing.JFrame {
        private Connection con;
        private Statement st=null;
        private OracleResultSet rs=null;
        int count=0;
        int count1=0;
        ImageViewer displaywindow = new ImageViewer();
        /** Creates new form VideoInsert */
        public VideoInsert() {
            initComponents();
            imgpane.add(displaywindow);
            try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                con = DriverManager.getConnection("jdbc:oracle:oci:@","scott","tiger");
                  //con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:FIRST","scott","tiger");
                con.setAutoCommit(false);
                st =con.createStatement();
                rs=(OracleResultSet)st.executeQuery("select max(vid) from browsevideo");
                while (rs.next()) {
                    count = (rs.getInt(1) + 1);
                rs.close();
                st =con.createStatement();
                rs=(OracleResultSet)st.executeQuery("select max(imageno) from browseimage");
                while (rs.next()) {
                    count1 = (rs.getInt(1) + 1);
                rs.close();
            } catch (SQLException e) {
                e.printStackTrace();
            txtvid.setText(String.valueOf(count));
             VideoTypeComboBox.addItem("All");
            VideoTypeComboBox.addItem("Entertainment");
            VideoTypeComboBox.addItem("Sports");
            VideoTypeComboBox.addItem("Animation");
            VideoTypeComboBox.addItem("News");
             VideoTypeComboBox.addItem("Others");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {//GEN-BEGIN:initComponents
            jLabel1 = new javax.swing.JLabel();
            txtvid = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
            txtvidfile = new javax.swing.JTextField();
            jLabel3 = new javax.swing.JLabel();
            txtvidinfo = new javax.swing.JTextField();
            jLabel4 = new javax.swing.JLabel();
            txtimgfile = new javax.swing.JTextField();
            vidbrowse = new javax.swing.JButton();
            imgbrowse = new javax.swing.JButton();
            jLabel5 = new javax.swing.JLabel();
            txtimgcont = new javax.swing.JTextField();
            insert = new javax.swing.JButton();
            imgpane = new javax.swing.JPanel();
            jLabel6 = new javax.swing.JLabel();
            VideoTypeComboBox = new javax.swing.JComboBox();
            getContentPane().setLayout(null);
            setTitle("VideoInsert");
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    exitForm(evt);
            jLabel1.setText("Video ID");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(30, 80, 90, 16);
            txtvid.setEditable(false);
            getContentPane().add(txtvid);
            txtvid.setBounds(130, 80, 130, 20);
            jLabel2.setText("VideoFile");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(30, 130, 70, 16);
            getContentPane().add(txtvidfile);
            txtvidfile.setBounds(130, 130, 130, 20);
            jLabel3.setText("VideoInfo");
            getContentPane().add(jLabel3);
            jLabel3.setBounds(30, 180, 80, 16);
            getContentPane().add(txtvidinfo);
            txtvidinfo.setBounds(130, 180, 130, 20);
            jLabel4.setText("TopImage");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(30, 230, 70, 16);
            getContentPane().add(txtimgfile);
            txtimgfile.setBounds(130, 230, 130, 20);
            vidbrowse.setText("Browse");
            vidbrowse.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    vidbrowseActionPerformed(evt);
            getContentPane().add(vidbrowse);
            vidbrowse.setBounds(280, 130, 78, 26);
            imgbrowse.setText("Browse");
            imgbrowse.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    imgbrowseActionPerformed(evt);
            getContentPane().add(imgbrowse);
            imgbrowse.setBounds(280, 230, 78, 26);
            jLabel5.setText("ImageContent");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(30, 280, 80, 16);
            getContentPane().add(txtimgcont);
            txtimgcont.setBounds(130, 280, 130, 20);
            insert.setText("Insert");
            insert.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    insertActionPerformed(evt);
            getContentPane().add(insert);
            insert.setBounds(150, 400, 81, 26);
            imgpane.setLayout(new java.awt.BorderLayout());
            getContentPane().add(imgpane);
            imgpane.setBounds(410, 120, 350, 260);
            jLabel6.setText("Video Type");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(30, 340, 80, 16);
            getContentPane().add(VideoTypeComboBox);
            VideoTypeComboBox.setBounds(130, 340, 130, 25);
            pack();
            java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
            setSize(new java.awt.Dimension(800, 600));
            setLocation((screenSize.width-800)/2,(screenSize.height-600)/2);
        }//GEN-END:initComponents
        private void insertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insertActionPerformed
            BLOB blb= null;
            PreparedStatement stmt = null;
            OutputStream fout=null;
            File f=null;
            FileInputStream fin=null;
            int bufferSize;
            byte[] buffer=null;
            int bytesRead = -1;
            String sfile1 = txtvidfile.getText();
            String sfile2 = txtimgfile.getText();
            String format=null;
            String format1=null;
            String videoinfo=txtvidinfo.getText();
            String imgcontent=txtimgcont.getText();
            String videoType=(String)VideoTypeComboBox.getSelectedItem();
            if(sfile1.endsWith("avi")) {
                format="avi";
            }else if(sfile1.endsWith("mpg")) {
                format="mpg";
            }else {
                format="mpg";
            if(sfile2.endsWith("jpg")) {
                format1="jpg";
            }else if(sfile2.endsWith("gif")) {
                format1="gif";
            }else {
                format1="jpg";
            if((sfile1.length()>0) && (sfile2.length()>0)) {
                try {
                    stmt=con.prepareStatement(" insert into browsevideo values (?,EMPTY_BLOB(),?,?,?)");
                    stmt.setInt(1,count);
                    stmt.setString(2,format);
                    stmt.setString(3,videoinfo);
                     stmt.setString(4,videoType);
                    stmt.executeUpdate();
                    stmt.close();
                    con.commit();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt = con.prepareStatement("Select video FROM browsevideo WHERE vid = ? for update of video");
                    stmt.setInt(1,count);
                    rs = (OracleResultSet)stmt.executeQuery();
                    rs.next();
                    blb = rs.getBLOB("video");
                    fout = blb.getBinaryOutputStream();
                    f = new File(sfile1);
                    fin = new FileInputStream(f);
                    bufferSize = blb.getBufferSize();
                    buffer = new byte[bufferSize];
                    while((bytesRead = fin.read(buffer)) != -1) {
                        fout.write(buffer, 0, bytesRead);
                    fout.flush();
                    fout.close();
                    con.commit();
                    rs.close();
                    stmt.close();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt=con.prepareStatement(" insert into browseimage values (?,?,?,EMPTY_BLOB(),?,?,?)");
                    stmt.setInt(1,count);
                    stmt.setInt(2,count1);
                    stmt.setInt(3,count1);
                    stmt.setString(4,imgcontent);
                    stmt.setString(5,format1);
                    stmt.setString(6,videoType);
                    stmt.executeUpdate();
                    stmt.close();
                    con.commit();
                }catch(Exception e) {
                    e.printStackTrace();
                try {
                    stmt = con.prepareStatement("Select image FROM browseimage WHERE imageno = ? for update of image");
                    stmt.setInt(1,count1);
                    rs = (OracleResultSet)stmt.executeQuery();
                    if(rs.next()) {
                        blb = rs.getBLOB("image");
                        fout = blb.getBinaryOutputStream();
                        f = new File(sfile2);
                        fin = new FileInputStream(f);
                        bufferSize = blb.getBufferSize();
                        buffer = new byte[bufferSize];
                        while((bytesRead = fin.read(buffer)) != -1) {
                            fout.write(buffer, 0, bytesRead);
                        fout.flush();
                        fout.close();
                        con.commit();
                        rs.close();
                    stmt.close();
                    count++;
                    count1++;
                    txtimgfile.setText("");
                    txtvidfile.setText("");
                    txtimgcont.setText("");
                    txtvidinfo.setText("");
                    txtvid.setText(String.valueOf(count));
                    JOptionPane.showMessageDialog(this,"Successfuly Completed");
                }catch(Exception e) {
                    e.printStackTrace();
        }//GEN-LAST:event_insertActionPerformed
        private void imgbrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imgbrowseActionPerformed
            ExampleFileFilter filter1 = new ExampleFileFilter();
            JFileChooser chooser = new JFileChooser();
            filter1.addExtension("jpg");
            filter1.addExtension("gif");
            filter1.setDescription("JPG,GIF Images");
            chooser.setFileFilter(filter1);
            int returnVal = chooser.showOpenDialog(this);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                txtimgfile.setText(chooser.getSelectedFile().getAbsolutePath());
                try{
                        displaywindow.setImageURL(new java.net.URL("file:"+txtimgfile.getText()));
                        displaywindow.setStyle(ImageViewer.IMAGE_SCALED_TO_FIT);
                    }catch(Exception e){
                        e.printStackTrace();
        }//GEN-LAST:event_imgbrowseActionPerformed
        private void vidbrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_vidbrowseActionPerformed
           ExampleFileFilter filter2 = new ExampleFileFilter();
           JFileChooser chooser = new JFileChooser();
           filter2.addExtension("avi");
            filter2.addExtension("mpg");
            filter2.setDescription("AVI & MPG Video");
            chooser.setFileFilter(filter2);
            int returnVal = chooser.showOpenDialog(this);
            if(returnVal == JFileChooser.APPROVE_OPTION) {
                txtvidfile.setText(chooser.getSelectedFile().getAbsolutePath());
                VideoAudioPlayer vap=new VideoAudioPlayer(txtvidfile.getText());
        }//GEN-LAST:event_vidbrowseActionPerformed
        /** Exit the Application */
        private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
            setVisible(false);
            dispose();
        }//GEN-LAST:event_exitForm
         * @param args the command line arguments
        /*public static void main(String args[]) {
            new VideoInsert().show();
        // Variables declaration - do not modify//GEN-BEGIN:variables
        private javax.swing.JButton imgbrowse;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JTextField txtvid;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JTextField txtimgcont;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JPanel imgpane;
        private javax.swing.JButton insert;
        private javax.swing.JComboBox VideoTypeComboBox;
        private javax.swing.JButton vidbrowse;
        private javax.swing.JTextField txtvidfile;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JTextField txtimgfile;
        private javax.swing.JTextField txtvidinfo;
        // End of variables declaration//GEN-END:variables
    FrameAccess.java
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.media.util.*;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess implements ControllerListener {
         Processor p;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         public boolean alreadyPrnt = false;
         * Given a media locator, create a processor and use that processor
         * as a player to playback the media.
         * During the processor's Configured state, two "pass-thru" codecs,
         * PreAccessCodec and PostAccessCodec, are set on the video track.
         * These codecs are used to get access to individual video frames
         * of the media.
         * Much of the code is just standard code to present media in JMF.
         public boolean open(MediaLocator ml) {
              try {
                   p = Manager.createProcessor(ml);
                                } catch (Exception e) {
                   System.err.println(
                        "Failed to create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(Processor.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
              // So I can use it as a player.
              p.setContentDescriptor(null);
              // Obtain the track controls.
              TrackControl tc[] = p.getTrackControls();
              if (tc == null) {
                   System.err.println(
                        "Failed to obtain track controls from the processor.");
                   return false;
              // Search for the track control for the video track.
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) videoTrack = tc[i];
                   else     tc[i].setEnabled(false);
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   return false;
              String videoFormat = videoTrack.getFormat().toString();
              Dimension videoSize = parseVideoSize(videoFormat);
              System.err.println("Video format: " + videoFormat);
              // Instantiate and set the frame access codec to the data flow path.
              try {
                   Codec codec[] = { new PostAccessCodec(videoSize)};
                   videoTrack.setCodecChain(codec);
              } catch (UnsupportedPlugInException e) {
                   System.err.println("The process does not support effects.");
              // Realize the processor.
              p.prefetch();
              if (!waitForState(Processor.Prefetched)) {
                   System.err.println("Failed to realise the processor.");
                   return false;
              p.start();
              return true;
         /**parse the size of the video from the string videoformat*/
         public Dimension parseVideoSize(String videoSize){
              int x=300, y=200;
              StringTokenizer strtok = new StringTokenizer(videoSize, ", ");
              strtok.nextToken();
              String size = strtok.nextToken();
              StringTokenizer sizeStrtok = new StringTokenizer(size, "x");
              try{
                   x = Integer.parseInt(sizeStrtok.nextToken());
                   y = Integer.parseInt(sizeStrtok.nextToken());
              } catch (NumberFormatException e){
                   System.out.println("unable to find video size, assuming default of 300x200");
              System.out.println("Image width = " + String.valueOf(x) +"\nImage height = "+ String.valueOf(y));
              return new Dimension(x, y);
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() != state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent
                   || evt instanceof RealizeCompleteEvent
                   || evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   p.close();
                   System.exit(0);
         * Main program
         public static void main(String[] args) {
    //          if (args.length == 0) {
    //               prUsage();
    //               System.exit(0);
    // System.out.print("masoud");
    String url = new String("file:F:\\AVSEQ01.mpg");
              if (url.indexOf(":") < 0) {
                   prUsage();
                   System.exit(0);
              MediaLocator ml;
              if ((ml = new MediaLocator(url)) == null) {
                   System.err.println("Cannot build media locator from: " + url);
                   System.exit(0);
              FrameAccess fa = new FrameAccess();
              if (!fa.open(ml))
                   System.exit(0);
         static void prUsage() {
              System.err.println("Usage: java FrameAccess <url>");
         * Inner class.
         * A pass-through codec to access to individual frames.
         public class PreAccessCodec implements Codec {
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Pre: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              * The code for a pass through codec.
              // We'll advertize as supporting all video formats.
              protected Format supportedIns[] = new Format[] { new VideoFormat(null)};
              // We'll advertize as supporting all video formats.
              protected Format supportedOuts[] = new Format[] { new VideoFormat(null)};
              Format input = null, output = null;
              public String getName() {
                   return "Pre-Access Codec";
              //these dont do anything
              public void open() {}
              public void close() {}
              public void reset() {}
              public Format[] getSupportedInputFormats() {
                   return supportedIns;
              public Format[] getSupportedOutputFormats(Format in) {
                   if (in == null)
                        return supportedOuts;
                   else {
                        // If an input format is given, we use that input format
                        // as the output since we are not modifying the bit stream
                        // at all.
                        Format outs[] = new Format[1];
                        outs[0] = in;
                        return outs;
              public Format setInputFormat(Format format) {
                   input = format;
                   return input;
              public Format setOutputFormat(Format format) {
                   output = format;
                   return output;
              public int process(Buffer in, Buffer out) {
                   // This is the "Callback" to access individual frames.
                   accessFrame(in);
                   // Swap the data between the input & output.
                   Object data = in.getData();
                   in.setData(out.getData());
                   out.setData(data);
                   // Copy the input attributes to the output
                   out.setFlags(Buffer.FLAG_NO_SYNC);
                   out.setFormat(in.getFormat());
                   out.setLength(in.getLength());
                   out.setOffset(in.getOffset());
                   return BUFFER_PROCESSED_OK;
              public Object[] getControls() {
                   return new Object[0];
              public Object getControl(String type) {
                   return null;
         public class PostAccessCodec extends PreAccessCodec {
              // We'll advertize as supporting all video formats.
              public PostAccessCodec(Dimension size) {
                   supportedIns = new Format[] { new RGBFormat()};
                   this.size = size;
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   if (!alreadyPrnt) {
                        BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
                        Image stopImage = stopBuffer.createImage(frame);
                        try {
                             BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                             Graphics og = outImage.getGraphics();
                             og.drawImage(stopImage, 0, 0, size.width, size.height, null);
                             //prepareImage(outImage,rheight,rheight, null);
                             Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
                             ImageWriter writer = (ImageWriter) writers.next();
                             //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
                             File f = new File(frame.getSequenceNumber() + ".jpg");
                             ImageOutputStream ios = ImageIO.createImageOutputStream(f);
                             writer.setOutput(ios);
                             //Finally, the image may be written to the output stream:
                             //BufferedImage bi;
                             //writer.write(imagebi);
                             writer.write(outImage);
                             ios.close();
                        } catch (IOException e) {
                             System.out.println("Error :" + e);
                   //alreadyPrnt = true;
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Post: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              public String getName() {
                   return "Post-Access Codec";
              private Dimension size;

    check out the java.lang.Runtime and java.lang.Process classes

  • How to execute a custom java code from the process

    Hi All,
    I'm writing a process to generate the PDF and it works fine. Now, at the end or in the middle of the process, i would like to execute/write a java code then it will be invoked when the process running. Assume not using web service, is there another way? samples how to write custom code?
    Thanks,

    The Execute Script service allows you to execute java code on a particular step.
    A more robust solution would be to create a custom component for your custom code.
    Jasmin

  • How the db connection is used in the piece of code of jsp

    dear sir,
    i have to important question.
    i am pasting the code of a jsp file below.... please look in to this...
    in this page.. how is he making a database connection... and in this page
    where are the select statements and queries.... i have tried many times reading
    this ..but i could not find the queries ..not even any one.
    if anyone sees this jsp file also ... he will not be able to see the queries.
    can u please help me .. how to do this type of connection and also how to use queries
    like select insert and delete and update .
    an example will help me out...please help me...
    Ramesh
    the file is below....
    <%@ include file="jtfincl.jsp" %>
    <%@ page language="java" %>
    <%@ page import="oracle.apps.ibu.common.IBUContext" %>
    <%@ page import="oracle.apps.ibu.common.IbuException" %>
    <%@ page import="oracle.apps.ibu.common.Employee" %>
    <%@ page import="oracle.apps.ibu.common.EmployeeInfo" %>
    <%@ page import="oracle.jdbc.driver.*" %>
    <%@ page import="oracle.apps.jtf.aom.transaction.*" %>
    <%@ page import="oracle.apps.jtf.base.resources.*" %>
    <%@ page import="oracle.apps.jtf.base.interfaces.MessageManagerInter"%>
    <%@ page import="oracle.apps.ibu.registration.IbuRegistration" %>
    <%@ page import="oracle.apps.ibu.registration.CustomerVO" %>
    <%@ page import="oracle.apps.ibu.common.IDNamePair" %>
    <%@ page import="oracle.apps.ibu.common.*" %>
    <%@ page import="oracle.apps.ibu.registration.*" %>
    <%@ page import="java.math.BigDecimal" %>
    <jsp:useBean id = "_displayManager"
    class = "oracle.apps.ibu.common.DisplayManager"
    scope = "application" />
    <jsp:useBean id = "ibuPromptManager"
    class = "oracle.apps.ibu.common.PromptManager"
    scope = "application" />
    <%
    String appName= "IBU";
    boolean stateless=true;      // used for jtfsrfp.jsp
    SiteProperty.load();
    String username = SiteProperty.getGuestUsername();
    String password = SiteProperty.getGuestPassword();
    %>
    <%@ include file="jtfsrfp.jsp" %>
    <%
         String forwardURL = null;
         String backURL = null;
    String emailAddress = null;     
         long employeeID = -1;
         String submitType = (String) request.getParameter("submitType");
         IBUContext context = new IBUContext(fwSession);
         String errorKey = "";
         String errorMessage = "";
         String errorStack = "";
         boolean currentStatus = true;
    Object lockx = new Object ();
         OracleConnection conn = null;
    try
         TransactionScope.begin(lockx);
    try
    conn = (OracleConnection)
    TransactionScope.getConnection();
         catch ( Exception e )
    throw new FrameworkException("Error getting connection..");
    if ( conn == null )
    throw new FrameworkException("Error getting connection..");
         String[] textMsgs = new String[3];
         MessageManagerInter msgMgr = Architecture.getMessageManagerInstance();
         textMsgs[0] = msgMgr.getMessage("IBU_RG_CONTRACT24");
         //textMsgs[0] = " is not a valid employee email address.";
         textMsgs[1] = msgMgr.getMessage("IBU_RG_CONTRACT25");
         //textMsgs[1] = " Cannot get the employee id.";
         textMsgs[2] = msgMgr.getMessage("IBU_RG_CONTRACT13");
         //textMsgs[2] = "submitType is null, please check program.";
         if ( (submitType != null) && "LOGIN".equals( submitType ) )
         forwardURL="jtflogin.jsp";
         backURL="jtflogin.jsp";
         else if ( (submitType != null) && "EMPLOYEE_CHECK".equals( submitType ) )
         forwardURL="ibuemplcheck.jsp";
         backURL="ibuemplcheck.jsp";
         else if ( (submitType != null) && "EMPLOYEE_NUMBER_SUBMIT".equals( submitType ) )
         backURL="ibuemplcheck.jsp";
    emailAddress = (String) request.getParameter("emailAddress");     
         pageContext.setAttribute("emailAddress", emailAddress , PageContext.REQUEST_SCOPE);
         employeeID = IbuRegistration.getEmployeeID(conn,emailAddress);
         if (employeeID == -1)
              throw new IbuRegException(emailAddress + "  "+textMsgs[0] + "  " +textMsgs[1]);
         //validate employee
    currentStatus = Employee.isValidate(conn,emailAddress);
    //currentStatus = IbuRegistration.isEmployeeValid(conn,emailAddress);
         if (!currentStatus)
              throw new IbuRegException(emailAddress + "  " + textMsgs[0]);
         EmployeeInfo employee = Employee.findEmployee(conn,employeeID);
         pageContext.setAttribute("employee", employee , PageContext.REQUEST_SCOPE);
         pageContext.setAttribute("employeeIDStr", Long.toString(employeeID) , PageContext.REQUEST_SCOPE);
         forwardURL="ibuemplinput.jsp";
         else
         { // Cancel button was pressed
         throw new IbuRegException(textMsgs[2]);
         /* "ibuccsii.jsp"; */
         catch ( IbuException e )
    TransactionScope.setRollbackOnly();
         errorMessage = e.getMessage();      
         errorStack = IbuRegException.getStack(e);
         pageContext.setAttribute("errorMessage", errorMessage , PageContext.REQUEST_SCOPE);
         pageContext.setAttribute("errorStack", errorStack , PageContext.REQUEST_SCOPE);
         forwardURL = backURL;
         catch (IbuRegException e)
    TransactionScope.setRollbackOnly();
         errorMessage = e.getMessage();      
         errorStack = e.getStack();
         pageContext.setAttribute("errorMessage", errorMessage , PageContext.REQUEST_SCOPE);
         pageContext.setAttribute("errorStack", errorStack , PageContext.REQUEST_SCOPE);
         forwardURL = backURL;
         catch ( Exception e )
    TransactionScope.setRollbackOnly();
         errorMessage = e.getMessage();      
         errorStack = IbuRegException.getStack(e);
         pageContext.setAttribute("errorMessage", errorMessage , PageContext.REQUEST_SCOPE);
         pageContext.setAttribute("errorStack", errorStack , PageContext.REQUEST_SCOPE);
         forwardURL = backURL;
    //throw new FrameworkException( e , "IBU_UNEXPECTED_EXCEPTION");
         finally
    TransactionScope.releaseConnection( conn );
    TransactionScope.end ( lockx );
         if (forwardURL == null)
         forwardURL="jtflogin.jsp";
    %>
         <jsp:forward page= "<%= forwardURL %>" />
    <%@ include file="jtferlp.jsp" %>

    Well, if I got you right, you can use RETURNING clause of INSERT statement:
    SQL> create table test(x int primary key, y varchar2(10));
    Table created.
    SQL> create sequence test_seq start with 1 cache 100;
    Sequence created.
    SQL> create trigger test_insert_br before insert on test for each row
      2  declare
      3    l_x int;
      4  begin
      5    select test_seq.nextval into l_x from dual;
      6    :new.x := l_x;
      7  end;
      8  /
    Trigger created.
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    l_new_x int;
      3  begin
      4    insert into test(y) values('One')
      5    returning x into l_new_x;
      6    dbms_output.put_line(l_new_x);
      7    insert into test(y) values('Two')
      8    returning x into l_new_x;
      9    dbms_output.put_line(l_new_x);
    10  end;
    11  /
    1
    2
    PL/SQL procedure successfully completed.

  • How to keep and read files on the client side?

    There's a web page with a certain X3D model, and there are several inputs on the same page. When a user submits the form, the servlet changes the model and returns a page based on the input values. The problem is that the part of this model is a human body (which is pretty tough for downloading). What I'm trying to find out is if there's some way to store that model on the local computer and then access it from the servlet without regetting it from the server. Thanks.

    With JSP you can't run java code on the client. All of it runs on the server.
    To run java on the client, you use an Applet.
    Alternatively you go the pure html/javascript way, and write javascript includes for code.
    Or you use something like AJAX, to submit the form, and receive back only "changes" to the model.
    Not sure if that helps at all.
    Good luck,
    evnafets

Maybe you are looking for