This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Sanjib Pal

Greenhorn
+ Follow
since Feb 08, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sanjib Pal

Hi,

I have a big problem when uploading a file greater than 2mb.
When I tried to upload a file greater than 2mb, the browser connection resets instantly, giving an error
Error: 101 ( net::ERROR_CONNECTION_RESET): The connection was reset

In my tomcat's server.xml I have configured the Connector as



the memory of jvm is as



I am using spring framework.

the bean configuration is as



and my java code is as



Please give me a suggestion to solve this problem.

Thanks,
Sanjib
9 years ago
Hi Peter Johnson,

Thanks Peter Johnson you have done a great job for me. My project is now compiling correctly. Many many thanks to you.

thanks
sanjib
Hi Peter Johnson,

I am using m2eclipse and created the project as a maven project. The pom.xml has automatically generated. If I doesn't specify the source file path then eclipse report that "No source to compile" error, and I noticed that the class file are not generated that I need to create the war file and deploy to run the web site. The problem which I faced with this configuration has mentioned in my first post.

My project structure is attached with it as a .jpg image

Please suggest me.

Thanks,
sanjib
Hi Tim

When I changed my pom.xml file as given bellow it gives me build failure

pom.xml

<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.dreamzi.testwebapp</groupId>
<artifactId>quizapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>quizapp Maven Webapp</name>
<url>http://maven.apache.org</url>;
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>quizapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<compileSourceRoots>D:\MyProjects\quizapp\src\resources</compileSourceRoots>
<source>1.5</source>
<target>1.5</target>
</configuration>

</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
</plugin>
</plugins>
</build>
</project>


the error report is as follows


[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building quizapp Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ quizapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ quizapp ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.797s
[INFO] Finished at: Wed Dec 01 19:55:07 GMT+05:30 2010
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project quizapp: Unable to parse configuration of mojo org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile for parameter compileSourceRoots: Cannot assign configuration entry 'compileSourceRoots' to 'interface java.util.List' from 'D:\MyProjects\quizapp\src\resources', which is of type class java.lang.String -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException


please give me advice to solve this problem

thanks
sanjib
Hi Tim Holloway,

Thanks for your advice.

This is actually a web project and no class file is generating to the classes folder, even in the packaging file .war file. So when I deploy the war file in the server it is not working properly. My effective pom is as given bellow.



<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.dreamzi.testwebapp</groupId>
<artifactId>quizapp</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>quizapp Maven Webapp</name>
<url>http://maven.apache.org</url>;
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Repository Switchboard</name>
<url>http://repo1.maven.org/maven2</url>;
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>;
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>D:\MyProjects\quizapp\src\main\java</sourceDirectory>
<scriptSourceDirectory>D:\MyProjects\quizapp\src\main\scripts</scriptSourceDirectory>
<testSourceDirectory>D:\MyProjects\quizapp\src\test\java</testSourceDirectory>
<outputDirectory>D:\MyProjects\quizapp\target\classes</outputDirectory>
<testOutputDirectory>D:\MyProjects\quizapp\target\test-classes</testOutputDirectory>
<resources>
<resource>
<directory>D:\MyProjects\quizapp\src\main\resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>D:\MyProjects\quizapp\src\test\resources</directory>
</testResource>
</testResources>
<directory>D:\MyProjects\quizapp\target</directory>
<finalName>quizapp</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<compileSourceRoots>D:\MyProjects\quizapp\src\resources</compileSourceRoots>
<source>1.5</source>
<target>1.5</target>
</configuration>
</execution>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compileSourceRoots>D:\MyProjects\quizapp\src\resources</compileSourceRoots>
<source>1.5</source>
<target>1.5</target>
</configuration>
</execution>
</executions>
<configuration>
<compileSourceRoots>D:\MyProjects\quizapp\src\resources</compileSourceRoots>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<id>default-war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>default-install</id>
<phase>install</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>default-resources</id>
<phase>process-resources</phase>
<goals>
<goal>resources</goal>
</goals>
</execution>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>default-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.0.1</version>
<executions>
<execution>
<id>default-site</id>
<phase>site</phase>
<goals>
<goal>site</goal>
</goals>
<configuration>
<outputDirectory>D:\MyProjects\quizapp\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
<execution>
<id>default-deploy</id>
<phase>site-deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<outputDirectory>D:\MyProjects\quizapp\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</execution>
</executions>
<configuration>
<outputDirectory>D:\MyProjects\quizapp\target\site</outputDirectory>
<reportPlugins>
<reportPlugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</reportPlugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<outputDirectory>D:\MyProjects\quizapp\target\site</outputDirectory>
</reporting>
</project>


please give me some advice to successfully compile and generate the class file in the war package.

thanks,
Sanjib Pal
Hi All,

I am facing a big problem when building java web project with eclipse and maven. I can't successfully build this project.

when I compiling the project it gives the following error

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building quizapp Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ quizapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ quizapp ---
[INFO] No sources to compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.016s
[INFO] Finished at: Mon Nov 29 19:59:25 GMT+05:30 2010
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------

my project's pom.xml file is as

<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.dreamzi.testwebapp</groupId>
<artifactId>quizapp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>quizapp Maven Webapp</name>
<url>http://maven.apache.org</url>;
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>quizapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
</plugins>
</build>
</project>


web.xml file is as

<!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>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>Login</servlet-name>
<display-name>Login</display-name>
<description>servlet that handles the user login authentication</description>
<servlet-class>com.dreamzi.quizapps.controller.Login</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/Login</url-pattern>
</servlet-mapping>
</web-app>


Please give me some advice to solve the problem

Thanks in advance

Sanjib Pal
Hi Tim,

Thanks in advance.
Is there any cvs server for free ? so that I can install it in my machine as a server and work from eclipse's cvs client. I saw a server cvsnt for windows which is not free. I have download the cvsnt server and installed it but still facing the problem to configuring the client and server. please give me the details instruction for configuration.

Thanks,
Sanjib Pal
Hi All,

I am facing a problem, actually I want to setup an environment where five user will work on java project with eclipse. I have downloaded the TortoiseCVS and installed it but can't configuring it properly. I wanna used one local machine as a server and all other machines will work under a repository. I couldn't create the repository.

Please help me in details.

Thanks,
Sanjib Pal
Hi all,

Thanks everybody. Those replays cleared my concepts.

Sanjib
11 years ago
Hi All,

Could anybody please specify when we should use the comparable interface to sort the collection and when to use comparator interface? Since both of them are use for sort any collection. Please specify in details...

Thanks,
Sanjib
11 years ago
Hi Tim,
Thanks once again. I will try it.

Sanjib
11 years ago
Hi Tim,

That's fine I have got your point. Just to say could you give me an example how can I create a web-inf resource and use the resource for upload. One more thing if i upload the files in say "C:\var\lib\uploads" in this folder then how can I display it from my jsp page/ I mean like <img src=? />. So please explain with an example, it would be very helpful for me.

Thanks in advance,
Sanjib
11 years ago
Hi all,

In my tomcat server .WAR archive not unpacking. I need to unpack the .war file in the server.
How can I do that,

Thanks,
Sanjib
11 years ago

Always upload to a directory external to Tomcat and its supporting directories. Or expect the consequences.



Could you please specify the path where to upload outside the war file ? I got confused what would be the path

Thanks,
sanjib
11 years ago
Hi all,

I have facing a problem such that when I am testing my project in local machine image is uploading successfully, but when I deployed the project in client server image not uploading. Is there any problem regarding file permission?

I have deployed the as a WAR file in the server.

My servlet code is as



My File Uploader code is as



Please help me.

Thanks in advance,
Sanjib
11 years ago