w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Start thread on standalone application from Servlet
What is the best way to invoke a main program from a servlet with arguments. I was thinking of using Runtime object's exec() method to call .bat file. Anything better than this? Instead of this, IMO, you create a thread class in your web application and execute the webservice call within it in parallel Also, if you are using Servlet3 API, then a new Async support introduced by the API spec may help

Categories : Java

Autowiring a Spring 3.2 standalone application fails
If it is running from eclipse and not running from the exported jar file, then it is a problem with the export In the export window there is a checkbox saying Add directory entries that should be checked for component-scan to work

Categories : Java

Migration to Spring project from JSP/Servlet/Portlets(Jetspeed) - application design
here's an attempt to answer your questions; separate webapps do make it easier to maintain and 'silo' the effect of changes as long as you've got good version control and release management cycles. my suggestion is to allow for a transitional migration by migrating one app at a time to a 'Spring-compliant' style rather than go for a 'big bang' approach. in terms of data-sharing, you'll need to think about a couple of things and whether or not you're treating each individual web app as 'service' (capable of sharing the information with not just the other web apps but future applications) or as a separate known/coupled web app. if you're going for the former, there's a wide variety of options from RESTful services and messaging services. if you're going for the latter, then you're look

Categories : Java

How the spring container starts and ways to load the spring container
The simplest solutions is to use a ContextLoaderListener: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext*.xml</param-value> </context-param> See http://static.springsource.org/spring/docs/4.0.x/spring-framework-reference/html/web-integration.html for details.

Categories : Java

Invoking Java standalone program in servlet or any other J2EE technologies
Its very easy. Have one thread in your servlet class. Run the thread (Thread will extract the data etc). After running the thread redirect user to a page where you have auto-refresh or something to show how much extraction is done.(You mentioned that you have a way to find it)

Categories : Java

I need a Windows 8 WinRT application to communicate with a standalone application written in C
Well, the posts stating that such communication is not possible, are mostly right. There are 2 reasons, why this is prevented: Being able to communicate to an application outside the sandbox effectively breaks the sandbox. The Windows Store app is now suddenly able to do everything the desktop application can do: access file system, registry... Windows Store apps live in a sandbox for reason - to be safe for the user. The Windows Store app won't work after it is installed from the the store or from a package. It needs to have a desktop application installed and set up correctly as well. I would suggest you try to move your server part to a different machine and make it a proper server. If for some reason you really can't do that, you still have the following options available: You ca

Categories : C++

Is it possible to run a spring webmvc webapp with spring security in one spring container?
Short answer Remove the /WEB-INF/myapp-servlet.xml from the contextConfigLocation context param. Long Answer The ContextLoaderListener creates a root application context based on the configuration files defined in the contextConfigLocation and loads it into the ServletContext before any Servlet is initialized. The DispatcherServlet at the same time, will create a child application context with the specified configuration. You are not explicitly specifying any bean definition file, so by convention it will take /WEB-INF/appName-servlet.xml (/WEB-INF/myapp-servlet.xml in your case, which by chance exists). It happens that both your root application context and your child application context will have some common beans (duplicates, because they load the same configuration file). You hav

Categories : Java

Using CDI without a Servlet Container
You don't need a container: A very short tutorial can be found here: http://randling.wordpress.com/2011/08/15/cdi-in-java-se/

Categories : Java

StandAlone Spring MVC Test framework
ofcourse it is possible to download it as a jar: http://mvnrepository.com/artifact/org.springframework/spring-test/3.2.4.RELEASE link jar to: http://repo1.maven.org/maven2/org/springframework/spring-test/3.2.4.RELEASE/spring-test-3.2.4.RELEASE.jar then you need to add is as library to your project which is different subject ( you probably should take a look what maven is ).

Categories : Eclipse

Get All ServletContexts loaded in JVM (servlet-container)
I'm not sure about other containers, but Tomcat allows you to access a wealth of information via JMX. Attach to jconsole, VisualVM or another JMX browser to a Tomcat process and look under Catalina,type=WebModule and you can see a list of loaded contexts. Each JMX bean you can find in that sub-tree has a wealth of information about the state of the server.

Categories : Java

Embedding Jetty as a Servlet Container
What you are looking for is running Jetty in an embedded scenario. There's plenty of examples available showing how to tie together the various pieces you need to accomplish your goals. Check out the embedded examples in the jetty source tree. For the record, jetty standalone is really just jetty embedded with a few startup and classpath related bootstraps. It is the same code, and assembled in basically the same way. Since you stated you want Servlet 3.0, have no interest in JSP, this is rather easy to setup. (JSP is trickier to setup, but possible). For servlet 3.0 specific embedding, there's a complete example project hosted at github. https://github.com/jetty-project/embedded-servlet-3.0 In short, you'll have the following initialization code. package com.company.foo; import

Categories : Java

More than one Singleton in a single servlet container (Tomcat)
No. The webapps should be isolated by ClassLoader within Tomcat, so each should have their own instance of the singleton. So long as the answer to #1 is in fact no, then the answer to this is also no. Probably not. As an aside, my understanding is that, as a general rule Java EE web apps are not supposed to spin up new threads.

Categories : Java

WebSecurityConfigurerAdapter add to root context in non Servlet 3.0 container
You should be able to configure it through ContextLoaderListener this way: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> package.WebSecurityConfig</param-value> </context-param> <context-param> <param-name>contextClass</param-name> <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value> </context-param>

Categories : Java

Block of code that I need to run everytime my servlet container starts up
I would suggest following: Put this code in the init() of a Servlet. Configure this servlet in web.xml. You can decide the order of loading (<load-on-startup/>) this servlet relative to other servlets. When the container loads, it initializes the servlet and calls its init() method executing the initialization code.

Categories : Java

Why have Apache Solr chosen Jetty as a Servlet container
Probably it is because it is "light" and can be easily embedded on the Solr distribution... so you can immediately have a running Solr server without requiring any other Servlet container (such as Tomcat, etc.). In terms of performance, not sure there will be such a big difference. Probably this depends on your own setup, for example in "development" I use Jetty, in production I use Tomcat, since I already am using it for other applications...

Categories : Tomcat

Detect if running servlet container is Eclipse Jetty
Accessing the server class can be done from embedded mode, but not a standalone Jetty. This is because the WebAppClassloader isolates access to the org.eclipse.jetty.server.Server class to webapps. However, you can use the fact that all servlet container must have an implementation of the default servlet, just use the ServletContext to access the RequestDispatcher for the default servlet and pay attention to the implementation class name. Seems to work well on both Jetty 8.1.10 and 9.0.3 during embedded use. (will try again on standalone jetty shortly) Full class as example: package com.company.foo; import java.io.IOException; import java.io.PrintWriter; import java.lang.reflect.Method; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet

Categories : Eclipse

Sharing session attributes of a web service and a servlet within same Tomcat container
The fact that your class test.main.StoreCreds implements an interface com.data.credentials.manager.IFStoreCredentials doesn't change the fact that your object is still an instance of the concrete test.main.StoreCreds. And if the wabapp doesn't know about this concrete class, it can't use an object of this type, because it can't find the byte-code of the class of the object, which is obviously needed to use it. The concrete class must be shared by both applications. That said, shared sessions is not standard, and should be avoided. Consider making it a single application, or storing the data you want to share between apps in a shared database.

Categories : Java

java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
You have downloaded Jersey 2 (which RI of JAX-RS 2). The tutorial you're referring to uses Jersey 1. Download Jersey 1.17.1 from (here), should be sufficient for you. Jersey 1 uses com.sun.jersey, and Jersey 2 uses org.glassfish.jersey hence the exception. Also note that also init-param starting with com.sun.jersey won't be recognized by Jersey 2. Edit Registering Resources and Providers in Jersey 2 contains additional info on how to register classes/instances in Jersey 2.

Categories : Eclipse

Database required for standalone application
I actually ended up using a packager called TideSDK (http://www.tidesdk.org/) which supports SQLLite out of the box and also seems to render my applications layout much clearer. Many thanks!

Categories : Javascript

create a standalone py server application for mac
you can use pyinstaller, I've used it with windows and it works perfectly. also is you compare other tools like this, pyinstaller is the best because it gives you the ability to create just a single installer instead of a package.

Categories : Python

How to generate a standalone console application from .NET
If by .Net you mean Visual Studio, if you choose the non-dll (i.e. static) runtime libraries from the C/C++ | Code Generation | Runtime Library options (/MT or /MTd) then you might just get away with it. If you use the dll versions, these will need to be on the machine you deploy your app to.

Categories : C++

Execute Jar file as standalone application
Your jar doesn't contain a Manifest that specifies the executable main() function, so java doesn't know which class to execute/start. When using maven, have a look at the assembly plugin. This enables you to create a jar with the correct Manifest. Or simply start your programm with: java -cp DX57DC-1.0.jar 'your_main_class_here' Regards, Mike

Categories : Java

release db connections in standalone application
I believe that you would need to implement something like this and inside your destroy method, you would retrieve your datasource and call a close method or something similar. I'm also assuming you have a few things to do when you shutdown your application. I can't quite help with the right method name as I don't know what you are using for your datasource.

Categories : Spring

Error while saving a standalone application
@ninjabunny14 yep it's a good idea to include code, actual text of error messages, details of the platform you're developing on, versions of LiveCode/Android etc In the meantime you could Google "error while saving the standalone application could not compile application class" like I've just done and found quite a few links to LiveCode forum threads (like this one http://forums.runrev.com/phpBB2/viewtopic.php?f=53&t=12330) which look like they might be of use...

Categories : Android

How do I create a spring .Net standalone object of type Int32 defined in the IOC context file?
Try this: <object id="MyInt" type="System.Int32" factory-method="Copy"> <constructor-arg index="0"> <value>123</value> </constructor-arg> </object>

Categories : C#

How do I package a Scrapy script into a standalone application?
The simplest way is write a script in python for them I guess... If you are running a Windows Server you can even schedule the comand that you use (scrapy crawl yoursprider) to run the spiders.

Categories : Python

resultset.isLast() is not working standalone application
Edit: From the Oracle Docs: The method isLast() cannot always detect when the ResultSet is positioned on the last row and may return false instead of returning true when used on a FORWARD-ONLY ResultSet. Which is really wierd, as you defined your ResultSet not to be FORWARD-ONLY. : S

Categories : Java

Joomla 3.0—standalone application for test purposes
You can build from the Joomla Platform (the code found at libraries/joomla and libraries/legacy in the CMS distro) for simple things. But, I've found it difficult to build anything more than simple applications with the Platform without having to resort to CMS like code structures and techniques. I've got one of those simple cases on GitHub which also incorporates the CMS library. As for automated testing, browse the Platform repository's tests folder. There's a fairly decent unit test structure in place there with mocks for many of the higher level classes. So, it's possible, if you're willing to do some legwork.

Categories : Unit Testing

Standalone application to wrap HTML and JavaScript/CSS
You can use JavaFx with Java 6 if you include the runtime libraries for JavaFX (can be downloaded from Oracle here. If you ship the runtime with your application (just a bunch of jar files), your requirement of no extra installation should be fullfilled. Maybe you can distribute your application with Java Web Start to make distribution even easier for your client.

Categories : Java

Convert a Python package into a standalone application
Solved! I simply added a path to my package in site-package directory of python, then wrote the main script that uses this package to get my task done. I then used pyinstaller to make a binary of this main script and it automatically included and complied all the dependencies that includes this very package i created. I essentially copied the __main__.py as that had all the code that was doing the final task. Working like a charm :) If anyone has any suggestions or a better way, please suggest!

Categories : Python

Is there a standard way to customize the deploy path in Spring Boot?
As it uses an embedded tomcat you should be able to add a /META-INF/context.xml to each application which specifies the path (at least this should work for a normal tomcat). That works for our normal embedded tomcat stuff, so I would expect it to work for Spring Boot as well.

Categories : Java

Distributing ruby application as standalone in linux and windows
Have a look at this link where several options are offered to distribute a Ruby script as a "native" executable. Keep in mind that Linux users usually do not need this, bundle install and ruby myscript.rb is enough on those systems.

Categories : Ruby

How can I shutdown a standalone Apache Camel application in an automated way?
See this FAQ how to stop a route from a route: http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html. Then you can enable the option: sendEmptyMessageWhenIdle=true, and then in the route do a message filter, or content based route, and detect the empty message, and then stop the route and then after that CamelContext. Though I also think this question has been discussed before, so you can maybe find other SO questions or google etc. As there is also alternative ways of doing this.

Categories : Java

How to create a standalone SQL DB file to use with my java chat application?
I am not sure if I understand your question properly, but reading about Minecraft plugins and SQL file somehow tells me that you actually miss some basic knowledge about the databases and server communication and that is what the question is really about. So to clarify. Databases: If you have a file which contains a database it is the SQLite Database. Here is the homepage of the project: LINK. You can do further googling about the project to fully understand it. However mySql is a separate database type, not based on sql files itself. In both databases (and others too) communication with the database, when using java or other programming language does not imply sql files to be created and managed, but is usually done through ORM link mechanism such as Hibernate homepage (for Java). T

Categories : Java

Need help trying to read Sharepoint folder from a standalone windows application (c# based)
Use the Managed Client Object Model: http://msdn.microsoft.com/en-us/library/ee857094(v=office.14).aspx ...or connect to the folder via SharePoint's web services: http://sarangasl.blogspot.com/2009/12/sharepoint-list-web-service.html

Categories : C#

Java Standalone runnable GUI application - can't get jar file to open the program
Again: "you can use Java resources to load the properties file as an embedded-resource (see the tag info for related tutorials), though you can't store values there that are going to change". You haven't said whether they're going to change. If you are going to store a few things, the (new-ish) way to do that is with the java.util.Preferences API. If you really need your own file, I suppose the user's' home directory is the place to put a directory of your own in which to store the file, look up user.home as a system parameter.

Categories : Java

What is the best way to deploy to a standalone Weblogic Server ADF Secure Application with maven
Which version are you using, because if you are using 12c it should come out of the box with JDeveloper! Or else try to use OEPE(Oracle Enterprise Pack for Eclipse) as it packages the application without OJDeploy, you can use that and create your Maven script to take the generated war file and resume from there.

Categories : Java

NoClassDefFoundError in Tomcat but not in a Standalone application for a dynamically created java class
Maybe you are not dealing with the classloader chierarchy. Please read this enter link description here, Understanding The Tomcat Classpath - Common Problems And How To Fix Them and Tomcat Class Loader HOW-TO

Categories : Java

Haskell standalone desktop application authentication (using google / facebook / twitter / etc accounts)
Original answer OpenID works by sending the user to its provider's website and then redirecting it back to the "relying" website (cf OpenID spec). This process requires a web browser, so you either have to integrate one into your application or open one up. In the latter case you also need a way to get the result of the authentication process, either by asking the user to copy-paste it or by running a web server on localhost. Second answer after question update The authentication mechanism should work in standalone application on all major platforms (Linux, Windows, Darwin) The authentication mechanism should work with application without gui. Without a GUI, the best solution probably is to just prompt the user for his password. OpenID and OAuth 1.0 don't support this use

Categories : Authentication

Servlet.service() for servlet [Faces Servlet] in context with path threw exception [null] with root cause
The error is well detailed, above the exception you mention com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException SEVERE: Error Rendering View[/cECI/domainReport.xhtml] java.lang.NullPointerException You should give a look into that xhtml so it can be rendered correctly Also, you can create a custo lo4j.properties at /src folder, to obtain extra information from ICEFaces core (in the example is set to WARN, try with INFO, or DEBUG, until you find more information on your problem) log4j.rootLogger=INFO log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=[%d{dd MMM yyyy HH:mm:ss}] %-5p [%F:%L -- %M] - %m%n log4j.logger.com.icesoft.faces.application.D

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.