adi arrab

Greenhorn
+ Follow
since Mar 17, 2008
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 adi arrab

Any one can help me with this one I am still stuck on this one.

Thanks in advance.


12 years ago

Hi I am trying to deploy a project with maven dependencies. and i am getting the following error.
can anyone suggest a solution

Thanks in advance.


12 years ago
I am trying to run a simple application, and i am trying to execute tiles.
In tiles def i put siteTitleBanner.jsp as the header and in the next definition i am calling the body as login.jsp

But i am getting this error "Error 404: SRVE0190E: File not found: /login.tile "

I also tried changing the context root from xxxx to /xxxx, but it did not change the results. I am executing this application on Rad 7.0




The Struts Config. xml file




This is my Tiles config. xml files






13 years ago
java.lang.OutOfMemoryError: Java heap space
at java.util.Properties$LineReader.<init>(Unknown Source)
at java.util.Properties.load(Unknown Source)
at org.exolab.castor.xml.util.resolvers.ByCDR.getProperties(ByCDR.java:69)
at org.exolab.castor.xml.util.resolvers.ByCDR.internalResolve(ByCDR.java:109)
at org.exolab.castor.xml.util.resolvers.AbstractResolverPackageCommand.resolve(AbstractResolverPackageCommand.java:63)
at org.exolab.castor.xml.util.resolvers.CastorXMLStrategy.resolvePackage(CastorXMLStrategy.java:153)
at org.exolab.castor.xml.util.resolvers.CastorXMLStrategy.getDescriptor(CastorXMLStrategy.java:125)
at org.exolab.castor.xml.util.resolvers.CastorXMLStrategy.resolveClass(CastorXMLStrategy.java:82)
at org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl.resolve(XMLClassDescriptorResolverImpl.java:241)
at org.exolab.castor.xml.util.XMLClassDescriptorResolverImpl.resolve(XMLClassDescriptorResolverImpl.java:198)
at org.exolab.castor.xml.Validator.validate(Validator.java:119)
at org.exolab.castor.xml.Marshaller.validate(Marshaller.java:2594)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:826)
at org.exolab.castor.xml.Marshaller.staticMarshal(Marshaller.java:798)
at org.exolab.castor.xml.Marshaller.marshal(Marshaller.java:727)
at com.nationwide.nsc.firm.si.io.impl.SerializerImpl.serializeXml(SerializerImpl.java:130)
at com.nationwide.nsc.firm.si.input.DatFileType.stepsOnFileType(DatFileType.java:60)
at com.nationwide.nsc.firm.si.service.impl.FileInputControllerEventHandlerImpl1.process(FileInputControllerEventHandlerImpl1.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy5.process(Unknown Source)
at com.nationwide.nsc.firm.si.service.FileInputControllerEventHandlerTest1.testProcess(FileInputControllerEventHandlerTest1.java:35)




I Changed the jvm heap size to

-showsplash
com.genuitec.myeclipse.blue.product.ide
--launcher.XXMaxPermSize
256m
-vmargs
-Xms256m
-Xmx1400m
-Duser.language=en
-XX ermSize=128M
-XX:MaxPermSize=256M



This is the Code i am running multiple times to insert records into the database


public void stepsOnFileType(long fileType, long fileDefInstanceId, String fileNameOriginal, String fileNameUnique,
long fileStatusTypeId, long interfaceInstanceId, long workStatusTypeId, String layoutSetName) throws Exception {

LayoutSetInfo lsi = layoutManager.getLayoutSetInfo(layoutSetName);
DataFileReaderImpl dfr = new DataFileReaderImpl(serializerDeserializerManager, lsi, fileNameOriginal);
Deserializer deserializer = serializerDeserializerManager.getDeserializer(lsi.getDetailLayout());
Serializer serializer = serializerDeserializerManager.getSerializer(lsi.getDetailLayout());

new CreateFileObject().newFileObject(fileDefInstanceId, fileType, fileStatusTypeId, fileNameUnique, fileNameOriginal);
long workInstanceId = workInstanceDao.insert();
new CreateWork().newWork(workStatusTypeId, workInstanceId, interfaceInstanceId, 10);
long i = 1;
for (Object detail = dfr.readDetail(); detail != null; detail = dfr.readDetail()) {
WorkItemDto workItemDto = new WorkItemDto();
workItemDto.setWorkInstanceId(workInstanceId);
workItemDto.setRawData(dfr.getRawData());
String xml = serializer.serializeXml(deserializer.deserialize(dfr.getRawData()));
workItemDto.setXmlData(xml);
workItemDto.setSequence(i);
i++;
workItemDto = workItemDao.insert(workItemDto);
//log.debug(workItemDto.toString());
}
}



and This is the insert method


public WorkItemDto insert(WorkItemDto workItemDto) {

/*if (log.isDebugEnabled()) {
log.debug(Debug.getCurrentMethod(Thread.currentThread().getStackTrace()));
log.debug(workItemDto.toString());
}*/

WorkItem workItem = new WorkItem();

WorkInstance workInstance = new WorkInstance();
workInstance.setId(workItemDto.getWorkInstanceId());
//this.getHibernateTemplate().save(workInstance);

String[] ignoreProperties = {"workInstanceId"};
BeanUtils.copyProperties(workItemDto, workItem, ignoreProperties);
workItem.setWorkInstance(workInstance);

Timestamp timestamp = new Timestamp(System.currentTimeMillis());
workItem.setCreateTs(timestamp);
workItem.setUpdateTs(timestamp);
this.getHibernateTemplate().save(workItem);

workItemDto.setId(workItem.getId());
workItemDto.setCreateTs(workItem.getCreateTs());
workItemDto.setUpdateTs(workItem.getUpdateTs());

return workItemDto;

}


I will be inserting a lot of rows I dont know where i am creating the object and storing them but this error never goes

for small number of records its working but for big number of records its giving the above error.
14 years ago
This is the error i am getting can i get any suggestions Thanks in advance.


java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at junit.framework.TestSuite.createTest(TestSuite.java:54)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:280)
at junit.framework.TestSuite.<init>(TestSuite.java:140)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
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)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileObjectService' defined in class path resource [properties/testDomainContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'fileObjectDao' of bean class [com.nationwide.nsc.firm.si.service.impl.FileObjectServiceImpl]: No property 'fileObjectDao' found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.nationwide.nsc.firm.si.service.WorkItemServiceTest.<clinit>(WorkItemServiceTest.java:16)
... 13 more
Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'fileObjectDao' of bean class [com.nationwide.nsc.firm.si.service.impl.FileObjectServiceImpl]: No property 'fileObjectDao' found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:382)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1248)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
... 27 more
I want to calculate MD5 values for a large Files I am using the following Code

public String Checker(File fi) throws NoSuchAlgorithmException,
FileNotFoundException {
MessageDigest md = MessageDigest.getInstance("MD5");
StopWatch stopWatch = new StopWatch();
InputStream is = new FileInputStream(fi);
byte[] buffer = new byte[4000];
int read = 0;
try {
stopWatch.start();
while ((read = is.read(buffer)) > 0) {
md.update(buffer, 0, read);
}
byte[] md5sum = md.digest();
BigInteger bigInt = new BigInteger(1, md5sum);
String output = bigInt.toString(16);
System.out.println("MD5 : " + output);
stopWatch.stop();
long s = stopWatch.getTime();
System.out.println("MD5 Time taken: " + s);
return output;
} catch (IOException e) {
throw new RuntimeException("Unable to process file for MD5", e);
} finally {
try {
is.close();
} catch (IOException e) {
throw new RuntimeException(
"Unable to close input stream for MD5 calculation", e);
}
}

}

For Million record file it takes 55 seconds


How can i increase the performance(ie decrease the processing time)

Any Suggestions or Code would help

Thanks take care
14 years ago
I want to calculate MD5 values for a large Files I am using the following Code

public String Checker(File fi) throws NoSuchAlgorithmException,
FileNotFoundException {
MessageDigest md = MessageDigest.getInstance("MD5");
StopWatch stopWatch = new StopWatch();
InputStream is = new FileInputStream(fi);
byte[] buffer = new byte[4000];
int read = 0;
try {
stopWatch.start();
while ((read = is.read(buffer)) > 0) {
md.update(buffer, 0, read);
}
byte[] md5sum = md.digest();
BigInteger bigInt = new BigInteger(1, md5sum);
String output = bigInt.toString(16);
System.out.println("MD5 : " + output);
stopWatch.stop();
long s = stopWatch.getTime();
System.out.println("MD5 Time taken: " + s);
return output;
} catch (IOException e) {
throw new RuntimeException("Unable to process file for MD5", e);
} finally {
try {
is.close();
} catch (IOException e) {
throw new RuntimeException(
"Unable to close input stream for MD5 calculation", e);
}
}

}

For Million record file it takes 55 seconds


How can i increase the performance(ie decrease the processing time)

Any Suggestions or Code would help

Thanks take care
14 years ago
this is the error message that i am getting can anyone please give me a suggestion.



java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:216)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:522)
at junit.framework.TestSuite.createTest(TestSuite.java:54)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:280)
at junit.framework.TestSuite.<init>(TestSuite.java:140)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
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)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [properties/testDomainContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: com.nationwide.nsc.firm.si.model.InterfaceInputOutput
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:219)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.nationwide.nsc.firm.si.service.fileInServiceTest.<clinit>(fileInServiceTest.java:29)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
... 13 more
Caused by: org.hibernate.MappingException: Association references unmapped class: com.nationwide.nsc.firm.si.model.InterfaceInputOutput
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2380)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2662)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:673)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
... 30 more