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

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++

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

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

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

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++

Updating a bundle in Felix embedded into Android application shows: "java.io.FileNotFoundException"
Ah, you are creating a File object from a URL! new File("file:sdcard/Download/AndroidVideoPlayer_1.0.0.201308231205.jar")) Try this File file = new File( "sdcard/Download/AndroidVideoPlayer_1.0.0.201308231205.jar" ); context.update( new FileInputStream(file)); Or context.update( new URL("file:sdcard/Download/AndroidVideoPlayer_1.0.0.201308231205.jar").openStream());

Categories : Android

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

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

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

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

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

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

SEVERE: Context Initialization failed java.io.FileNotFoundException: class path resource [application]
The error message says "class path resource [application] cannot be opened because it does not exist" . Spring framework is trying to find "application" instead of "application.properties". Please double check if @PropertySource has classpath:application.properties.

Categories : Maven

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

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

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

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#

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

eclipse servlet java.lang.ClassNotFoundException: javax.servlet.Servlet
Is that error happing during the compilation or during the run? Did you configure Eclipse to point to the Tomcat server? In order to run a web server in eclipse using tomcat, you need to tell eclipse about tomcat first. Here is where you ca find the instruction. http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html

Categories : Java

Application crushes and throw NullPointerException while Orientation is changing
When orientation of the phone changes, your activity is destroyed and created again. You can use this in AndroidManifest.xml. activity your activity... android:configChanges="orientation|keyboardHidden|screenSize"> activity Edited: As complementary for this answer: The documentations says:"A fragment must always be embedded in an activity and the fragment's lifecycle is directly affected by the host activity's lifecycle. For example, when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all fragments." Here is the link http://developer.android.com/guide/components/fragments.html You can't recreate your activity only for some fragments, you should rethink your approach.

Categories : Android

C# DllIimport Unmanaged C code application (exe) file throw AccessViolationException
There is very little difference between a managed DLL and EXE. You can rename the assembly of a class library to *.exe and your program still works. That is however not the case for a C program. An EXE is vastly different from a DLL. For one, a C program requires that code always gets started at the main() function. A requirement because before a C program can start running, the C runtime library must be initialized first. The rough equivalent of the CLR having to be initialized before it can start executing managed code. Skipping that initialization, like you do, is very likely to crash the program when it uses a C runtime function. Like printf(). Entirely not an issue in managed code because the CLR always get initialized first before it executes a program. Another very impor

Categories : C#

Should I throw java.lang.OutOfMemoryError from application native library (used via JNI)?
OutOfMemoryError has a specific meaning: Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector Since it is a native heap allocation that's failing, it would be inappropriate for your code to throw this error. Notwithstanding what ByteBuffer.allocateDirect() does. I would recommend that you create your own exception, extending Error. It should not be a checked exception, as there is little/nothing that a running program could do to avoid the error.

Categories : Java

Why Application.Exit event works even if handler is async void in WPF application lifecycle?
It is theoretically possible for a framework to detect the use of async void and wait until the async void method returns. I describe the details in my article on SynchronizationContext. AFAIK, ASP.NET is the only built-in framework that will wait on async void handlers. WPF does not have any special treatment for async void methods. So the fact that your exit handler is completing is just coincidence. I suspect that the operations you await are either already complete or extremely fast, which allows your handler to complete synchronously. That said, I do not recommend the solution in the article you referenced. Instead, handle the window's Closing event, kick off whatever asynchronous saving you need to do, and cancel the close command (and also consider hiding the window immediately).

Categories : C#

Connection to Oracle works through a console application and doesn't work through a web application - ORA-12154
Check your ORACLE_HOME (path) Check privilegies on the oracle home directory. Check your references in your web app(should be to Oracle.DataAccess and also System.Data).

Categories : C#

CRM 2011 Online via an ASP.net application does not work, same code via Console Application Works -> "Authentication Failure"-error
Is there any particular reason you have Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials; You shouldn't need that line for windows live authentication. Even with that the code seems valid so it is something to do with the Device Registration. I suggest rather than just call it directly like you have using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, GetDeviceCredentials())) { You try something like the following because you only need to register once: ClientCredentials deviceCredentials; if ((CRMSettings.Default.DeviceID == String.Empty) || (CRMSettings.Default.DevicePassword == String.Empty)) { deviceCredentials = Microsoft.Crm.Services.Utility.DeviceIdManager.RegisterDevic

Categories : Asp Net

C# - C# Server works as Console Application. Does not work as Web Application
Mathew, As aluded to by the emeritus mr skeet, you are only catching half the equation. You need to then instantiate the class and call the Main() method. Here's how you could do that: TCPListener tcpListener = new TCPListener(); tcpListener.Main(); Try that in your main point of setup in your web based solution (controller action or page load code behind). Also, change the method signature on Main (remove the static). Also, you seem to be calling your class inside itself: listener = new TcpListener(); That is gonna cause big problems... I would suggest a little refactoring and a rethink about how Main works. Your 1st major win would be to rename the example class above away from TCPListener, to something else as there appears to be a collision going on there. [EDIT] To save rea

Categories : C#

Is it necessary to use init() in every servlet I use in my web application?
Because the Servlet container controls the initialization of your Servlet, you don't have a choice but to use the init() method to initialize any instance fields that your Servlet might need. For example if your Servlet depended on a Service class to interact with some resource, you could do the following public class MyServlet extends HttpServlet { private MyService myService; public void init() { myService = new MyService(); myService.setSomeProperty("propertyValue"); } ... } This way you can initialize any fields. If you need it, you can use the init(ServletConfig) method instead or call getServletConfig() to access the ServletContext which may contain attributes that were added either from other Servlet init() or from ServletContextListeners. Note t

Categories : Jsp

Invoking servlet from Java GUI application?
Yes, you could call a servlet which in turn calls an EJB. But you can call an EJB directly from a stand-alone application as well. If your servlet returns HTML markup (content type "text/html" - for human beings), you will have to parse it (requires effort) to get the same result. Every time the markup changes, your client has to be changed as well. Even if there is a firewall in between (= direct RMI is not possible), you can use "RMI over http(s)", and there is a HTTP based naming service as well (JBoss offers this functionality). On the other hand, if you mean a servlet which implements a web service which returns XML or JSON, it's a valid approach, especially if clients from other languages (C++ for example) are involved. Another advantage is that you can read the result using a bro

Categories : Web Services

How to create Servlet 3.0 web application in maven?
There is still no good way of doing this. Eclipse is parsing web.xml to indentify project's facet and therefore servlet version. To achieve servlet 3.0 web app in eclipse follow these steps: Using Eclipse only: Create MVN project of maven-archetype-webapp New -> Project -> Mvn Project Replace web.xml file with new 3.0 version: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>Archetype Created Web Application</display-name> </web-app> Close project and delete it from the workspace (don't delete files on the d

Categories : Eclipse

How to through a java application to transfer data to the servlet
You should write json data to outputStream as out.write(json.getBytes()); . See the complete code below: String _url = "http://localhost:8080/jsf/test"; URL url = new URL(_url); String json = "[{"id":"DFAB8108D69642EBBD461160B4519B0F","name":"name1"},{"id":"B048B2521A5619DCE0440003BA11CFDA","name":"name2"}]"; HttpURLConnection urlconn = (HttpURLConnection) url.openConnection(); urlconn.setRequestMethod("POST"); urlconn.setDoOutput(true); OutputStream out = urlconn.getOutputStream(); out.write(json.getBytes()); out.flush(); out.close(); BufferedReader rd = new BufferedReader(new InputStreamReader( urlconn.getInputStream(), "UTF-8")); StringBuffer sb = new StringBuffer(); int ch; while ((ch = rd.read()) > -1) { sb.append((char) ch); } System.out.println(sb.toString()); rd.cl

Categories : Java

Uploading and handling a file to a servlet from another application/service
1) How can I upload a file to a servlet from an application/service, in other words without a html form that a user should fill in? You have to create a HTTP request containing the correct headers (multipart/formdata) that contains the file you want to upload. Have a look at this post: Upload files with java. I haven't tried it, but it looks as if it could work. 2) On the receiving end, I have used Apache FileUpload before, but this handles form inputs, is there another way to handle an upload not coming from a form? You should still be able to use Apache FileUpload on the receiving end since it merely parses the HTTP request which should still be formatted in the same way.

Categories : Java

Upload a file to my dropbox from a java servlet web-application
You might take a look at the examples folder in the Java SDK to see how the API differs from earlier versions. Also take a look at the documentation. For example, you'll probably want to use uploadFile: http://dropbox.github.io/dropbox-sdk-java/api-docs/v1.7.x/com/dropbox/core/DbxClient.html#uploadFile(java.lang.String, com.dropbox.core.DbxWriteMode, long, java.io.InputStream). (Sorry; I can't quite get that URL to parse properly.)

Categories : Java



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