Problem with JNI and Tomcat in windows
Hello guys...
I have the following problem.
I used Tomcat 4 and I have following ApiEncriptacion class, in package com.servipag.sts;
package com.servipag.sts;
class ApiEncriptacion
public native String encripta(String texto, String ubicacionLlavePublica, String semilla);
static
System.loadLibrary("apisdark");
public native String desencripta(String texto, String ubicacionLlavePrivada);
static
System.loadLibrary("apisdark");
the LD_LIBRARY_PATH is set in following dir c:\tomcat\bice
the dll this in the following path = c:\tomcat\bice\apisdark.dll
I run Tomcat at the following way..
C:\jdk1.4\bin\java.exe -jar -Djava.library.path="c:\tomcat\bice" -Duser.dir="C:\Tomcat" "C:\Tomcat\bin\bootstrap.jar" start
but, still appear the error:
java.lang.UnsatisfiedLinkError: encripta
at com.servipag.sts.ApiEncriptacion.encripta(Native Method)
at com.servipag.sts.ServiciosServiPagImpl.rescatarFirma(ServiciosServiPagImpl.java:2143)
at com.servipag.sts.ServiciosServiPagImpl.pagarCuenta(ServiciosServiPagImpl.java:310)
at org.apache.jsp.SBCO_0005flogin_0005fbice_0005f4$jsp._jspService(SBCO_0005flogin_0005fbice_0005f4$jsp.java:265)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
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:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
please help me
Luis Navarro.
Chile
ApiEncripatcion.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class ApiEncriptacion */
#ifndef IncludedApiEncriptacion
#define IncludedApiEncriptacion
#ifdef __cplusplus
extern "C" {
#endif
* Class: ApiEncriptacion
* Method: encripta
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
JNIEXPORT jstring JNICALL Java_ApiEncriptacion_encripta
(JNIEnv *, jobject, jstring, jstring, jstring);
* Class: ApiEncriptacion
* Method: desencripta
* Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
JNIEXPORT jstring JNICALL Java_ApiEncriptacion_desencripta
(JNIEnv *, jobject, jstring, jstring);
#ifdef __cplusplus
#endif
#endif
ApiEncriptacion.c
#include "jni.h"
#include <stdio.h>
#include "files.h"
#include "hex.h"
#include "rsa.h"
#include "randpool.h"
USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
void GenerateRSAKey(unsigned int keyLength, const char privFilename, const char pubFilename, const char *seed);
char RSAEncryptString(const char pubFilename, const char seed, const char message);
char RSADecryptString(const char privFilename, const char *ciphertext);
JNIEXPORT jstring JNICALL
Java_ApiEncriptacion_encripta(JNIEnv *env, jobject obj, jstring texto, jstring ubicacionLlavePublica, jstring semilla)
try
char *ciphertext = RSAEncryptString(ubicacionLlavePublica, semilla, texto);
delete [] ciphertext;
return(ciphertext);
catch(CryptoPP::Exception &e)
return ("");
catch(std::exception &e)
return ("");
catch(...)
return ("");
JNIEXPORT jstring JNICALL
Java_ApiEncriptacion_desencripta(JNIEnv *env, jobject obj, jstring texto, jstring ubicacionLlavePrivada)
try
char *decrypted = RSADecryptString(ubicacionLlavePrivada, texto);
return(decrypted);
catch(CryptoPP::Exception &e)
return ("");
catch(std::exception &e)
return ("");
catch(...)
return ("");
int main()
return(0);
void GenerateRSAKey(unsigned int keyLength, const char privFilename, const char pubFilename, const char *seed)
RandomPool randPool;
randPool.Put((byte *)seed, strlen(seed));
RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
HexEncoder privFile(new FileSink(privFilename));
priv.DEREncode(privFile);
privFile.MessageEnd();
RSAES_OAEP_SHA_Encryptor pub(priv);
HexEncoder pubFile(new FileSink(pubFilename));
pub.DEREncode(pubFile);
pubFile.MessageEnd();
char RSAEncryptString(const char pubFilename, const char seed, const char message)
FileSource pubFile(pubFilename, true, new HexDecoder);
RSAES_OAEP_SHA_Encryptor pub(pubFile);
if (strlen(message) > pub.MaxPlainTextLength())
cerr << "message too long for this key\n";
abort();
RandomPool randPool;
randPool.Put((byte *)seed, strlen(seed));
char outstr = new char[2pub.CipherTextLength()+1];
pub.Encrypt(randPool, (byte *)message, strlen(message), (byte *)outstr);
HexEncoder hexEncoder;
hexEncoder.Put((byte *)outstr, pub.CipherTextLength());
hexEncoder.MessageEnd();
hexEncoder.Get((byte *)outstr, 2*pub.CipherTextLength());
outstr[2*pub.CipherTextLength()] = 0;
return outstr;
char RSADecryptString(const char privFilename, const char *ciphertext)
FileSource privFile(privFilename, true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor priv(privFile);
HexDecoder hexDecoder;
hexDecoder.Put((byte *)ciphertext, strlen(ciphertext));
hexDecoder.MessageEnd();
SecByteBlock buf(priv.CipherTextLength());
hexDecoder.Get(buf, priv.CipherTextLength());
char *outstr = new char[priv.MaxPlainTextLength()+1];
unsigned messageLength = priv.Decrypt(buf, (byte *)outstr);
outstr[messageLength] = 0;
return outstr;
Similar Messages
-
Problem with JNI and Tomcat (and threads???)
Howdy,
Here is the issue - I would like some help on HOW to debug and fix this problem:
2 test use cases -
1)
a)User goes to Login.jsp, enters user and password
b) User submits to LoginServlet
c) login calls JNI code that connects to a powerbuilder(Yes I know this is ugly) PBNI code module (this is a .dll) that authenticates the user with the database
d) the servlet then redirects to another .jsp page
e) user then submits to LogoutServlet - also a JNI call to a powerbuilder PBNI code module
f) REPEAT STEPS a-e over a few times (inconsistent) and then the call to the JNI code hangs
2)
a) users does NOT goto Login.jsp, but rather calls LoginServlet and passes the userid and password as GET parms
b) user does NOT get redirected to a page (redirect code commented out)
c) user calls LogoutServlet
d) repeat steps a-c at will and no failure, no hanging
The only difference is that in case 1 (with JSP), there is a redirect and it afffected the JNI call by haniging inside JNI code.
In case 2 (without JSP) there is still a JNI call, but it does not hang. In addition, when it hangs and I stop Tomcat, the logs show cleanup entries that say:
Oct 19, 2004 9:17:09 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
Oct 19, 2004 9:17:10 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
Oct 19, 2004 9:17:11 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
Is this a threading issue in Tomcat???
On would assume that the JNI code is not cleaning up after itself, but I don't believe this is the case,
and even if it was, why would I get the tomcat log cleanup entries above???
What do those cleanup entries imply about the state of Tomcat????hi ,
I met the same problem this morning, and searched the www.google.com in order to solve it, as a result, your article was shown on my screen. :)
Till now I have read some technical information and solved my problems. Maybe the solution be useful to you:
==============================
error message : (Environment : Tomcat 5, Windows 2003, Mysql5)
2006-3-29 11:53:48 org.apache.catalina.core.StandardWrapper unload
message: Waiting for 2 instance(s) to be deallocated
==============================
cause: the number of connection to database exceeded.another word,too many connections.
==============================
solution: close the connection when it becomes useless for your program. :)
==============================
ps. Sorry for my weak English . hehe .... -
Problem with Speaker and Headset in Windows Vista
Hi, I just got my Macbook Pro 13" and having problem with speaker and headset when working with Windows Vista (I have installed the driver from bootcamp). The sound very weak if I play music from Itunes or youtube even the volume already full and if i put my headset the sound not coming out. Is there anyone can help me to solve this problem?
Regards,EdwinWhen you post about Windows / Boot Camp, in Mac Pro (workstation) forum where others with a MacBOOK would be more likely to have same hardware configuration, and you won't find Windows drivers on Apple downloads. More like at
http://www.guru3d.com or other sites, or go to RealTek (if that is the type of audio you have). -
Problem with JNI and Parallel Port dll
Hi. I'm doing some testes with JNI. Firs i followed the netbeans tutorial for doing a C programa that prints somthing for java.. like.. "Hello java from C".
So i tried to load a dll from my dll. Like, I have this dll to use the parallel port on windows Xp. So i created a dll to access it an comunicates eoth java.
I did everything just fine.
When I start my Java app, the first thing it does is to load this parallel port dll and configure the functions of it.
After that .. I get this error
EXCEPTION_FLT_STACK_CHECK (0xc0000092) at pc=0x0093d269, pid=2284, tid=3000
Can someone explain why ?
(Sorry if i wasn't clear enough, english is not my native language, so ask if you don't understand something.. )hi ,
I met the same problem this morning, and searched the www.google.com in order to solve it, as a result, your article was shown on my screen. :)
Till now I have read some technical information and solved my problems. Maybe the solution be useful to you:
==============================
error message : (Environment : Tomcat 5, Windows 2003, Mysql5)
2006-3-29 11:53:48 org.apache.catalina.core.StandardWrapper unload
message: Waiting for 2 instance(s) to be deallocated
==============================
cause: the number of connection to database exceeded.another word,too many connections.
==============================
solution: close the connection when it becomes useless for your program. :)
==============================
ps. Sorry for my weak English . hehe .... -
Hello,
I am having a strange problem with Tomcat and axis. I have a webservice that uses axis2 for wsdl2java class generation. When I compile my project in maven a Test is performed. During the test a glassfish server is established and the project is deployed -everything work great with the expected results. However when I try to deploy the webservice on tomcat it has some problems.
At first I tried to call axis code in a POST method that takes a MultiPart message. The code is as below:
*@Path("identifyWavestream")*
*@POST*
*@Consumes(MediaType.MULTIPART_FORM_DATA)*
*@Produces(MediaType.APPLICATION_XML)*
*public String multipartTest(com.sun.jersey.multipart.MultiPart multiPart) throws Exception {*
*// get first body part (index 0)*
*//tomcat shows that the first error is here (line 122 is the nest one with bodypart)*
BodyPart bp = multiPart.getBodyParts().get(0);
BodyPartEntity bodyPartEntity = (BodyPartEntity) bp.getEntity();
InputStream stream = bodyPartEntity.getInputStream();
*//the rest of the code either saves the incoming file or implements the wsdl2java axis interface - neither works.*
And the tomcat error is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.util.ArrayList.RangeCheck(Unknown Source)
java.util.ArrayList.get(Unknown Source)
com.webserv.rest.resources.SearchResource.test.multipartTest(SearchResource.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
It was strange to me since this simple approach of handling a Multipart method worked for me earlier. Then I decided skip the handling of multipart method and just call the axis code. But the results also caused an error. I then tried to call the axis code in a simple @GET method (to cross out any issues regarding the multipart) and the result where the same. Again everything works on the maven- glassfish test. In this case the tomcat error is the following:
javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:361)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
com.sun.jersey.api.container.MappableContainerException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:74)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
org.apache.axis2.transport.http.AbstractHTTPSender.initializeTimeouts(AbstractHTTPSender.java:454)
org.apache.axis2.transport.http.AbstractHTTPSender.getHttpClient(AbstractHTTPSender.java:514)
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:156)
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
com.webserv.rest.webapp.IntSoapServiceStub.getServerData(IntSoapServiceStub.java:2447)
com.webserv..rest.resources.AIntSoapImpl.getServerData(AIntSoapImpl.java:112)
com.webserv..rest.resources.SearchResource.test.pingTest(SearchResource.java:167)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
I think it is also a good ide to post the pom.xml file :
Edited by: 803864 on 2010-10-21 00:30I think it is also a good ide to post the pom.xml file:
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<modelVersion>4.0.0</modelVersion>+
+<groupId>com.myProjects</groupId>+
+<artifactId>audioid-rest-interface</artifactId>+
+<packaging>war</packaging>+
+<name>AudioID Rest Interface</name>+
+<version>0.1</version>+
+<dependencies>+
+<!--+
+<dependency>+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-client</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>jersey-multipart</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.grizzly</groupId>+
+<artifactId>grizzly-servlet-webserver</artifactId>+
+<version>1.9.0</version>+
+<scope>test</scope>+
+</dependency>-->+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>jersey-multipart</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-client</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-bundle</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>commons-logging</groupId>+
+<artifactId>commons-logging</artifactId>+
+<version>1.0.4</version>+
+</dependency>+
+<dependency>+
+<groupId>commons-collections</groupId>+
+<artifactId>commons-collections</artifactId>+
+<version>3.1</version>+
+</dependency>+
+<dependency>+
+<groupId>org.slf4j</groupId>+
+<artifactId>slf4j-log4j12</artifactId>+
+<version>1.5.6</version>+
+</dependency>+
+<dependency>+
+<groupId>junit</groupId>+
+<artifactId>junit</artifactId>+
+<version>3.8.2</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.glassfish.distributions</groupId>+
+<artifactId>web-all</artifactId>+
+<version>10.0-build-20080430</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.glassfish.embedded</groupId>+
+<artifactId>gf-embedded-api</artifactId>+
+<version>1.0-alpha-4</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+</dependency>+
+<dependency>+
+<groupId>org.hibernate</groupId>+
+<artifactId>hibernate</artifactId>+
+<version>3.2.5.ga</version>+
+<exclusions>+
+<exclusion>+
+<groupId>javax.transaction</groupId>+
+<artifactId>jta</artifactId>+
+</exclusion>+
+<exclusion>+
+<groupId>cglib</groupId>+
+<artifactId>cglib</artifactId>+
+</exclusion>+
+</exclusions>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2</artifactId>+
+<version>1.4.1</version>+
+</dependency>+
+<!-- <dependency> -->+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-aar-maven-plugin</artifactId>+
+<version>1.4.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-java2wsdl</artifactId>+
+<version>1.4.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-xmlbeans</artifactId>+
+<version>1.4.1</version>+
+</dependency>+
+<!-- <dependency> -->+
+<dependency>+
+<groupId>com.sun.xml.bind</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1.12</version>+
+</dependency>+
+<dependency>+
+<groupId>cglib</groupId>+
+<artifactId>cglib-nodep</artifactId>+
+<version>2.1_3</version>+
+</dependency>+
+</dependencies>+
+<build>+
+<finalName>audioid-rest-interface</finalName>+
+<plugins>+
+<plugin>+
+<!-- This class is just generated for wadl support!!! -->+
+<!-- Take care that folder ../music-dna-core is existing -->+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<phase>generate-sources</phase>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<generatePackage> com.webserv.wsparameters</generatePackage>+
+<schemaDirectory>../audioid-rest-interface/src/main/resources+
+</schemaDirectory>+
+<includeSchemas>+
+<includeSchema>**/*.xsd</includeSchema>+
+</includeSchemas>+
+<extension>true</extension>+
+<strict>false</strict>+
+<verbose>false</verbose>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-javadoc-plugin</artifactId>+
+<!-- <version>2.6</version> -->+
+<executions>+
+<execution>+
+<goals>+
+<goal>javadoc</goal>+
+</goals>+
+<phase>compile</phase>+
+</execution>+
+</executions>+
+<configuration>+
+<encoding>UTF-8</encoding>+
+<verbose>false</verbose>+
+<show>public</show>+
+<subpackages> com.webserv.rest.rest.resources: com.webserv.rest.rest.commons: com.webserv.wsparameters+
+</subpackages>+
+<doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet</doclet>+
+<docletPath>${path.separator}${project.build.outputDirectory}+
+</docletPath>+
+<docletArtifacts>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>wadl-resourcedoc-doclet</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>xerces</groupId>+
+<artifactId>xercesImpl</artifactId>+
+<version>2.6.1</version>+
+</docletArtifact>+
+</docletArtifacts>+
+<additionalparam>-output+
+${project.build.outputDirectory}/resourcedoc.xml</additionalparam>+
+<useStandardDocletOptions>false</useStandardDocletOptions>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+<executions>+
+<execution>+
+<id>generate</id>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+<phase>compile</phase>+
+</execution>+
+</executions>+
+<configuration>+
+<wadlFile>${project.build.outputDirectory}/application.wadl+
+</wadlFile>+
+<formatWadlFile>true</formatWadlFile>+
+<baseUri>http://192.168.2.149:8080/${project.build.finalName}+
+</baseUri>+
+<packagesResourceConfig>+
+<param> com.webserv.rest.resources</param>+
+</packagesResourceConfig>+
+<wadlGenerators>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc+
+</className>+
+<properties>+
+<property>+
+<name>applicationDocsFile</name>+
+<value>${basedir}/src/main/doc/application-doc.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport+
+</className>+
+<properties>+
+<property>+
+<name>grammarsFile</name>+
+<value>${basedir}/src/main/doc/application-grammars.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport+
+</className>+
+<properties>+
+<property>+
+<name>resourceDocFile</name>+
+<value>${project.build.outputDirectory}/resourcedoc.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+</wadlGenerators>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.codehaus.mojo</groupId>+
+<artifactId>exec-maven-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<goals>+
+<goal>java</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<mainClass>com.sun.jersey.samples.generatewadl.Main</mainClass>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-compiler-plugin</artifactId>+
+<inherited>true</inherited>+
+<configuration>+
+<source>1.5</source>+
+<target>1.5</target>+
+<!--+
exclude temporary types that are only needed for wadl and doc
generation
-->
+<!--+
+<excludes> <exclude>com/webserv/types/temporary/**</exclude>+
+<exclude>com/webserv/rest/commons/Examples.java</exclude>+
+</excludes>+
-->
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.jvnet.jaxb2.maven2</groupId>+
+<artifactId>maven-jaxb2-plugin</artifactId>+
+<executions>+
+<execution>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-wsdl2code-maven-plugin</artifactId>+
+<version>1.4.1</version>+
+<executions>+
+<execution>+
+<id>generate reco core</id>+
+<goals>+
+<goal>wsdl2code</goal>+
+</goals>+
+<configuration>+
+<packageName>com.webserv.rest.webapp</packageName>+
+<wsdlFile>src/main/java/com/webserv/wsdl/web.wsdl</wsdlFile>+
+<databindingName>adb</databindingName>+
+</configuration>+
+</execution>+
+</executions>+
+</plugin>+
+<plugin>+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<generatePackage>com.webserv.wsparameters</generatePackage>+
+<schemaDirectory>src/main/xsd</schemaDirectory> <includeSchemas>+
+<includeSchema>**/*.xsd</includeSchema> </includeSchemas>+
+<extension>true</extension>+
+<strict>false</strict>+
+<verbose>true</verbose>+
+</configuration>+
+</plugin>+
+</plugins>+
+</build>+
+<profiles>+
+<profile>+
+<id>jdk-1.5</id>+
+<activation>+
+<jdk>1.5</jdk>+
+</activation>+
+<dependencies>+
+<dependency>+
+<groupId>com.sun.xml.bind</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1.10</version>+
+</dependency>+
+</dependencies>+
+<build>+
+<plugins>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-javadoc-plugin</artifactId>+
+<configuration>+
+<docletArtifacts>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>wadl-resourcedoc-doclet</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>xerces</groupId>+
+<artifactId>xercesImpl</artifactId>+
+<version>2.6.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml.bind</groupId>+
+<artifactId>jaxb-api</artifactId>+
+<version>2.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.activation</groupId>+
+<artifactId>activation</artifactId>+
+<version>1.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml.stream</groupId>+
+<artifactId>stax-api</artifactId>+
+<version>1.0</version>+
+</docletArtifact>+
+</docletArtifacts>+
+</configuration>+
+</plugin>+
+</plugins>+
+</build>+
+</profile>+
+<profile>+
+<id>xsltproc</id>+
+<activation>+
+<file>+
+<exists>../xsltproc_win32/xsltproc.exe</exists>+
+</file>+
+</activation>+
+<build>+
+<plugins>+
+<!-- Create/generate the application.html using xsltproc -->+
+<!-- Create/generate the application.html using xsltproc -->+
+<plugin>+
+<groupId>org.codehaus.mojo</groupId>+
+<artifactId>exec-maven-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<id>copy-docs-to-builddir</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>compile</phase>+
+<configuration>+
+<executable>copy</executable>+
+<commandlineArgs>src\\main\\doc\\*.* target\\classes+
+</commandlineArgs>+
+</configuration>+
+</execution>+
+<execution>+
+<id>prepare-xsltproc</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>package</phase>+
+<configuration>+
+<executable>copy</executable>+
+<commandlineArgs>..\\audioid-rest-interface\\src\\main\\resources\\*.xsd+
target\\classes</commandlineArgs>
+</configuration>+
+</execution>+
+<execution>+
+<id>exec-xsltproc: target/application.html</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>package</phase>+
+<configuration>+
+<!--<executable>xsltproc</executable>-->+
+<executable>../xsltproc_win32/xsltproc.exe</executable>+
+<commandlineArgs>-o target/application.html+
src/main/doc/wadl_documentation.xsl
target/classes/application.wadl</commandlineArgs>
+</configuration>+
+</execution>+
+</executions>+
+</plugin>+
+</plugins>+
+</build>+
+</profile>+
+</profiles>+
+<pluginRepositories>+
+<pluginRepository>+
+<id>maven2-repository.dev.java.net</id>+
+<name>Java.net Repository for Maven</name>+
+<url>http://download.java.net/maven/2/</url>+
+<layout>default</layout>+
+</pluginRepository>+
+<pluginRepository>+
+<id>maven-repository.dev.java.net</id>+
+<name>Java.net Maven 1 Repository (legacy)</name>+
+<url>http://download.java.net/maven/1</url>+
+<layout>legacy</layout>+
+</pluginRepository>+
+</pluginRepositories>+
+<repositories>+
+<repository>+
+<id>maven2-repository.dev.java.net</id>+
+<name>Java.net Repository for Maven</name>+
+<url>http://download.java.net/maven/2/</url>+
+<layout>default</layout>+
+</repository>+
+<repository>+
+<id>maven-repository.dev.java.net</id>+
+<name>Java.net Maven 1 Repository (legacy)</name>+
+<url>http://download.java.net/maven/1</url>+
+<layout>legacy</layout>+
+</repository>+
+<repository>+
+<id>glassfish-repository</id>+
+<name>Java.net Repository for Glassfish</name>+
+<url>http://download.java.net/maven/glassfish</url>+
+</repository>+
+</repositories>+
+</project>+
Can anyonr contribute? -
Cookie Problem With JSP and Tomcat
I have a tiny web application developed for my project thing.
I am facing a problem while maintaining sessions with Cookie. I use Tomcat 3.2.1 Web Server and JSP 1.2 Specifications for my web application.
I have created a page which creates a cookie and stores it in the client's PC, so when the same client visits the site, he can be remembered. Now while surfing the site in the same session, the site remembers the client. But once the client closes the browser and tries connecting to the site, he cannot be remembered. So I took a look into Temporary Internet Files of the client PC and found no cookie there. So where the cookie gets created and why does it disappears with the session. I have set a time limit of 1 year in the cookie.
Now is that a Problem with Tomcat or with the configuration settings of IE in the client PC?? Or something else???
Reply me Soon...Thanks for your reply.
following is the code for how do i create a cookie...
<%
String custno = custBean.createPreferred();
Cookie c = new Cookie("pc", custno);
c.setVersion(1);
c.setPath("/");
c.setComment("PreferredCustomer");
c.setDomain("think_machine");
//think_machine is the name of the Web Server(Tomcat)
c.setMaxAge(365*24*60*60);
response.addCookie(c);
%>
And the code to read a cookie is..
String custID = null;
Cookie[] cookies = request.getCookies();
for(int i = 0; i < cookies.length; i++)
if(cookies.getName().equals("pc"))
custID = cookies[i].getValue();
break;
One more thing I would like to let you know, that i access this from the same PC on which the Web Server is installed. Means the Server and the client are both one and the same PC. -
Right problem with apache and tomcat
Bonjour;
I use a user login "apache" to stop/start Apache and tomcat. Because never launching apache et tomcat as root.
But I have the following problem with apache (file error.log) :
[Tue May 6 17:26:22 2003] [error] Connection "warpConnection" cannot connect
[Tue May 6 17:26:22 2003] [error] Cannot open connection "warpConnection"
[Tue May 6 17:27:01 2003] [error] Re-Trying to deploy connections
As root the error msg does'nt exists (lost)
Best regards;
A+;Run it from the shell to see whats wrong:
# httpd -
Authentication problem with JWS and TOMCAT
Hi everyone !
I have a problem with Java Web Start (1.0.1) and Tomcat (4.0.4).
I'm trying to call my application via Web server Tomcat with restricting access.
My configuration is the following :
The deployment descriptor web.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<mime-mapping>
<extension>jar</extension>
<mime-type>application/java-archive</mime-type>
</mime-mapping>
<mime-mapping>
<extension>java</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<mime-mapping>
<extension>jnlp</extension>
<mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
<mime-mapping>
<extension>JNLP</extension>
<mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
<!-- Define a Security Constraint on this Application -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- NOTE: This role is not present in the default users file -->
<role-name>standard</role-name>
</auth-constraint>
</security-constraint>
<!-- Define the Login Configuration for this Application -->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>MY APPL</realm-name>
</login-config>
</web-app>
And jnlp File is:
<jnlp
spec="1.0+"
codebase="http://host:8080/Official/"
href="Application.jnlp">
<information>
<title>Application release 0.10</title>
<vendor> XXXX </vendor>
<homepage href="/"/>
<description>Application</description>
<description kind="short">My Application</description>
<icon href="Icon.gif"/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.3"/>
<jar href="Jar1.jar"/>
<jar href="Jar2.jar"/>
<jar href="Jar3.jar"/>
<jar href="Jar4.jar"/>
<jar href="Jar5.jar"/>
<jar href="Jar6.jar"/>
<jar href="Jar7.jar"/>
<jar href="Jar8.jar"/>
<jar href="Jar9.jar"/>
<jar href="Jar10.jar"/>
<jar href="MyApplication.jar"/>
</resources>
<application-desc main-class="com.xxxx.tool.cm.MyApplication"/>
</jnlp>
With the above configuration the Java Web Start not work.
I'm expecting the message box for insert username and password instead it returns the messagge error :
An error occurred while launching/running the application.
Vendor: XXXX
Category: Download Error
Unable to load resource: http://host:8080/Official/Application.jnlp
The Exception error is:
JNLPException[category: Download Error : Exception: java.lang.NullPointerException : LaunchDesc: null ]
at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
at com.sun.javaws.cache.DownloadProtocol.isLaunchFileUpdateAvailable(Unknown Source)
at com.sun.javaws.LaunchDownload.getUpdatedLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.downloadResources(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have tried to remove the restrict access in the deployment descriptor (web.xml) and java Web Start WORKS !!!!!!
I'll appreciate any idea or hint!
Thanks in advanceCheck this out
http://forum.java.sun.com/thread.jsp?forum=38&thread=456250
Mad Einstein -
Simple setup problems with JSTL and Tomcat
Hi all, I'm having some problems getting JSTL to work the 1st time. JSTL setup seems to be a common problem for relative newbies, but having read previous threads, I still haven't been able to solve my problem so hopefully someone can help:
the jstl.jar and standard.jar are in my WEB-INF/lib directory, so I don't think it's a classpath problem.
My jsp page has the following at the top:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>Later, I reference a bean var with :
<c:out value="My var is : ${var.property}"/>In my web.xml I have:
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/lib/jstl.jar</taglib-location>
</taglib>And I've placed the actual tld (c.tld) in the WEB-INF directory.
On startup I get the error when compiling the JSP:
No such tag out in the tag library imported with prefix c
Can anyone help here?
Thanks in advance,
MikeI think this note from the JSTL mailing list by Shawn Bayern, one of the lead developers of Jakarta JSTL and the author of "JSTL In Action", will clarify it:
http://www.mail-archive.com/[email protected]/msg04587.html
Don't put that <taglib> in your web.xml. All the books tell you to do it, but Shawn Bayern has the right answer. The URI should be the one that's in the TLD JAR .tld files.
I use JSTL and Tomcat 4.1.24 without the <taglib>, and it works fine. - MOD -
Syncing problem with AppleTV and HP w/ Windows Vista
Vital Stats:
HP Media Center PC
Windows Vista Home Premium
iTunes 7.6.2.9
AppleTV 40GB Software Version 2.0.2 Wireless DHCP
I have been trying to sync my Apple TV with iTunes and keep getting the error:
The Apple TV "Downstairs Apple TV" is not responding.
Check that any firewall software running on this computer has been set to allow communication on port 3689.
I have done the obvious. I have checked the firewall software on my computer and have manually set the port as open and apparently when iTunes installs it also puts port information into the Windows Firewall. I have performed a factory reset on the Apple TV, reinstalled iTunes, checked my router and still it's a 'no go'.
Any suggestions?Welcome to the Discussion Forums.
Check your router for port forward/NAT rules that may involve ports 5353 and 3689, check that you haven't got the tv isolated at the router also.
Security software and file sharing applications may also be interfering with these ports take a look at any software on your PC that might be doing this. -
I don't know where the problem originate, the only thing in my memory is that the program worked very well on my PC yesterday, but today, without even slightest change, it doesn't work anymore. As to debug it, I simplified the codes to the least, but it still refuse to work. I was beaten down by this problem totally, and cannot make out any solution for it, so, I come here, hoping to find a warrior to kill this damned bug for me.
My program is a Servlet, but for the purpose of debugging, I have recode it to an Application/Servlet. When run as a application, I can get the result expected, but as a Servlet, :-(, maybe you should see it by yourself. My server software is Tomcat 4.1.15, and the JDK version is 1.4.0. To excute this program, you should add Data Source "Test" to ODBC.
///////////////////////code begins/////////////////////////
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class Ex extends HttpServlet
int ErrorType = 0;
String err = new String("");
public static void main(String args[]) throws Exception{
Ex cEx = new Ex();
cEx.init();
System.out.println(cEx.ErrorType);
public void init() {
String url = "jdbc:odbc:Test";
ErrorType = 3; //passed
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
ErrorType = 1; //trapped in Class.forName
try{
Connection c = DriverManager.getConnection(url);
} catch (SQLException e) {
e.printStackTrace();
ErrorType = 2; //trapped in DriverManager.getConnection
err = e.getMessage();
public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException {
res.setContentType("text/html; charset=GB2312");
PrintWriter out = res.getWriter();
out.println("Success " + "<p>" + ErrorType + "<p>" +err);
out.close();
//////////////////////////code ends///////////////////////////////
The result from the Servlet tell me that the problem occurred within the connection process, I don't know who should be responsible to this - Tomcat or JDBC?If you could print the exception that you got then that would help :) In the mean time, I could make a guess. It is unlikely that your application server (in this case, Tomcat) is blocking connections from your servlet. So the problem is either with JDBC directly or with the underlying datasource. It seems unlikely that it is JDBC given that you have stated that the code has not changed and it works in application form.
My guess would be that you are coming up against some sort of security constraint (eg: your DBMS is letting you log in from one IP but not another?, your Java plug-in security policy is disallowing the connection?). It's hard to say.
But if it works as an application but not via a servlet then you could try putting this in your java.policy file, which is located in the directory where your plug-ins are installed (eg: "C:\Program Files\Java\<version>\lib\security\") on Windows systems;
permission java.net.SocketPermission "bend xp:1099", "listen,connect,accept";
Try that, see if it works :)
Ben -
Problem with drag and drop application windows from one workspace to another
I work with multiple desktops (Spaces) and before I freely dragged the mouse a window from one space to another, now the mouse rests on the edge of space and the application does not become the next space. What am I doing wrong or where this option is set?
After the publication of the problem has disappeared, the window is dragged. Miracle! )
-
Connection Problem with Oracle and Tomcat.
I was able to enter Oracle using scott/tiger when I did not connect Tomcat.But when I connect tomcat I am unable to log onto Oracle.
When I logged to the database then I tried to start the Tomcat but it gave an exception.So I went to the task manager and ended the running processes like isqlplus.exe, oracle.exe, tomcat.exe, apache.exe.When I ended all the processes except oracle.exe, tomcat gave an exception. But when I ended oracle.exe Tomcat started working but Oracle stopped working. I don't know what the problem is.
Can anyone help me out?
Thanks,
Sravanthi.> Can anyone help me out?
Yeah sure. Is there a SQL or PL/SQL related question in there.. somewhere.. hiding away?
After all, you do realise that the name of this forum is SQL and PL/SQL and that it deals with the SQL and PL/SQL languages in the Oracle server.. right? -
I'm tired of this problem of not being able to access itunes on my laptop and now no internet access despite connection and strength being excellent. What are windows playing at? Worked perfectly well until recently. Very frustrating and time consuming!
Just a few lines to assure you you are not alone regarding speed delivery. By no means.
I'm on Infinity 2 with HH5 - was virtually guaranteed 63 d/l and told possibly even up to 78. My actual speeds are nearer 15 (yes 15!) to 28 d/l if I am lucky. I've played all the obligatory games of checking and posting and reviewing my HH stats - and of course wasting my time with India "help" customer services who are instructed to read from a script of inane generalities which are usually completely irrelevant and have no connection whatsoever with a user's Specific problem.
It more often than not turns out that the automated monitoring system imposes a software called DLM = Digital Line Management = which (with the endless excuse of improving line stability) increases noise margins and drastically reduces speed. This can kick in pretty rapidly and can take at least 3 to 4 days to modify itself - if indeed at all!!! Usually an Openreach engineer visit is then needed - who will re-set the Profile to what it is you are supposed to be paying for ..... then of course it is totally possible that DLM will re-emerge and the same old cycle of troubles will have to be endured.
We pay in good faith at the outset on the back of so many promises - only to be cynically let down and dismissed once signed up. It is quite wrong we have to continually argue our case to (try) to get anywhere and are always reminded that we are tied into contracts with expensive escape clauses - or that an engineer's visit is only free IF it is proved the fault is not inside your house - which it very rarely is! This is often more an Ordeal than a subscribed service. Superfast reliable Broadband in the UK ? Ha! -
Problem with StatelessConnectionPool and Threads on Windows XP
I am trying to use a StatelessConnectionPool in a multithreaded app under Windows using 10g. The problem is that when my application is exiting and I go to terminate the StatelessConnectionPool, I get an access violation inside Environment::terminateStatlessConnectionPool.
A short program that demonstrates the problem is at the end of this post. One thing I have noticed is that by calling terminateConnection inside the thread instead of releaseConnection the problem goes away. However, performance really degrades. Thanks in advance.
#include <windows.h>
#include <occi.h>
#include "RegisterDataMappings.h"
#include "Consumers.h"
#include "Thread.h"
using namespace oracle::occi;
Environment* env = NULL;
StatelessConnectionPool* connPool = NULL;
//Derived from opur Thread class
class TestThread : public Thread
public:
TestThread(void){}
protected:
//get an object 10 times, sleeping every 500 msecs in between
virtual DWORD run(void)
printf("Thread 0x%08x Enter...\n", GetCurrentThreadId());
Sleep(500);
int i = 0;
while(i < 10)
try
Connection* conn = connPool->getConnection();
Statement* stmt = conn->createStatement("select Ref(c) from consumers c where pid = 7038878582");
ResultSet* rs = stmt->executeQuery();
if(rs->next())
Ref<Consumers> consumer = rs->getRef(1);
printf("Thread 0x%08x #%d - %.0f\n", GetCurrentThreadId(), i+1, (double)consumer->getconsumerid());
stmt->closeResultSet(rs);
conn->terminateStatement(stmt);
connPool->releaseConnection(conn);
//connPool->terminateConnection(conn);
Sleep(500);
++i;
catch(SQLException& sql)
printf("Oracle exception: %s\n", sql.getMessage().c_str());
printf("Thread 0x%08x Leave...\n", GetCurrentThreadId());
return 0;
//Helper function to create a connection
void createConnection(void)
env = Environment::createEnvironment((Environment::Mode)(Environment::OBJECT|Environment::THREADED_MUTEXED));
RegisterDataMappings(env);
connPool = env->createStatelessConnectionPool("user", "pass", "orcldev", 10, 10, 0, StatelessConnectionPool::HOMOGENEOUS);
//Helper function to terminate a connection
void terminateConnection(void)
env->terminateStatelessConnectionPool(connPool);
Environment::terminateEnvironment(env);
int main(int argc, char* argv[])
try
//Connect to the database
createConnection();
//Create 10 threads and wait for them to complete
const int numThreads = 10;
HANDLE handles[numThreads];
for(int i = 0; i < numThreads; i++)
TestThread* thread = new TestThread;
thread->start();
handles[i] = thread->getThreadHandle();
WaitForMultipleObjects(numThreads, handles, TRUE, INFINITE);
//Clean up
terminateConnection();
catch(SQLException& sql)
printf("SQLException caught: %s\n", sql.getMessage().c_str());
return 0;When I search MetaLink for bug 4183098, it says there's nobug 4183098. Any information on this?
Maybe you are looking for
-
Taking screenshot with java applet using java robot class not working
Hi Everyone, I am using the java applet to take screenshot of the web browser using the java's robot class. Robot objRobot = new Robot (); BufferedImage objBufferedImage = objRobot.createScreenCapture(objRectArea); The thing work good in windows syst
-
Broken Bonjour with Canon MF4350d after 10.6 upgrade - Help Please.
I have been using a Canon 4350d with no problems with 10.5.8 - including Printer Sharing (Bonjour). Now, after updating to 10.6 (now 10.6.2) I can still print fine, but I have lost all Printer Sharing. All settings appear to be right, and my other ma
-
Can I connect another Linksys router to my current Linksys router?
Hello everybody, I have 3 computers in my house. One computer which is used by my brother and he downloads a ton of porn, music, and opens a lot of ports for online gaming. Needless to say he is a very high risk user. I would like to isolate his comp
-
How can i delete pictures to be imported by SD card reader
I cannot delete pictures in ipad mini 1 that is imported by SD card reader previously, plesae show me, thanks.
-
Spotlight search is not working in iphone 6
Spotlight search is not working. It works only when I reboot the device. Also, it works for 10 to 15 min.Please help