Thursday, October 8, 2015

org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0


org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0

Problem :


I came across this common exception when i was setting up datasource for spring application.

Exception I Encountered Was :


###################################################################################################################

org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0

###################################################################################################################

Solution :


When I was setting up the datasource for Spring Application and had to use BasicDataSource jar file. The jar which i was using was not compatible with the java / jvm version i was using.


run mvn dependency:tree then you will know the exact jar which is compatible with the java version you have to use then change the version in dependency and again run the maven command to resolve the exception. Hope this helps resolve your exception, Happy Coding.

Similar Exception :


- org/apache/commons/dbcp2/BasicDataSource : Unsupported major.minor version 51.0
- UnsupportedClassVersionError unsupported major.minor version 51.0
- unsupported major.minor version 51.0 unable to load class


Friday, July 31, 2015

The method print() is undefined for the type Controller


The method print() is undefined for the type Controller

Problem :


I came across this common exception when i was using mocks for unit testing spring application.

Exception I Encountered Was :


###################################################################################################################

The method print() is undefined for the type Controller

###################################################################################################################

Solution :


When unit testing your spring application with mocks you need to make sure that you are using the neccessary static imports in your code.
See below for the list of static imports to use.
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; 

Once i had the static import in place it resolved the exception. Hope this helps resolve your exception, Happy Coding.

Similar Exception :


- How to test a spring controller method by using MockMvc?
- My test helper methods get() status() are undefined
- the method post(string) is undefined for controller test
- Integration testing of spring MVC applicaitons


Tuesday, June 30, 2015

The method post(string) is undefined for controller test


The method post(string) is undefined for controller test

Problem :


I came across this common exception when i was using mocks for unit testing spring application.

Exception I Encountered Was :


################################################################################################### ################

the method post(string) is undefined for controller test

################################################################################################### ################

Solution :


When unit testing your spring application with mocks you need to make sure that you are using the necessary static imports in your code.
See below for the list of static imports to use.
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

Once i had the static imports in place it resolved the exception. Hope this helps resolve your exception, Happy Coding.

Similar Exception :


- How to test a spring controller method by using MockMvc?
- My test helper methods get() status() are undefined
- the method post(string) is undefined for controller test
- Integration testing of spring MVC applicaitons
- the method print() is undefined for the type Controller


Tuesday, June 23, 2015

project build error: 'dependencies.dependency.groupid' for null:spring-test.jar


project build error: 'dependencies.dependency.groupid' for null:spring-test.jar

Problem :


I came across this common exception when i was manually updating maven dependencies in eclipse.

Exception I Encountered Was :


###################################################################################################################

project build error: 'dependencies.dependency.groupid' for null:spring-test.jar

###################################################################################################################

Solution :


I was manullay updating maven dependencies and gave artifact groupid instead of groupId (I is caps), be specific when you type the artifacts. Do cross check your artifacts if you have manually updated your artifacts.

Similar Exception :

     

- 'dependencies.dependency.version' is missing error, but version is managed in parent
- 'dependencies.dependency.groupid' for null:spring-test.jar
- Missing artifact but jars are in place
- org.springframework.security:spring-security-parent:jar:3.0.7.RELEASE:compile
- Could not resolve dependencies, artifacts could not be resolved



Wednesday, June 10, 2015

The type password is not accessible due to restriction on required library


The type password is not accessible due to restriction on required library

Problem :


We come across this common exception when i was using com.sun.* pacakge in our java code.

Exception I Encountered Was :


###################################################################################################################

the type password is not accessible due to restriction on required library

###################################################################################################################

Solution :


I was using com/sun/xml/internal.* package in my code. I had to update Access rules in eclipse to overcome this exception.
Please refer below to see how it was fixed.

It can be fixed in the follows two ways :


First method :

1) Go to Eclipse 2) Click on Project -> Properties 3) Select Java Build Path in left hand navigation 4) Select Libraries tab. 5) Then Expand JRE System Library entry and Select "Access rules" and hit the Edit button. 6) A new dialog windows opens 7) Click the add button and click ok. 8) Select Accessible in resolution and in Rule pattern add "com/sun/xml/internal/**". Second Method : 1) Go to Eclipse 2) Click on Project -> Properties 3) Select Java Build Path in left hand navigation 4) Select Libraries tab. 5) Select JRE System Library and click remove. 6) Click on Add Library and select JRE System Library 7) Select workspace default library or the one you want to select and click Finish. 8) For me the default worked. I hope this resolves your above exception / error, happy coding.


Similar Exception :

     

- the type password is not accessible due to restriction on required library
- Project won't compile when using com.sun.xml.internal.ws.server.UnsupportedMediaException
- How to overcome “package com.sun.xml.internal.xxx does not exist”


Wednesday, June 3, 2015

No naming context bound to this class loader


No naming context bound to this class loader

Problem :


We come across this common exception when i removed the project and re-imported it again in eclipse.

Exception I Encountered Was :


###################################################################################################################

No naming context bound to this class loader

###################################################################################################################

Solution :


I was using existing maven project in Eclipse. So i had to run a maven command to add the porject and then referesh the project to resolve it.
Please refer below to see how it was fixed.

Example :


- Follow these steps to resolve the exception :

1) Open DOS command prompt and navigate to your project folder where you have your pom.xml file. 2) Run the following command :
mvn eclipse:eclipse -Dwtpversion=2.0
3) Refresh the project in eclipse. 4) Now right click on server and select "add and remove" option, you should see your applicaion in the list to add. I hope this resolves your above exception / error, happy coding.


Similar Exception :

     

- No naming context bound to this class loader
- There are No resources that can be added or removed from the server
- How can I add my application to Tomcat in Eclipse?
- What needs to be done to add a project to a Server in Eclipse ?
- There are no projects that can be added or removed from the server


Wednesday, April 22, 2015

There are No resources that can be added or removed from the server


There are No resources that can be added or removed from the server

Problem :


We come across this common exception when we are not able to add application to tomcat server thru add and remove option in eclipse.

Exception I Encountered Was :


###################################################################################################################

There are No resources that can be added or removed from the server

###################################################################################################################

Solution :


I was using existing maven project in Eclipse. So i had to run a maven command to add the project and then refresh the project to resolve it.
Please refer below to see how it was fixed.

Example :


- Follow these steps to resolve the exception :

1) Open DOS command prompt and navigate to your project folder where you have your pom.xml file. 2) Run the following command :
mvn eclipse:eclipse -Dwtpversion=2.0
3) Refresh the project in eclipse. 4) Now right click on server and select "add and remove" option, you should see your applicaion in the list to add. I hope this resolves your above exception / error, happy coding.


Similar Exception :

     

- There are No resources that can be added or removed from the server
- How can I add my application to Tomcat in Eclipse?
- What needs to be done to add a project to a Server in Eclipse ?
- There are no projects that can be added or removed from the server


Thursday, May 8, 2014

cvc-complex-type.2.3: Element 'beans:bean' cannot have character [children], because the type's content type is element-only.


cvc-complex-type.2.3: Element 'beans:bean' cannot have character [children], because the type's content type is element-only.

Problem :


We come across this common exception when using any xml configuration files, infact any xml file with namespace.

Exception I Encountered Was :


###################################################################################################################

cvc-complex-type.2.3: Element 'beans:bean' cannot have character [children], because the type's content type is element-only.

###################################################################################################################

Solution :


This exception was caused when i was trying to copy paste a default configuration for my security-app-context.xml file for my Spring Security cofiguration file. Mistakingly i had copied an extra closing tag. Please refer below to see how i fixed it.

Example :


- Follow the below steps outlined and you should be able to resolve it :

1)Try to open the xml in Iexplorer or any xml view tool and see whether the xml is rendered properly. 2) Or you can do a ctrl + shift + F to format the xml file and see if xml is welformed or not. 3)With the above step you should be able to find the exact location where you need to make changes to make the xml welformed. 4)In my case i had to just remove the extra "<" closing tag to resolve the issue. I hope this resolves your above exception, happy coding.


Similar Exception :

     

- cvc-complex-type.2.3: Element 'beans:bean' cannot have character [children], because the type's content type is element-only.
- cvc-complex-type.2.3:Element 'beans' cannot have character [children] type's content type is element
- Element 'beans' cannot have character [children], because the type's content type is


Thursday, February 13, 2014

java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Problem :


We come across this common exception when starting STS Eclipse or trying to compile java classes through maven command.

Exception I Encountered Was :


###################################################################################################################

[ERROR] PermGen space -> [Help 1]
java.lang.OutOfMemoryError: PermGen space
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(Cl
assRealm.java:389)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(
SelfFirstStrategy.java:42)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadCl
ass(ClassRealm.java:259)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:242)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:227)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(Cl
assRealm.java:389)
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(
SelfFirstStrategy.java:42)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadCl
ass(ClassRealm.java:259)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:242)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm
.java:227)
        at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJar
Mojo.java:202)
        at org.apache.maven.plugin.jar.AbstractJarMojo.execute(AbstractJarMojo.j
ava:255)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
[ERROR]
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryErr
or
###################################################################################################################

Solution :


This exception was caused when i was starting the Eclipse for the very first time and also while i was using the mvn compile command to compile the java classes. To resolve this exception i increased the memory size in command prompt before restarting eclipse and increasing the memory in maven options. See below for the examples.

Example :


- Follow the above steps outlined and you should be able to resolve it :

1)Add this to command line JVM before starting tomcat server : -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled 2)For Maven options use this : set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m This should resolve the above exceptions.


Similar Exception :

     

- java.lang.OutOfMemoryError: PermGen space


ORA-06502: PL/SQL: numeric or value error

ORA-06502: PL/SQL: numeric or value error

Problem :


We come across this common exception when we are using PL/SQL or we receive soap related webservice response.

Exception I Encountered Was :


###################################################################################################################

ORA-06502: PL/SQL: numeric or value error

###################################################################################################################

Solution :


This exception was caused when i was trying to assign a value which was big enough for a input value. It started throwing these errors. It was also caused when trying to insert too many characters into a string field.

Make sure the input value you are giving for the web service are not violating the limit set by the web service.

Example :


- Validate the input fields against the web service fields and you should be able to resolve this issue.


Similar Exception :

     

- ORA-06502: PL/SQL: numeric or value error


Tuesday, February 11, 2014

resource is out of sync with the file system


resource is out of sync with the file system

Problem :


We come across this common exception when using eclipse and try to start the tomcat server.

Exception I Encountered Was :


###################################################################################################################

resource is out of sync with the file system ... with may file names listed...

###################################################################################################################

Solution :


This exception was caused when i switched to a different work space and restarted tomcat server. It started throwing these errors. Please follow any of the solutions to vanish the error.

1) Right click on the file or project and select refresh. This should be enough to clear all the errors related to resource is out of sync with the file system exception.

2) You can set the preferences to automatically refresh your project with the following steps :
  • Select Window in eclipse menu then
  • Select Preferences
  • Select & Expand first tab General and then
  • Select Workspace and then
  • Select the option "Refresh Automatically" or "Refresh using native hooks or polling" then
  • Click apply
  • Click Ok

  • Now you are good to go.....


Example :


- Follow the above steps outlined and you should be able to resolve it.


Similar Exception :

     

- resource is out of sync with the file system


Wednesday, January 22, 2014

org.springframework.ws.client.WebServiceTransportException Not Found 404

SEVERE: Servlet.service() for servlet [appServlet] in context with path [/smdealer] threw exception org.springframework.ws.client.WebServiceTransportException: Not Found [404]

Problem :


We come across this common exception when using web services with spring.

Exception I Encountered Was :


###################################################################################################################

SEVERE: Servlet.service() for servlet [appServlet] in context with path [/smdealer] threw exception
org.springframework.ws.client.WebServiceTransportException: Not Found [404]
 at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:624)
 at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:548)
 at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:499)
 at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:348)
 at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:342)
 at com.tracfone.udp.delegate.impl.AgentServiceImpl.authenticate(AgentServiceImpl.java:69)
 at com.tracfone.udp.security.CustomAuthenticationProvider.authenticate(CustomAuthenticationProvider.java:41)
 at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)
 at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
 at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthenticatio

###################################################################################################################

Solution :


This exception was caused when i was using incorrect uri for the web service for authentication. The environment variable was invalid. I just updated the environment variable in uri and it worked fine.

Example :


- Pointing the correct URI for the service worked for me.

Similar Exception :

     
- org.springframework.ws.client.WebServiceTransportException: Not Found [404]
- No endpoint mapping found for ....
- Servlet.service() for servlet in context with path threw exception


Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds

Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

Problem :


We come across this common exception when start / restart tomcat web server and it doesn't start in default 45 seconds.

Exception I Encountered Was :


###################################################################################################################

Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.

###################################################################################################################

Solution :


Generally this exception is caused when Tomcat Server doesnt start within the default server startup time which is 45 second. To resolve this you can increase the server timeout settings as explained below.

Example :


- Double click on the server in eclipse
- In Overview tab select Timeouts
- For Start (in seconds) increase the time in seconds appropriately
- Save and restart the server
- This should resolve the exception.

Similar Exception :

     
- Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds
- If the server requires more time, try increasing the timeout in the server editor


ERROR: org.springframework.web.context.ContextLoader - Context initialization failed

ERROR: org.springframework.web.context.ContextLoader - Context initialization failed

Problem :


We come across this common exception when using Java Spring application.

Exception I Encountered Was :


###################################################################################################################

ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
###################################################################################################################

Solution :


This exception was caused when i did not add the maven dependencies to the build path. I was using eclipse with maven, so had to include the maven dependencies in the build path as explained below.

Example :


- Adding Maven dependencies in project web deployment assembly : 
          
  • Open project properties(example: In project explorer right Click on project name to select "Properties").
  • Select "Deployment Assembly".
  • Click "Add..." button on the right navigation.
  • Select "Java Build Path Entries" from menu of Directive Type and then click "Next".
  • Select "Maven Dependencies" from Java Build Path Entries menu and then click "Finish".
  • Now the "Maven Dependencies" should be added to the Web Deployment Assembly.
- When using Eclipse WDT and using unmodified and previously working project :
  • If Tomcat is running Stop it
  • Open the "Servers" view: Window then select "Show view" and then select "Other" > Server > Servers
  • Right Click on the Tomcat Server and then select "Clean Tomcat Work Directory".
  • Right Click on the Tomcat Server and then select "Clean"
  • Restart the Tomcat Server
The above solution should resolve the exception.

Similar Exception :

     
- ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

java.lang.ClassFormatError: Duplicate method name signature in class file

java.lang.ClassFormatError: Duplicate method name&signature in class file

Problem :


We come across this common exception when using eclipse.

Exception I Encountered Was :


###################################################################################################################

java.lang.ClassFormatError: Duplicate method name signature in class file

###################################################################################################################

Solution :


This exception was caused when i was importing maven project in my eclipse. After importing the project and starting the server i came across this common exception. Please see the below explanation to resolve the exception.


Example :


When trying to import a already existing Maven project, select / browse the appropriate folder. Then click on finish rather than clicking the next button.

Clicking the next button created a different package structure which actually caused the exception "java.lang.ClassFormatError".

Similar Exception :

     

- java.lang.ClassFormatError: Duplicate method name signature in class file


org.springframework.beans.factory.BeanCreationException: Error creating bean with name ...... Initialization of bean failed


org.springframework.beans.factory.BeanCreationException: Error creating bean with name

Problem :


We come across this common exception when using spring and the properties file is not updated for the values defined in the common view interceptor file.

Exception I Encountered Was :


###################################################################################################################

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 
'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': 
Initialization of bean failed; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#1': 
Cannot create inner bean 
'CommonViewInterceptor' of type [com.udp.interceptor.CommonViewInterceptor]while setting constructor argument; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'CommonViewInterceptor#1':
Injection of autowired dependencies failed; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Could not autowire field: private java.lang.String com.udp.interceptor.CommonViewInterceptor.UrlSimActivation;
nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'url.sim.activation'

###################################################################################################################

Solution :


This exception was caused when i did not add "url.sim.activation" property to the properties file. Since the Common view interceptor could not find a definite value for "url.sim.activation" in properties i was getting this exception.

Example :


- Just add a property value called "url.sim.activation" and give a relevant URL and restart the server


Similar Exception :

     

- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0'
- Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException
- java.lang.IllegalArgumentException

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

Problem :


We come across this common exception when spring libraries are not found by the compiler.

Exception I Encountered Was :


#########################################################################################

SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Jan 20, 2014 12:17:38 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.request.RequestContextListener
java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Jan 20, 2014 12:17:38 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

#########################################################################################

Solution :


This exception was caused when i did'nt add the maven dependencies to the build path. I was using eclipse with maven, so had to include the maven dependencies in the build path as explained below.



Example :


- Adding Maven dependencies in project web deployment assembly : 
          
  • Open project properties(example: In project explorer rightClick on project name to select "Properties").
  • Select "Deployment Assembly".
  • Click "Add..." button on the right navigation.
  • Select "Java Build Path Entries" from menu of Directive Type and then click "Next".
  • Select "Maven Dependencies" from Java Build Path Entries menu and then click "Finish".
  • Now the "Maven Dependencies" should be added to the Web Deployment Assembly.
- When using Eclipse WDT and using not modified and project which was working earlier :
  • If Tomcat is running Stop it
  • Open the "Servers" view: Window then select "Show view" and then select "Other" > Server > Servers
  • Right Click on the Tomcat Server and then select "Clean Tomcat Work Directory".
  • Right Click on the Tomcat Server and then select "Clean"
  • Restart the Tomcat Server
The above solution should resolve the exception.



Similar Exception :

     

- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 



cannot find the tag library descriptor for http //java.sun.com/jsp/jstl/core

cannot find the tag library descriptor for http //java.sun.com/jsp/jstl/core

Problem :


We come across this common exception when we are using jsp's with tag libraries.

Exception I Encountered Was :


#########################################################################################

cannot find the tag library descriptor for http //java.sun.com/jsp/jstl/core

#########################################################################################

Solution :


This exception was caused when i did not add the jstl.jar to my class path. I was using maven, so had to include it in my dependency and update web.xml file as explained below.



Example :


- General class path : 
configure the exact path in the Environment Variable for classpath
- Maven Dependency :
<dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> <scope>compile</scope> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> <scope>compile</scope> </dependency>
- Web.xml :
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

Similar Exception :

     

- cannot find the tag library descriptor for http //java.sun.com/jsp/jstl/core 



Wednesday, December 18, 2013

webclient.dll failed to open file for writing

webclient.dll failed to open file for writing

Problem :


We come across this common exception when we are trying to install Qualiy Center 10 in Internet Explorer 8 or above. I was using windows 7 operating system. Lets see how we can resolve this.

Exception I Encountered Was :


#########################################################################################
The following client components where not downloaded successfully :

1 . ExtensibilityAPI.dll :
(Error 5) Access is denied.
Failed to open file for writing

2 . OTAClient.dll :
(Error 5) Access is denied.
Failed to open file for writing

3 . WebClient.dll :
(Error 5) Access is denied.
Failed to open file for writing

4 . QCClientUI.ocx :
(Error 5) Access is denied.
Failed to open file for writing

5 . wexectrl.exe :
(Error 5) Access is denied.
Failed to open file for writing

6 . XGO.ocx :
(Error 5) Access is denied.
Failed to open file for writing

7 . OTAXml.dll :
(Error 5) Access is denied.
Failed to open file for writing

8 . OtaReport.dll :
(Error 5) Access is denied.
Failed to open file for writing

9 . SRunner.ocx :
(Error 5) Access is denied.
Failed to open file for writing

10 . TdComandProtocol.exe :
(Error 5) Access is denied.
Failed to open file for writing

11 . sr_exec_agnt.exe :
(Error 5) Access is denied.
Failed to open file for writing

12 . MercResourceLogger.dll :
(Error 5) Access is denied.
Failed to open file for writing

13 . bp_exec_agent.exe :
(Error 5) Access is denied.
Failed to open file for writing

14 . BPTreports.cab :
(Error 5) Access is denied.
Failed to open file for writing

15 . Client.cab :
(Error 5) Access is denied.
Failed to open file for writing

16 . Free_MSR_Player.exe :
(Error 5) Access is denied.
Failed to open file for writing

17 . dsoframer.ocx :
(Error 5) Access is denied.
Failed to open file for writing

18 . VugenTestType.dll :
(Error 5) Access is denied.
Failed to open file for writing

19 . QCClient.UI.Customization.dll :
(Error 5) Access is denied.
Failed to open file for writing

20 . QCClient.UI.Components.BPT.TPC.dll :
(Error 5) Access is denied.
Failed to open file for writing

21 . BuiltInPlugin.cab :
(Error 5) Access is denied.
Failed to open file for writing

22 . Plugin.cab :
(Error 5) Access is denied.
Failed to open file for writing

23 . BuiltInPlugin.dll :
(Error 5) Access is denied.
Failed to open file for writing

24 . ReportViewerForTD.dll :
(Error 5) Access is denied.
Failed to open file for writing

25 . QTGrid.dll :
(Error 5) Access is denied.
Failed to open file for writing

26 . ArgsEditor.dll :
(Error 5) Access is denied.
Failed to open file for writing

27 . Arguments.dll :
(Error 5) Access is denied.
Failed to open file for writing

28 . ConfigViewerForTD.dll :
(Error 5) Access is denied.
Failed to open file for writing

29 . ExGrid.dll :
(Error 5) Access is denied.
Failed to open file for writing

30 . CompStrgHelper.dll :
(Error 5) Access is denied.
Failed to open file for writing

31 . BuiltInScriptView.dll :
(Error 5) Access is denied.
Failed to open file for writing

32 . QAIAd.dll :
(Error 5) Access is denied.
Failed to open file for writing

33 . WITestType.dll :
(Error 5) Access is denied.
Failed to open file for writing

34 . ExtensibilityAPI.dll :
Cannot load type library 

35 . ExtensibilityAPI.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

36 . OTAClient.dll :
Cannot load type library 

37 . OTAClient.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

38 . WebClient.dll :
Cannot load type library 

39 . WebClient.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

40 . QCClientUI.ocx :
Cannot load type library 

41 . QCClientUI.ocx :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

42 . XGO.ocx :
Cannot load type library 

43 . XGO.ocx :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

44 . OTAXml.dll :
Cannot load type library 

45 . OTAXml.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

46 . OtaReport.dll :
Cannot load type library 

47 . OtaReport.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

48 . SRunner.ocx :
Cannot load type library 

49 . SRunner.ocx :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

50 . MercResourceLogger.dll :
Cannot load type library 

51 . MercResourceLogger.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

52 . BPTReportSetup.dll :
Cannot load type library 

53 . BPTReportSetup.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

54 . dsoframer.ocx :
Cannot load type library 

55 . dsoframer.ocx :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

56 . VugenTestType.dll :
Cannot load type library 

57 . VugenTestType.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

58 . Plugin.tlb :
Cannot load type library 

59 . Plugin.tlb :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

60 . BuiltInPlugin.dll :
Cannot load type library 

61 . BuiltInPlugin.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

62 . ReportViewerForTD.dll :
Cannot load type library 

63 . ReportViewerForTD.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

64 . QTGrid.dll :
Cannot load type library 

65 . QTGrid.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

66 . ArgsEditor.dll :
Cannot load type library 

67 . ArgsEditor.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

68 . Arguments.dll :
Cannot load type library 

69 . Arguments.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

70 . ConfigViewerForTD.dll :
Cannot load type library 

71 . ConfigViewerForTD.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

72 . ExGrid.dll :
Cannot load type library 

73 . ExGrid.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

74 . CompStrgHelper.dll :
Cannot load type library 

75 . CompStrgHelper.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

76 . QAIAd.dll :
Cannot load type library 

77 . QAIAd.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

78 . WITestType.dll :
Cannot load type library 

79 . WITestType.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

80 . test_type.ini :
(Error 5) Access is denied.
Failed to open file for writing

Close all connections to Server and try again.

#########################################################################################

Solution :


This exception was caused when i tried to install quality center 10 in internet explorer 10. You should have admin rights to install it. Just right click and say run as administrator and it should install fine.



Example :


Right click the file and select run as administrator.


Similar Exception :

     

- ArgsEditor.dll :
Cannot load type library 

- ArgsEditor.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 

- Arguments.dll :
Cannot load type library 

- Arguments.dll :
(Error 1008) An attempt was made to reference a token that does not exist.
Cannot register type library 



Thursday, January 24, 2013

Failed to load Main-Class manifest attribute from ...


Problem :


We come across this common exception when we are trying to execute a packaged jar file. Lets see how we can resolve this.

Exception I Encountered Was :


#########################################################################################
Failed to load Main-Class manifest attribute from /nfs/home/mrahamatullah/StaleContentProj.jar #########################################################################################

Solution :


This exception was caused when i compiled the jar file without the manifest file and was executing it.
The exact way to compile the jar file is to run :
From the jar files location > jar cvfm *.*
Where ManifestFile includes the classpath and main class definition.


Example :


jar cvfm StaleContentProj.jar manifest.txt *.*


Similar Exception :

     
- Failed to load Main-Class manifest attribute from