Initialize a web service when Tomcat startup

Hi,
I have a web service, built using Axis 2 1.2, that will do all the initialization at the first service call (e.g. create new database tables, create JAXB objects, etc), but it's taking too much time to do those tasks (at least twice slower than a normal service call with everything ready).
i was wondering if i can do the initialization at Tomcat startup, instead of doing it at the first service call, so that the first service call could always get the highest possible performance..
Thanks..

problem resolved... i've created a servlet class to initialize everything, and i have modified web.xml to call this servlet class when tomcat startup.

Similar Messages

  • Deploy Web Service on Tomcat

    Good day.
    I have some troubles with deploying web service on Tomcat 6.
    I've created simple WebService with name GetDateService and want to deploy it into Tomcat 6.0
    My Steps
    1. From my local machine in browser i try "http://tomcathost:8080"
    i see start page and that means that ports open and TOMCAT run (after i log into manager - it works)
    2. In JDeveloper in "Web-INF\WSDL" i change GetDateService.wsdl -> replace adress from
    http://localhost:8888/JaveWebService2-GetDateExWS-context-root/GetDateServiceSoapHttpPort
    to
    http://TOMCAT:8080/JaveWebService2-GetDateExWS-context-root/GetDateServiceSoapHttpPort
    3. Rebuild WebService and check changes in "Application Source" -> GetDateService -> WSDL
    4. I can't understand why the WAR file name is WEBServices.war (not GetDateService.WAR)
    5. Put WAR file into \\TOMCAT\webAPP and see that TOMCAT auto deploy it
    6. In Tomcat manager i see new application without "DisplayName" with running status "False"
    7. When i try to Start it in Manager i see "FAIL - Application at context path /WebServices could not be started"
    WHAT wrong? What should i do to start webService?
    Thanks
    Edited by: August_ on Jul 10, 2009 6:58 AM

    Can you have a look at the following post from Gerard and see if this works for you: [Deploying JAX-WS RI to Tom Cat|http://kingsfleet.blogspot.com/2009/01/deploying-jax-ws-ri-to-tom-cat.html]
    -Vishal

  • An error occurred while trying to connect to a Web service, when InfoPath web enabled form loads.

    Hi Everyone,
    I am getting an error message: An error occurred while trying to connect to a web service, when my InfoPath form tries to load.  The last few days, it only spits this error message in the morning and around 12pm-1pm it resolves itself and the form loads
    fine the rest of the day, oddly enough. 
    A few things about my form:
    1). It is web enabled
    2). The form submits to a form library on the SP server
    3). I use the UserProfileService data connection in the form to auto-populate a few fields
    4). I use a udcx file with correct language stored in the root of the site collection in the data connection library
    5). The form has been working fine until a few days ago
    I noticed while in Central Administration, that the User Profile Service Synchronization is Stopped.  Not sure if this is causing some or all of the problem. If I need to start it I will need to contact my farm administrator to do this, since I do not
    have the service account information.
    Also, I looked thru the log files on the SharePoint server and found the following by searching for the Correlation ID shown when the error comes up, I won't put in everything just the important messages.
    Schema file was already loaded: BuiltInActiveXControls.xsd
    FormServer Partial Trust - Proxy operation invoked in the SHIM process.
    FormServer Partial Trust - Invoking proxy operation for Web service adapter failed with exception Operation is not valid due to the current state of the object. for Url=https://<SP URL>/_vti_bin/UserProfileService.asmx
    Data adapter failed during OnLoad: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator.
    The following query failed: GetUserProfileByName (User: , Form Name: Expense Report, IP: , Connection Target: <SP URL>/Data Connections/GetUserProfileByName.udcx, Request: , Form ID: urn:schemas-microsoft-com:office:infopath:Expense-Report:-myXSD-2014-04-11T21-06-32
    Type: DataAdapterException, Exception Message: The custom code in the form cannot be run. This functionality may be deactivated on the server.

    Hi B.,
    You are on the right track. I recommend that you first get the User Profile Synchronization Service started because that itself could be the root cause of the issue.
    If that doesn't fix it then focus your attention on the GetUserprofileByName data connection. I always use my secure store ID for this connection. I add the ID by editing the udcx file and then publishing it again.
    Hope this helps.
    Daniel Christian (MCTS)

  • Deploy JDeveloper 10g Web Services to Tomcat

    We are currently running our web services in Tomcat (using Apache Axis). Is it/will it be possible to deploy web services to Tomcat from JDeveloper 10g?
    Thanks,
    Jasmin

    JDeveloper will only directly support deployment of web services to an Apache 2.2 Web Server.

  • Is it possible to deploy Web Services to Tomcat?

    Good day,
    Can anybody tell me or it is possible to deploy Web Services to Tomcat 5.5.x ? It is possble for ADF, so I was wondering or it is possble for Web Services.
    I tried to deploy it with the following libraries:
    J2EE (excluding the servlet.jar using the filter, while this package is already present in Tomcat)
    Oracle SOAP
    Struts Runtime
    JSP Runtime
    and manually added as library:
    wsserver.jar
    wsdl.jar
    WebServicesHtmlXmlWizard.jar
    The situation at this moment is that after deployment, and execution by the a http browser the http request screens shows up as expected (I have been used Embedded stubs), but after sending I get a:
    28-Sep-2005 11:03:36 org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet MyWebService1 threw exception
    java.lang.NoClassDefFoundError: oracle/aurora/ncomp/java/ClassNotFound
         at oracle.j2ee.ws.StatelessJavaRpcWebService.getGenerator(StatelessJavaRpcWebService.java:28)
         at oracle.j2ee.ws.RpcWebService.generateWrapperClass(RpcWebService.java:461)
         at oracle.j2ee.ws.RpcWebService.generate(RpcWebService.java:414)
         at oracle.j2ee.ws.RpcWebService.getWrapper(RpcWebService.java:532)
         at oracle.j2ee.ws.RpcWebService.doGetRequest(RpcWebService.java:631)
         at oracle.j2ee.ws.BaseWebService.doGet(BaseWebService.java:1173)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Any sugestions? Or is there a different behaviour between Oracle en Tomcat version caused by modifications from the apache source.
    I should appreciate it to get some more details about this issue.

    JDeveloper will only directly support deployment of web services to an Apache 2.2 Web Server.

  • What are the steps to Migrate a Web Service from Tomcat to JBoss

    Hi,
    I am totally new to JBoss and need some help. I mostly worked on BEA and Oracle. I have a web service deployed on Tomcat that needs to be now migrated to JBoss. What are the steps in moving a web service from Tomcat to JBoss.
    Is there some step by step tutorial on developing and deploying a web service on JBoss along with sample build script.
    Any help is really appreciated.
    Thanks

    R u using axis. If you want to stick with axis and don't want to use JBossWS there is nothing else you need to do. Move all the axis to Jboss. If you plan to reimplement all ur services in JBossWS here it is:
    http://jbws.dyndns.org/mediawiki/index.php?title=Quick_Start
    http://jbws.dyndns.org/mediawiki/index.php?title=User_Guide
    Let me know if you need anything else.

  • How to deploy business objects web services on tomcat

    Hi everyone can anyone tell how i need to deploy business objects web services on tomcat, i installed business objects on unix server.what r the steps i need to follow in order to deploy web services on business objects. this web services must be called by a java program externally, that the reason i am deploying web services.
    i downloaded business objects web services portal sample zip file. the wssdkj2eeportal directory is created with ant_scripts,src, dsws.config and wsportalassemblyscripts.bat.
    i am trying to configure the dsws.config, by modifying it to
    <configuration version="1.0">
       <WebService Name="BusinessObjects Enterprise XI 3.1 sp3" Icon="image/java.gif">
          XI 3.1 Web Services
          <Connection URL="http://169.111.33.61:8080/dswsbobje/services/session" Proxy="0" Timeout="120000" />
       </WebService>
       <Proxy Name="Outside" URL="http://http-cache.mycompany.com:3667" />
    </configuration>
    what i need to do in order to deploy
    i am using bo xi 3.1 sp3

    Hi,
    You deploy all the web applications provided by BOE with the use of Wdeploy tool installed with BOE installation, for details please reffer the following document
    [BusinessObjects Enterprise XI 3.1 Web Application Deployment Guide for UNIX*|http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000715844%26_SCENARIO=01100035870000000202]
    Regards,
    Ramu.
    Edited by: Gowda Timma Ramu on Nov 9, 2010 8:39 PM

  • Run servlet automatically when tomcat startup

    Dear all
    I need help to run servlet automatically when tomcat startup without starting even the application containing the servlet
    thanks in advance

    lol
    i've the same problem with my car,I want it to go ahead but without starting the engine and using all this gasoline...
    Seriously... the servlet IS almost your application
    when you start the server, the application starts to
    check the init() method of the servlet Interface
    and the "load-on-startup" parameter of the servlet in the deployment descriptor

  • Problems deploying a Web Service to Tomcat 5.5

    I am creating a J2EE 1.4 WebService using JDeveloper 10.1.3. Everything works fine while testing in the embedded OC4J server. When deploy the WAR file to Tomcat 5.5 everything goes haywire.
    I get the following error message:
    ===============================
    java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionU
    ils.java:929)
    at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.ja
    a:578)
    at org.apache.tomcat.util.digester.Rule.end(Rule.java:228)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:10
    7)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingP
    rser.java:1310)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidat
    ngParser.java:328)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidating
    arser.java:295)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(Conte
    tConfig.java:351)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1
    34)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConf
    g.java:260)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
    eSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:
    119)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBas
    .java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:7
    9)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:69
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:47
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1190)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.jav
    :292)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
    eSupport.java:119)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBa
    e.java:1305)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
    rocessChildren(ContainerBase.java:1569)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
    rocessChildren(ContainerBase.java:1578)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
    un(ContainerBase.java:1558)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> TestWSSoap
    ttpPort in servlet mapping
    at org.apache.catalina.core.StandardContext.addServletMapping(StandardC
    ntext.java:2292)
    at org.apache.catalina.core.StandardContext.addServletMapping(StandardC
    ntext.java:2268)
    ... 31 more
    May 24, 2006 7:12:05 PM org.apache.catalina.startup.ContextConfig applicationWe
    Config
    SEVERE: Parse error in application web.xml file at jndi:/localhost/TestWebServi
    e/WEB-INF/web.xml
    java.lang.IllegalArgumentException: Invalid <url-pattern> TestWSSoapHttpPort in
    servlet mapping
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester
    java:2725)
    at org.apache.tomcat.util.digester.Digester.createSAXException(Digester
    java:2751)
    at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:10
    0)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingP
    rser.java:1310)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidat
    ngParser.java:328)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidating
    arser.java:295)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
    at org.apache.catalina.startup.ContextConfig.applicationWebConfig(Conte
    tConfig.java:351)
    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1
    34)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConf
    g.java:260)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
    eSupport.java:119)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:
    119)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBas
    .java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:7
    9)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:69
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:47
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1190)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.jav
    :292)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
    eSupport.java:119)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBa
    e.java:1305)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
    rocessChildren(ContainerBase.java:1569)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
    rocessChildren(ContainerBase.java:1578)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
    un(ContainerBase.java:1558)
    at java.lang.Thread.run(Thread.java:595)
    May 24, 2006 7:12:05 PM org.apache.catalina.startup.ContextConfig applicationWe
    Config
    SEVERE: Occurred at line 14 column 23
    May 24, 2006 7:12:05 PM org.apache.catalina.startup.ContextConfig start
    SEVERE: Marking this application unavailable due to previous error(s)
    May 24, 2006 7:12:05 PM org.apache.catalina.core.StandardContext start
    SEVERE: Error getConfigured
    May 24, 2006 7:12:05 PM org.apache.catalina.core.StandardContext start
    SEVERE: Context [TestWebService] startup failed due to previous errors
    Please help.
    Thanks,
    Madhav

    Hi,
    This question came up recently on the JDeleloper forum too
    see web service deployed to outside of JDeveloper
    rgds
    Susan

  • Deploying a web service to tomcat

    Hello
    I've had a problem deploying a web app that includes a web service. The application runs with no problems on the development computer using netbean6's built in tomcat 6 but when I drop the war file on to the test server the following catalina error occurs
    INFO: Deploying web application archive Temdox.war
    +[GC 20492K->3737K(63424K), 0.0010350 secs]+
    +[GC 20761K->4377K(63424K), 0.0012390 secs]+
    +01-Jul-2008 11:11:04 org.apache.catalina.core.StandardContext addApplicationListener+
    INFO: The listener "com.sun.xml.ws.transport.http.servlet.WSServletContextListener" is already configured for this context. The duplicate definition has been ignored.
    +01-Jul-2008 11:11:04 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized+
    INFO: WSSERVLET12: JAX-WS context listener initializing
    +01-Jul-2008 11:11:04 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized+
    SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.ExceptionInInitializerError
    java.lang.ExceptionInInitializerError
    +     at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:144)+
    +     at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)+
    +     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)+
    +     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)+
    +     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)+
    +     at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)+
    +     at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)+
    +     at java.security.AccessController.doPrivileged(Native Method)+
    +     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)+
    +     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)+
    +     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)+
    +     at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)+
    +     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)+
    +     at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215)+
    +     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)+
    +     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)+
    +     at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)+
    +     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)+
    +     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)+
    +     at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)+
    +     at java.lang.Thread.run(Thread.java:619)+
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.woodstox read)
    +     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)+
    +     at java.security.AccessController.checkPermission(AccessController.java:546)+
    +     at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)+
    +     at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)+
    +     at java.lang.System.getProperty(System.java:652)+
    +     at java.lang.Boolean.getBoolean(Boolean.java:221)+
    +     at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.<clinit>(XMLStreamReaderFactory.java:78)+
    +     ... 21 more+
    +01-Jul-2008 11:11:04 org.apache.catalina.core.StandardContext start+
    SEVERE: Error listenerStart
    +01-Jul-2008 11:11:04 org.apache.catalina.core.StandardContext start+
    +SEVERE: Context [Temdox] startup failed due to previous errors+
    +01-Jul-2008 11:11:04 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed+
    INFO: WSSERVLET13: JAX-WS context listener destroyed
    +[GC 21401K->4600K(63424K), 0.0018230 secs]+
    +01-Jul-2008 13:41:46 org.apache.catalina.startup.HostConfig checkResources+
    +INFO: Undeploying context [Temdox]+
    +01-Jul-2008 13:41:46 org.apache.catalina.startup.HostConfig deployWAR+
    The web service is using jax-ws and is an soap rpc service. I have noticed that the log refers to XMLStreamReaderFactory.woodstox
    which should be XMLStreamReaderFactory.Woodstox (upper case W), but i dont know if this is significant, and if it is I dont know where i can change this.
    Any help would be much appreciated.
    Jon Doveston

    The access denied message was caused by restrictive security settings in the tomcat configuration. In this case the test server being used is a managed server provided by a third party so at our request they allowed the actions and now the web app deploys successfully.

  • Java Web Service/Eclipse/Tomcat v5.5/Axis v1.4

    I am developing a Java web service in Eclipse for deployment on Tomcat v5.5 and Axis v1.4 .
    When I run a web service client I've developed to test the web service I get the following error:
    Jan 23, 2009 10:27:55 AM org.apache.axis.InternalException <init>
    SEVERE: Exception:
    java.lang.Exception: The OperationDesc for IPublishEvent was not synchronized to a method of edu.monmouth.rri.ahett.pubwebservice.PublisherWebService.
    I have looked on the Apache Axis web site and while there are posts related to this problem they appear to be 1) old and 2) unanswered (or at least I can't find the answer).
    I can provide any of the following, if needed, to help diagnose this problem: 1) the Java source code for my class, 2) the WSDL file created when generating the web service in Eclipse, and 3) the deploy.wsdd XML generated.
    Thanks

    Hello,
    I have the same issue on my side --> Tthe OperationDesc for releaseCard was not synchronized to a method"
    did you solve this issue?
    Thanks in advance.

  • Java web Service and Tomcat

    Hello,
    how can I set where service save files. Becouse when I save file in web service running on Tomcat 6.0, it is in directory Tomcat\bin.

    Well how do you tell it which file/directory to save it in?
    Just with new File("myFileName.txt") ?
    In that case it just uses the current working directory which normally just happens to be the Tomcat/bin directory.
    Better way is to use the constructor for File which takes two arguments - a directory and a filename
    File saveDirectory = new File("c:/data/webservicefiles/");
    File saveFile = new File(saveDirectory, "myFileName.txt");
    Of course the directory for saving should be configurable somewhere. In a properties file most likely.

  • Debug web service by tomcat and intellij idea

    Any idea how to debug web services using idea.I have read
    http://www.wso2.net/tutorials/axis2/java/2006/07/28/debug-ws
    and it didn't worked for me.
    thanks

    +1. From the View menu choose Application Server Navigation+
    Right click the Application Server node and choose New Application Server and then follow the instructions to create a Tomcat connection.
    +2. Create an EAR or WAR deployment profile depending on what is in your application - and then you can right click the project and choose Deploy to...->Tomcat connection you defined.+
    I followed these steps but that only created a .war file with only one directory inside it "WEB-INF" with two files "faces-config.xml" and "web.xml".
    The ant target (from my build.xml file that was delivered with the code) was not used at all and I can see no way of connecting it with the deploy profile.
    If I use the target (in the build.xml file) to build my application I do get a .war file I can use. (When putting that in the tomcat webapps directory it is used by tomcat and an application directory is created by tomcat. I can then logg into it (http://localhost:8080/myapplication).
    Note however, that that .war file is used in a tomcat that has been started with:
    NET START Tomcat6
    Not as recommended in http://technology.amis.nl/blog/1984/java-platform-debugger-architecture-jpda-with-tomcat-oc4j-eclipse-intellij-idea-and-jdeveloper
    That is with:
    SET JPDA_ADDRESS=8000
    SET JPDA_TRANSPORT=dt_socket
    catalina.bat jpda start
    So the question is, how can I use the defined ant target in my build.xml file PLUS the new tomcat server connection TOGETHER so I get something that will hopefully run.

  • Java 6 web services and Tomcat?

    I recently installed Java SE 6 and want to know how to use the web services that come with it with Tomcat 5.5.
    Searching the internet yields no answers.
    Specifically, I need to know what needs to go into the web.xml file to publish the web service, whether another xml file is needed, whether Tomcat should have any jars added to its internal directories, etc.
    I realize that some of these questions are Tomcat-specific, and I plan to post on a Tomcat-related forum as well, but these are all Java SE 6 -related questions, so I'm hoping that posting here should yield some answers too.
    Thanks in advance,
    Inna

    Thanks for your reply.
    I found how to do this, though it took a lot of searching.
    I'm including the info in this post in case it can help anyone in the future.
    This info was found on: http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=51&t=004355 and is copied almost verbatim below.
    The steps are:
    Download and unpack the jax-ws (use https://jax-ws.dev.java.net/jax-ws-20-fcs/)
    Copy all *.jar from the lib dir into $CATALINA_HOME/shared/lib
    Create a directoy for the service under $CATALINA_HOME/webapps
    Copy the class structure from the web service into WEB-INF/classes in that directory
    Create a sun-jaxws.xml in WEB-INF
    Create web.xml in WEB-INF
    Start tomcat. Done
    The web.xml should look something like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
    <web-app>
      <listener>
        <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener
        </listener-class>
      </listener>
    <servlet>
      <servlet-name>HelloService</servlet-name>
      <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>HelloService</servlet-name>
      <url-pattern>/hello</url-pattern>
    </servlet-mapping>
    <session-config>
      <session-timeout>60</session-timeout>
    </session-config>
    </web-app>The sun-jaxws.xml can look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">
      <endpoint  name="HelloService"        implementation="com.techyatra.hellows.HelloServer" url-pattern="/hello" />
    </endpoints>After starting tomcat you can access the service under
    http://localhost:8080/HelloService/helloHope this helps someone.
    Inna

  • Error in Web Service when accesing in portal SRT: Authorization denied

    Hello Experts,
    I have created web service in development and creates endpoint in SOAMANAGER than through portal i am able to access the webservice than i transported that web service to quality and again created endpoint in SOAMANAGER but when i access through link created through wsdl through portal there i am getting error SRT: Authorization denied . also i have given sap_all authorization to the user. Can anybody help me to find solution.
    Thanks & Regards,
    Taran

    Please help me on this

Maybe you are looking for