Avinash Ga

Ranch Hand
+ Follow
since Aug 13, 2011
Avinash likes ...
Eclipse IDE Spring Java
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Avinash Ga

Are you trying to create the client using wsimport and deploy the same on server?
10 years ago

Martin Vajsar wrote:I believe you should be able to edit the post yourself - just click the button on your post. Edits are possible for some short time after you post.

Just make sure there are no replies that would comment on the line you're going to edit. If it would be the case, it is better to post a reply with the correction, otherwise the conversation becomes confused.

Thanks a lot Martin
10 years ago
Hi Moderator i need to edit my post

in the last part of the post i need to change the line
List<String> names = JsonQueryEngine.getExpressionValues(String expression, String propertySeperator, JSONObject jsonObject);
List<String> names = JsonQueryEngine.getExpressionValues("Persons.name", ":", JSONObject jsonObject);

Can you please help?

10 years ago
Hi Ranchers,

Here is a small utility to query the JsonObject for a particular property. It may be helpful to some of you.

It contains a static public method which accepts an expression, property separator and JsonObject.

The expression can be of the form Node1:Node2:Node3, where Node3 is the targetted property and ":" is a property seperator. See Sample.

if you want to query the name property of the above object then you can call the method as

The output of the method is list of string, i.e if the targeted property is a JsonObject then it will be toString() ed.

10 years ago

satyajit bhosale wrote:

Avinash Ga wrote:Study materials by Milkalai and Ivan are great to start with. Also consider reading Java Web Services Up and Running by Martin Kalin and Java Web Services Architecture by James Mcgovern and team....


My query is regarding practical of OCPJWSD. Can you please suggest some link(s) or books for practical?
Currently, I am stuck to following example/situation -
- Environment: Eclipse, Tomcat 7.0, JDK 1.7, Axis2.
- Create a WebService with annotation @WebService, @WebMethod, @SOAPBinding.
Here, I am unable to create a WSDL. I am trying to access a webservice using standalone client and stub.

If you have any input, please comment.

Thanks in advance,
Satyajit Bhosale


Please go through the link. Also there is nothing wrong in using Eclipse for your practice / real development. Atlast thats why its built for. I suggest you to try out contract first approach od web service development for better understanding. Have a look at Apache CXF its really good and widely used.

viapro young wrote:Is it sovled? I think I've got the same problem

Caused by: java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver
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:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.hibernate.cfg.Configuration.reset(Configuration.java:336)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:275)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:279)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.<init>(LocalSessionFactoryBuilder.java:106)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:278)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 39 more

No i was unable to overcome this. It will help if you pin point the exact location. Didnt find any clue in the code.
10 years ago

Ulf Dittmer wrote:Session cookies are specific to individual web apps. But you can set additional cookies for the entire domain, and those will be visible across web apps.

thanks Ulf that was it.....
Hi Ranchers,

I have to share some information between two web apps. for that i am trying to use cookies. I have two web apps (App1 and App2) hosted on the same tomcat server. when user navigate to App1 (http://localhost:8080/App1) i set a session cookie, when user navigates to App2 http://localhost:8080/App2) i want that cookie to do some logic (also i want the Vice-Versa). is this possible using cookies? if yes can you please tell me how to implement? if no, any other mechanism to share session related information across webapps?

Yes, exactly that is the problem...... here is my dependency tree, in this it is nowhere mentioned the dependency on hibernate 3.x...... I dont know why my org.springframework.orm.hibernate4.LocalSessionFactoryBean initialize method refering to that......... may be some bug in spring..... will try to post my issue in springsource community......

Thanks Mark

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Signup 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ Signup ---
[INFO] com.cisco.prime:Signup:war:1.0.0-BUILD-SNAPSHOT
[INFO] +- org.springframework:spring-core:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:3.2.1.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-context:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-context-support:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:3.2.1.RELEASE:compile
[INFO] | \- commons-lang:commons-lang:jar:2.5:compile
[INFO] +- org.springframework:spring-web:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc-portlet:jar:3.2.1.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.2.1.RELEASE:test
[INFO] +- org.aspectj:aspectjrt:jar:1.6.10:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.6:runtime (scope not updated to compile)
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:runtime (scope not updated to compile)
[INFO] +- log4j:log4j:jar:1.2.15:runtime
[INFO] +- javax.inject:javax.inject:jar:1:compile
[INFO] +- com.liferay.portal:portal-service:jar:6.1.1:provided
[INFO] +- com.liferay.portal:util-bridges:jar:6.1.1:provided
[INFO] +- com.liferay.portal:util-taglib:jar:6.1.1:provided
[INFO] +- com.liferay.portal:util-java:jar:6.1.1:provided
[INFO] +- javax.portlet:portlet-api:jar:2.0:provided
[INFO] +- com.sun.portal.portletcontainer:portlettaglib:jar:2.0-m1:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.hibernate:hibernate-core:jar:4.2.0.CR1:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] | +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.2.0.CR1:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:4.2.0.CR1:compile
[INFO] | \- net.sf.ehcache:ehcache-core:jar:2.4.3:compile
[INFO] +- org.hibernate:hibernate-c3p0:jar:4.2.0.CR1:compile
[INFO] | \- c3p0:c3p0:jar:0.9.1:compile
[INFO] +- org.hibernate:hibernate-envers:jar:4.2.0.CR1:compile
[INFO] +- com.h2database:h2:jar:1.3.170:compile
[INFO] +- net.sf.dozer:dozer:jar:5.4.0:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] | \- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] \- junit:junit:jar:4.7:test
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
10 years ago
Hi Ranchers,

i am writing a spring portlet which uses hibernate 4.x for the persistence. but when i deploy that into tomcat i am getting the following error. i dont know why it is refering to org.hibernate.util.dtdentity resolver.

here is my configurations

Maven POM.

Spring COnf......

error says......

aused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/databaseContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 55 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver
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:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2889)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1170)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at org.hibernate.cfg.Configuration.reset(Configuration.java:326)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:265)
at org.hibernate.cfg.Configuration.<init>(Configuration.java:269)
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.<init>(LocalSessionFactoryBuilder.java:102)
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:259)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 65 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.util.DTDEntityResolver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
... 80 more
Feb 14, 2013 9:19:50 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Feb 14, 2013 9:19:50 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Signup-1.0.0-BUILD-SNAPSHOT] startup failed due to previous errors
Feb 14, 2013 9:19:50 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
09:19:50,144 INFO [pool-2-thread-8][PluginPackageUtil:1033] Reading plugin package for Signup-1.0.0-BUILD-SNAPSHOT
09:19:50,144 WARN [pool-2-thread-8][PluginPackageUtil:1131] Plugin package on context Signup-1.0.0-BUILD-SNAPSHOT cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
Feb 14, 2013 9:19:50 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
INFO : org.springframework.web.portlet.DispatcherPortlet - Initializing portlet 'Signup'
10 years ago
thanks for sharing chris....... looks like a treasure...........
10 years ago
As per my (limited )knowledge of Map-Reduce algorithm, i believe that in a job, reduce tasks will start running only after all the map tasks (also the combiner tasks if there are any) have finished execution. if there is no chance of a reduce task running (correct me if i am wrong ) while there are pending map tasks, why the tasktracker have separate (configurable) slots for map and reduce tasks? i have read that before starting a map task, a task tracker will look for a free map task slot, if it finds any it will allocate that slot to the map task, if there are no free task slots left then it will allocate a slot from reduce task slot . i just want to know why there is a configuration like this in hadoop . is this configuration is per job (make no sense, since reduce tasks cannot start before the completion of all map tasks.... again correct me if i am wrong) or per system (a system with many job...... this make some sense )
10 years ago
SOLVED!!! i was missing a schemapattern attribute in ddltodatabase task. thank peter.
11 years ago