Vidu Greg

Greenhorn
+ Follow
since Sep 05, 2005
Merit badge: grant badges
For More
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vidu Greg

I am running a unit test.
My environment is Struts2, Spring, junit.

INFO [org.apache.tiles.impl.BasicTilesContainer] - Initializing Tiles2 container. . .
WARN [org.apache.tiles.impl.BasicTilesContainer] - Unable to find configured definition '/WEB-INF/tiles.xml'

Because of that I am getting no definition found exception...

Here is the code I am using...


--------------------------------------------------------------------
15 years ago
java.lang.NullPointerException at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:17 8)
-
-
- at
vms.junit.test.LoginActionTest.testInterceptorsBySettingDomainObjects(LoginActionTest.java:29)

My LoginActionTest is������-
package vms.junit.test;
import java.util.Map;
import vms.action.LoginAction;
import vms.model.User;
public class LoginActionTest extends BaseStrutsTestCase {

public LoginActionTest(String name) {
super(name);
}
public void testInterceptorsBySettingDomainObjects() throws Exception {
LoginAction action = createAction(LoginAction.class,
�/�, �Login�);
User user = new User();
user.setFirstName(�java�);
user.setLastName(�ranch�);
action.setUser(user);
String result = proxy.execute();
assertEquals(result, �success�);
}

}

I have tiles listener in my web.xml�I dont know why I am getting this error.

Any help will be much appreciated.
15 years ago
Hi

In my java class, I am connecting to a database and want to get a particular column (longblob type) from a particular table. I dont want to get all the rows in one time as I will get memory problem surely.
I want to get a row one by one, So can anyone please tell me how should I do that?
Thanks for the advice.

I am encoutering a different problem now. While running a junit test (In Eclipse right click runas junit test), I am getting this error

java.lang.NoSuchMethodError: org.apache.commons.pool.impl.GenericObjectPool: method <init>()V not found
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1165)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:200)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:261)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy8.saveShipment(Unknown Source)
at vms.service.ShipmentServiceTest.testSaveShipment(ShipmentServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


I have all the jars in my library.

Any guess why I am having this.

Thanks
15 years ago
Hi I am very new to unit testing. I am using Spring framework + struts 2.0
I am trying to test a serice. I have two Context files. When I run this class as a junit test, it gave me an error like could not find local.config.properties file. ApplicationContext.xml file has property configurer.

I like to know if I am running in a proper way or should I create a build file so that applicationContext can find all the properties file or how should I load the properties file.

Here is what I am trying to do--


package myproject.service;
import java.util.List;

import org.springframework.test.AbstractDependencyInjectionSpringContextTests;

import myproject.model.Shipment;
import myproject.model.ShipmentBeanForListing;
import myproject.model.ShipmentSelectionCriteria;

public class ShipmentServiceTest extends
AbstractDependencyInjectionSpringContextTests {

public ShipmentServiceTest(String name) {
super(name);
}

protected String[] getConfigLocations(){
return new String[] {
"file:///C://web_servers//apache-tomcat-6.0.14//webapps//myproject//WEB-INF//applicationContext.xml",
"file:///C://web_servers//apache-tomcat-6.0.14//webapps//vms//WEB-INF//dataAccessContext.xml"};
}


public void testSaveShipment() throws Exception {
ShipmentService service = (ShipmentService) applicationContext.getBean("shipmentService");
Shipment shipment = new Shipment();
shipment.setShipmentId(new Integer(999999));
shipment.setShippingMethod("Courier");
shipment.setShippingCarrier("SKPS");

service.saveShipment(shipment);
System.out.println("Shipment Added");
ShipmentSelectionCriteria selectionCriteria = new ShipmentSelectionCriteria();
selectionCriteria.setShipmentIds("999999");
List<ShipmentBeanForListing> shipments = service.getShipments(selectionCriteria);
assertTrue(shipments.contains(shipment));
}

}
--------------------------------------------------------------------------
Part of applicationContext.xml file
<!-- Configurer that replaces ${...} placeholders with values from properties files -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/${HOST_NAME}.config.properties</value>
<value>WEB-INF/${HOST_NAME}.jdbc.properties</value>
</list>
</property>
<property name="systemPropertiesModeName">
<value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value>
</property>
</bean>
15 years ago
Hi

While writing Blob object in Oracle db, my connection is getting reset.

<<My Code-----
try {
PreparedStatement ps =null;
Connection conn = getConnection();
String sql = "INSERT INTO ATTACHMENT (ATTACHMENT.ID, DOC_DATA) "VALUES (?,?)";
ByteArrayInputStream inStream =
new ByteArrayInputStream(dto.getDoc_Data());
ps = conn.prepareStatement(sql);
ps.setInt(1,attachment_Id);
ps.setBinaryStream(4,inStream,inStream.available());
int rowsAdded = ps.executeUpdate();

} catch (SQLException e) {
e.printStackTrace();
}

>>>

I dont know why my my connection is getting reset so getting an error..i am trying to put a pdf file of size around 45kb...
Hi

I am having a problem in this. I dont want a user to pick a previous date so I am having minimum "now".

<h:inputText value="#{myBean.effectiveDate}" id="effectiveDate">
<f:convertDateTime type="date" pattern="MM/dd/yyyy"/><hx:inputHelperDatePicker />
<hx:validateDateTimeRange minimum="#{now}" />
</h:inputText>

but the problem is when user enters today's date, it validate time also and then gives validation error because by default the time is 12 PM and if user is trying after 12 PM, it will give validation error. I am using a pattern also but still having problem.

thanks in advance.
17 years ago
JSF
hi

I am having actionListener method (Bean Scope -Session) in searchcommandButton. This method is called if only I have immediate="true" option otherwise its not being called. I removed immediate="true" because sometimes I was getting ArrayList out of bound exception. Please help me in this matter.

Thanks

VD
18 years ago
JSF
hi there

I have websphere studio application development 5.0 in my pc, just wondering How should I configure JSF with it. is there I can find some documentation. So far I know that WSAD5.1.2 has JSfaces in it.

thanks

vd
18 years ago
JSF
hi

I am new to JSF. I am trying to learn it. I was trying the tutorials listed at Core Servlets site (http://www.coreservlets.com/JSF-Tutorial/#Section2)..

I checked I have every required file in my web-inf/lib directory but still getting this error when I am trying to access http:\\localhost:8080\jsf-test

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)

root cause

java.lang.NullPointerException
javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.


Some body help me pls. web page
18 years ago
JSF