Server performance with beans in WEB-INF/classes

Hi,
Someone over at oracle corp told me that if i put my beans in WEB-INF/classes, my server would notice a significant performance degradation since the beans would be automatically refreshed or dynamically loaded everytime.
WHat I am doing now is restarting the webserver everytime a bean is created or changed.
My goal was to have the new beans automatically noticed by the web server so i didnt have to stop and restart.
Anyone have any input for me.
Thanks

Thanks I will do that but just one question.
What about when the site it live. Say the boss comes to me and says I need this changed.
I change the bean, compile it, and MUST restart the web server even though there could be many people on the site. Is that what everyone is doing?
I think I am a little confused because in a production system I dont feel that the web server should ever be stopped unless there is some type of failure.

Similar Messages

  • LinkageError on integratedWLS with prefer-web-inf-classes

    Hello.
    I'm currently messing with some reporting tool (BIRT) for weblogic. There's a web application example which should be deployed on application server for demonstration.
    I have no problems deploying it on standalone WebLogic on linux server (jrockit), but I can't run it on my local integratedWLS (hotspot) - there is LinkageError.
    Stalking through Interment, I found out that this thing has an issue with WebLogic. The application uses a lot of libraries and some of them are included in WebLogic but with lower versions, so there is jar collisions.
    To solve this issue there is weblogic.xml with:
    <container-descriptor>
      <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    As I said, with this file I can deploy the application on standalone WLS and it works normally but deploying on integratedWLS fails with LinkageError.
    If I remove weblogic.xml, deployment doesn't fail, but the application throws exceptions on runtime because of wrong jar versions (that is understandable).
    Why can't I run the application on integratedWLS with prefer-web-inf-classes?
    Thanks.
    JDev 11.1.2.3, WLS 10.3.5
    LinkageError:
    [05:51:50 PM] Redeploying Application...
    <21.10.2013 17:51:52 GST> <Warning> <HTTP> <BEA-101162> <User defined listener org.eclipse.birt.report.listener.ViewerServletContextListener failed: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.ElementImpl.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/xerces/dom/ElementImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Element have different Class objects for the type org/w3c/dom/TypeInfo used in the signature.
    java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.ElementImpl.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/xerces/dom/ElementImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Element have different Class objects for the type org/w3c/dom/TypeInfo used in the signature
      at org.apache.xerces.dom.DeferredDocumentImpl.getNodeObject(Unknown Source)
      at org.apache.xerces.dom.DeferredDocumentImpl.synchronizeChildren(Unknown Source)
      at org.apache.xerces.dom.CoreDocumentImpl.getDocumentElement(Unknown Source)
      at org.eclipse.birt.core.framework.jar.BundleLoader.loadExtensions(BundleLoader.java:151)
      at org.eclipse.birt.core.framework.jar.BundleLoader.load(BundleLoader.java:63)
      Truncated. see log file for complete stacktrace
    >
    <21.10.2013 17:51:52 GST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1382363510965' for task '7'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      Truncated. see log file for complete stacktrace
    Caused By: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.ElementImpl.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/xerces/dom/ElementImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Element have different Class objects for the type org/w3c/dom/TypeInfo used in the signature
      at org.apache.xerces.dom.DeferredDocumentImpl.getNodeObject(Unknown Source)
      at org.apache.xerces.dom.DeferredDocumentImpl.synchronizeChildren(Unknown Source)
      at org.apache.xerces.dom.CoreDocumentImpl.getDocumentElement(Unknown Source)
      at org.eclipse.birt.core.framework.jar.BundleLoader.loadExtensions(BundleLoader.java:151)
      at org.eclipse.birt.core.framework.jar.BundleLoader.load(BundleLoader.java:63)
      Truncated. see log file for complete stacktrace
    >
    <21.10.2013 17:51:52 GST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'WebViewerWeblogic'.>
    <21.10.2013 17:51:52 GST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'WebViewerWeblogic'.>
    <21.10.2013 17:51:52 GST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException:
      at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
      at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
      at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
      at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
      Truncated. see log file for complete stacktrace
    Caused By: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.ElementImpl.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/apache/xerces/dom/ElementImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Element have different Class objects for the type org/w3c/dom/TypeInfo used in the signature
      at org.apache.xerces.dom.DeferredDocumentImpl.getNodeObject(Unknown Source)
      at org.apache.xerces.dom.DeferredDocumentImpl.synchronizeChildren(Unknown Source)
      at org.apache.xerces.dom.CoreDocumentImpl.getDocumentElement(Unknown Source)
      at org.eclipse.birt.core.framework.jar.BundleLoader.loadExtensions(BundleLoader.java:151)
      at org.eclipse.birt.core.framework.jar.BundleLoader.load(BundleLoader.java:63)
      Truncated. see log file for complete stacktrace
    >
    [05:51:52 PM] Deployment cancelled.
    [05:51:52 PM] ----  Deployment incomplete  ----.
    [05:51:52 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
    #### Cannot run application WebViewerWeblogic due to error deploying to IntegratedWebLogicServer.

    User defined listener org.eclipse.birt.report.listener.ViewerServletContextListener failed: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.ElementImpl.getSchemaTypeInfo()Lorg/w3c/dom/TypeInfo
    Bug
    User defined listener org.eclipse.birt.report.listener.ViewerServletContextListener failed: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xerces.dom.ElementImpl.getSchemaType
    Info()Lorg/w3c/dom/TypeInfo
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=383926

  • Error while accessing a war with xmlbeans under WEB-INF/lib

    Hi All,
    I am trying to deploy a WAR file with XMLBean generated jar under WEB-INF/lib folder along with other jars.
    I am getting following error
    java.lang.NoClassDefFoundError: com/xx/DataServiceRequestDocument
         at java.lang.Class.getDeclaredFields0(Native Method)
         at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
         at java.lang.Class.getDeclaredField(Class.java:1880)
         at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1610)
         at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
         at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:425)
         at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
         at java.io.ObjectStreamClass.lookup0(ObjectStreamClass.java:310)
         at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java)
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
         at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2216)
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2347)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2290)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.coherence.component.net.extend.Channel.deserialize(Channel.CDB:15)
         at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3306)
         at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2603)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.readExternal(InvocationServiceFactory.CDB:5)
         at com.tangosol.coherence.component.net.extend.Codec.decode(Codec.CDB:29)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.decodeMessage(Peer.CDB:25)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:54)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    I tried multiple combinations like changing, but no success.
    <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.2</wls:weblogic-version>
    <wls:context-root>CoherenceWS</wls:context-root>
    <wls:container-descriptor>
    <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
    </wls:container-descriptor>
    </wls:weblogic-web-app>
    I have very few classes in WEB-INF/class (trying to load java objects from lib)
    My WEB-INF/lib folder contains following jar
    coherence.jar
    commons-beanutils-1.8.0.jar
    commons-collections-3.2.jar
    commons-lang-2.4.jar
    commons-logging-1.1.1.jar
    dsRemoteCall.jar
    ezmorph-1.0.jar
    jackson-all-1.8.5.jar
    json-lib-2.1-jdk13.jar
    org.springframework.asm-3.1.0.M2.jar
    org.springframework.beans-3.1.0.M2.jar
    org.springframework.context-3.1.0.M2.jar
    org.springframework.core-3.1.0.M2.jar
    org.springframework.expression-3.1.0.M2.jar
    org.springframework.oxm-3.1.0.M2.jar
    org.springframework.web-3.1.0.M2.jar
    org.springframework.web.servlet-3.1.0.M2.jar
    schemaclasses.jar
    xbean.jar
    xom-1.2.7.jar
    Am I missing something? Any help is greatly appreciated
    Thanks
    sunder
    Edited by: 868704 on Sep 6, 2011 6:10 PM

    Note : schemaclasses.jar contains "com/xx/DataServiceRequestDocument" class file.
    WebLogic Server 10.3.5.0
    Thanks
    sunder
    Edited by: 868704 on Sep 6, 2011 6:26 PM

  • WorkShop 3.2.0 - WEB-INF/classes not included in war file

    I've created the "Faces Example" project in Workshop Studio 3.2.0 and it's running fine. However, when I export the war file to run it on another server the class files located at "WEB-INF/classes" are not included with the war.
    Any suggestions on what I may be doing wrong would be greatly appreciated.
    thks!

    Unfortunately no, the issue with output folder being ignored occurs only with example apps bundled with Workshop product.
    You can try the following workaround:
    - In Workshop, Project > Properties - Java Build Path, switch to Source tab - "Remove the source folder listing" - Click OK and dismiss Properties window.
    - Project > Properties - Java Build Path > Source Tab, add the same source folder entry - Click OK
    - Export as WAR
    With this you should see the class files bundled under output directory structure (Ex: WEB-INF/classes).

  • Accessing classes in web-inf/classes within JSP

    hi,
    i know this is probably a very basic question..or nobody would ever do something like this..but I'mn curious:
    i have a class Car.class in the WEB-INF/classes directory and I want to access it from withing JSP : <% Car c = new Car(); %>
    the problem is that the server tries to load the class from the package : org.apache.jsp.Car ! when putting car into an own package like my.Car then it works.. but how do i get it working without putting it into a separate package?!
    thx

    You could try packaging it in a jar, and placing the jar in WEB-INF/lib... I have no idea if that will help, but when you're debugging, you have to be willing to try anything.. :)

  • Classes are not loading from WEB-INF/classes directory

    Hi All,
    I am in a deep troble because the class files in the WEB-INF/classes directory are not loading.
    I have deployed the application in Tomcat 6 server. And stored all class files under WEB-INF/classes dirctory. But when I execute a JSP page, I am getting following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    JSP FileName:/hello.jsp
    An error occurred at line: 1 in the jsp file: /hello.jsp
    com.flt.Test cannot be resolved to a type
    1: <%=new com.flt.Test().hello()%>
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:98)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)The classes are available in the WEB-INF/classes directory and the folder name and package name of the classes are correct. I have also tried to execute the application by creating a jar file and put it in the WEB-INF/lib directory. But I am getting same result.
    Is it the problem with Tomcat configuration? When I gone through Tomcat documentation, I get to know that the WebAppX class loader in Tomcat, loads application specific classes for a web application. Is it possible to start/stop WebAppx classloader manually?
    Please help me to solve this issue.
    Many Thanks,
    Francis Lukose
    Edited by: francis_ on May 13, 2008 10:03 AM

    Thanks for your reply, Soultech2012.
    <%=new com.flt.Test().hello()%>is the only code in the JSP page. Just a single line. Nothing more than that.
    The code in Test.java is as follows:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package com.flt;
    * @author Francis Lukose
    public class Test {
        public static String hello()    {
            return "hello";
    }Many Thanks,
    Francis
    Edited by: francis_ on May 13, 2008 6:45 PM

  • Locating the contents of WEB-INF/classes

    Hi,
    We have a web-app deployed as a WAR file (unexploded) and we want to be able to the contents of WEB-INF/classes (ie properties). However when I try and access these files via a web browser, I receive a 404. I tried putting a simple HTML page in there which also gave a 404. I also tried the same method with a simple dummy WAR and was able to retrieve the HTML opage in WEB-INF/classes.
    Is there some setting which allows the contents of WEB-INF/classes to be read, or not to be read?
    The java version is J2SDK 1.4.2-05, and the app server is JRun 4 updater 4.
    Thanks,
    Jon Daniels

    No - fundamentally what we are aiming for is to have the unexploded WAR app read properties (i.e. log4j.properties, etc) from the WEB-INF/classes folder. To simulate this I attempted to access properties via a web browser; however I'm not sure that's the best way to test, so to rephrase: the problem is that my WAR-file based web-app is not loading properties files from the WEB-INF/lib classes directory.

  • Tomcat 4.1.18 .................. WEB-INF\classes problem

    I am using Tomcat 4.1.18 and working on JSPs. I have written a JSP that calls a Bean located in WEB-INF\classes. When I make a POST call to the JSP I get the following error
    ===========
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 1 in the jsp file: /techsupport.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\jakarta-tomcat-4.1.18\work\Standalone\localhost\techsupport\techsupport_jsp.java:42: cannot resolve symbol
    symbol : class TechSupportBean
    location: class org.apache.jsp.techsupport_jsp
    TechSupportBean techSupportBean = null;
    ^
    An error occurred at line: 1 in the jsp file: /techsupport.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.1.18\work\Standalone\localhost\techsupport\techsupport_jsp.java:44: cannot resolve symbol
    symbol : class TechSupportBean
    location: class org.apache.jsp.techsupport_jsp
    techSupportBean = (TechSupportBean) pageContext.getAttribute("techSupportBean", PageContext.SESSION_SCOPE);
    ^
    An error occurred at line: 1 in the jsp file: /techsupport.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.1.18\work\Standalone\localhost\techsupport\techsupport_jsp.java:47: cannot resolve symbol
    symbol : class TechSupportBean
    location: class org.apache.jsp.techsupport_jsp
    techSupportBean = (TechSupportBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "TechSupportBean");
    ^
    3 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:484)
    ========
    The server.xml has the following context.
         <Context path="/techsupport" docBase="techsupport" debug="0"
    reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_techsupport_log." suffix=".txt"
         timestamp="true"/>     
         </Context>
    ==============
    Can somebody tell me where I went wrong? I think some configuration is missing especially CLASSPATH but am using the default CLASSPATH and the
    webapps/examples is working fine.
    My program is located at webapps/techsupport folder.
    Thanks.
    Amitabh.
    [email protected]

    in the techsupport.jsp
    try adding this
    <%@ page import="TechSupportBean"%>

  • Copying files from same directory as *.java files and moving to WEB-INF/classes/ package name

    In our current application we have the following source directory structure:
              src -
              - com
              - edeploy
              - subdirs ... (many directories here)
              - jsp
              -subdirs ... (many directories here)
              In com.edeploy.subdirs, there exists *.java files, and *.gxq files (query
              files). I would like to modify my build.cmd script to copy the *.gxq files
              into the same directory as the class files.
              Here's my script so far:
              @REM Create list of files to compile
              DIR /S /B /A:-D src\com\*.java >class.list
              @REM Create list of query files
              DIR /S /B /A:-D src\com\*.gxq >query.list
              @REM Compile
              javac -d stage\WEB-INF\classes @class.list
              @REM Copy query files into class directory
              .......... code needed here ......
              Can anyone help me with this?
              Thanks,
              Matt
              

    You may want to check out:
              http://jakarta.apache.org/ant/index.html
              Gary
              "Matt Raible" <[email protected]> wrote in message
              news:[email protected]..
              > In our current application we have the following source directory
              structure:
              >
              > src -
              > - com
              > - edeploy
              > - subdirs ... (many directories here)
              > - jsp
              > -subdirs ... (many directories here)
              >
              >
              > In com.edeploy.subdirs, there exists *.java files, and *.gxq files (query
              > files). I would like to modify my build.cmd script to copy the *.gxq
              files
              > into the same directory as the class files.
              >
              > Here's my script so far:
              >
              > @REM Create list of files to compile
              > DIR /S /B /A:-D src\com\*.java >class.list
              >
              > @REM Create list of query files
              > DIR /S /B /A:-D src\com\*.gxq >query.list
              >
              > @REM Compile
              > javac -d stage\WEB-INF\classes @class.list
              >
              > @REM Copy query files into class directory
              > .......... code needed here ......
              >
              > Can anyone help me with this?
              >
              > Thanks,
              >
              > Matt
              >
              >
              

  • prefer-web-inf-classes in weblogic.xml doesn't work

    When I try to use <prefer-web-inf-classes>true</prefer-web-inf-classes> it works fine with default classloaders structure. But after I changed classloaders hierarhy by means of <classloader-structure> in weblogic-application.xml classes from web app are ignored and classes from outside web app are loaded.
    Here is classloaders structure I use
    <weblogic-application>
    <classloader-structure>
    <module-ref>
    <module-uri>mywar.war</module-uri>
    </module-ref>
    <classloader-structure>
    <module-ref>
    <module-uri>myejb.jar</module-uri>
    </module-ref>
    </classloader-structure>
    </classloader-structure>
    </weblogic-application>
    Has anybody encountered this before?

    Hi, Rob
    Does it work in WL9.2?
    It seems I do it exactly as the explained at http://edocs.bea.com/wls/docs81/programming/classloading.html - and it fails :o(.
    I try to run my app.ear with WL9.2 There are 2 components in it: webapp and mdb. The webapp/WEB-INF contains weblogic.xml:
    <weblogic-web-app>
    <container-descriptor>     
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    </weblogic-web-app>
    Mdb is expected to run in the same mode, i.e. to prefer the webapp/WEB-INF/*.jar over the parent Weblogic classloader. To do so I add the weblogic-application.xml to the app.ear!/META-INF:
    <weblogic-application>
    <classloader-structure>
    <module-ref>
    <!-- reminder: this webapp contains
    prefer-web-inf-classes -->
    <module-uri>webapp</module-uri>
    </module-ref>
    <classloader-structure>
    <module-ref>
    <module-uri>mdb.jar</module-uri>
    </module-ref>
    </classloader-structure>
    </classloader-structure>
    </weblogic-application>
    Now, when classloader-structure specified, both webabb and mdb prefer the weblogic root loader as if prefer-web-inf-classes not defined at all.

  • Class not found in web-inf/classes folder of war file within ear file

    Hi all,
              I am using Weblogic 8.1 sp4. I have a war file within an ear file. I am trying to deploy the war file with a few classes within its web-inf/classes folder, however when the classes are in that folder I consistently get a class not found exception when trying to instantiate them. If I package the classes in a jar file and then put that jar file within the web-inf/lib folder of the war, the classes are also not found.
              If I put these two classes in the app-inf/classes folder of the ear file, everything works as expected and the classes are found.
              Any ideas of why this is happening. This seems to be a very simple thing that should work, but appears to not be working at all.
              thanks in advance for any suggestions or ideas.

    Hi,
              This is a known limitation/issue with WL. There is also no way around this.
              Regards,
              LG

  • WEB-INF/classes not searched?

    I am developing an Struts application.
    During development I just want to have my Actions and all other files in the projects package strukture, so I compile the classes to the WEB-INF/classes directory and ends up with a structure like
    WEB-INF/classes/dk.acompagny.anapplication.viewcontroller.MyAction.class.
    I find the compiled class in the directory structure but OC4J does not find it. Instead I get a runtime error like:
    SEVERE: No action instance for path /login could be created
    oracle.classloader.util.AnnotatedClassNotFoundException:
         Missing class: dk.bladkompagniet.plus100.viewcontroler.LoginAction
         Dependent class: org.apache.struts.util.RequestUtils
         Loader: current-workspace-app.web.Bladkompagniet-Plus100-webapp:0.0.0
         Code-Source: /home/fgjensen/Work/Src/Bladkompagniet/Plus100/public_html/WEB-INF/lib/struts.jar
         Configuration: WEB-INF/lib/ directory in /home/fgjensen/Work/Src/Bladkompagniet/Plus100/public_html/WEB-INF/lib
    This load was initiated at current-workspace-app.web.Bladkompagniet-Plus100-webapp:0.0.0 using the loadClass() method.
    JDev lists the path it searches an the WEB-INF/classes directory is not listed. However, it finds my jsp pages and the default behavior of OC4J should be to search the WEB-INF/classes path.
    Am I missing some configuration set?
    Regards Flemming

    Forget it, I found the error: I have to learn to spell!

  • JARs in WEB-INF/classes on the classpath? [NEWBIE]

    Hello,
    I am under the impression that any files (including JARs and all within
    them) are on the classpath if they are in the folder WEB-INF/classes.
    I have a WAR file that contains a JAR file that in the WEB-INF/classes
    folder. The JAR file contains a class under the package structure
    "mvc.users.Members". I know its there as I checked the WAR file structure
    before deploying.
    In the WAR file I have a Struts RegisterAction class in the package/folder
    "mvc.registration.RegisterAction" which has the following code to create a
    Member object:
    Member member = new Member();The Member class is imported into RegisterAction using
    import mvc.users.Members;and JBuilder appears to recognise Members as on the classpath and compiles
    with no errors.
    My problem is after I have deployed the WAR file, submitting a form to the
    RegisterAction gets the error below:
    javax.servlet.ServletException: Servlet execution threw an exception:
    root cause:
        java.lang.NoClassDefFoundError: mvc/users/Member
            mvc.registration.RegisterAction.execute(RegisterAction.java:22)
            org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
            org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
            org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
            org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:856)If the class "mvc.users.Member" is in the JAR file in the WEB-INF/classes
    folder and the "mvc.registration.RegisterAction" class in the WAR file
    does (according to JBuilder) see the "mvc.users.Member" class on the
    classpath and compiles... why then do I get this error?
    Thanks for your help.
    A Desperate Newbie,
    Mark

    I answered this in the JSP forum - you need to put JAR files in WEB-INF/lib.

  • How can I copy XML into WEB-INF/classes during webapp build in Workshop?

    I am having difficulty performing what seems to be a simple task. I would like to move some XML configuration files from WEB-INF/src to WEB-INF/classes as part of the Workshop build. Unfortuantely, the class com.bea...WebAppBuildTask called from Ant only seems to know how to compile Java into the directory and to copy *.properties files. I am unable to find Javadoc on the class to see if there are configuration options. In addition, the actual location to which classes are compiled seems to be abstracted from me.
    Any help would be appreciated.
    Thanks,
    Scott

    Create a custom build file for the project and add a ant tasks to move
    the files. The ant tasks would look something like this:
    <!-- copy all property and xml config files to root -->
    <copy todir="${dest.path}" overwrite="true" flatten="true">
    <fileset dir="${src.path}">
    <exclude name="**/*build*.xml"/>
    <exclude name="**/*ant*.xml"/>
    <include name="**/*.properties"/>
    <include name="**/*.xml"/>
    </fileset>
    </copy>
    HTH
    Tom
    Few other options include...
    Place the properties file in a java project, instead of a web-project :(
    Load them as resources relative to WEB-INF :(
    Add a dummy project, tell the dummy project to use your own ant file
    that does the moving. Order your projects to do this dummy project
    before the web project :(
    Best regards...
    I am having difficulty performing what seems to be a
    simple task. I would like to move some XML
    configuration files from WEB-INF/src to
    WEB-INF/classes as part of the Workshop build.
    Unfortuantely, the class com.bea...WebAppBuildTask
    k called from Ant only seems to know how to compile
    Java into the directory and to copy *.properties
    files. I am unable to find Javadoc on the class to
    see if there are configuration options. In addition,
    the actual location to which classes are compiled
    seems to be abstracted from me.
    Any help would be appreciated.
    Thanks,
    Scott
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

  • Prefer-web-inf-classes Problem

    Hi ,
    I have an web application war file which has some jsp's and jar files in the lib
    directory of the war file .
    Also one of the jar files which is of different version is present in the classpath
    of WLS .
    My prb is that the my web application does not deploy . When the jsp's compile
    it uses the jar file (this is if different version from jar file in the application)which
    is set in the WLS Classpath rather than the jar file in the war file . I have
    set <prefer-web-inf-classes> as true in the web application xml . Also any of
    the classes in the jar file does not starts with java. , weblogic. , javax. .
    I think at the time of jsp compilation the jar files in lib are never loaded though
    preferwebinfclasses is true ... so does this mean that preferwebinfclasses come
    into picture only after deployment of application ?
    Can any body help me on this ..
    Regds
    Kishore

    Do you know what the patch number is? I just downloaded 10.3 and came across the same error...so I don't think it has been put in 10.3 just yet.
    Thanks
    - Doug

Maybe you are looking for