Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Himanhsu Yadav

Ranch Hand
+ Follow
since Sep 26, 2007
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 Himanhsu Yadav

Is it possible to read attributes of internal elements using XStream? XStream is flawless to read root element's attribute with the help of @XStreamAsAttribute annotation nut how would it access the attribute of a internal element.
I want to save XML document values into database. I am using Hibernate 3 with SQL Server Database in my application.
There are multiple issue:
1. Firstly I am trying to escape from marshaling XML to Java classes. Reason being that these XML can change frequently.
2. If I have to create Java entities then at least I don't to create respective hbm files.

Please help.
What is the best way to configure Datasources if application server may change client to client?

I have originally specified it in the application server itself. But now application servers are changing client to client. Clients are using many different application servers as JBOSS,Tomcat or Websphere etc.

Now it is becoming tedious for me as now it has to be configured as per the client specific server and I have to understand their application server configuartion.

That is why now I am moving datasource configuration to Spring's application context.

What is most efficient way to inject datasource configuration while dealing with multiple application servers?
8 years ago
When I am deploying my standalone Spring RESTful webservice, I am getting following:

Mar 5, 2012 1:32:36 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'policy': initialization started
Mar 5, 2012 1:32:37 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'policy-servlet': startup date [Mon Mar 05 13:32:37 EST 2012]; root of context hierarchy
Mar 5, 2012 1:32:37 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/policy-servlet.xml]
Mar 5, 2012 1:32:37 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@170d9151: defining beans [restfulController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.web.servlet.view.BeanNameViewResolver#0,policyView,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
Mar 5, 2012 1:32:38 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/number/] onto handler 'restfulController'
Mar 5, 2012 1:32:38 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/policyA/] onto handler 'restfulController'
Mar 5, 2012 1:32:38 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'policy': initialization completed in 1610 ms
Mar 5, 2012 1:32:38 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080


But while integrating it, i am getting just this:

Mar 5, 2012 1:36:35 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'policy'
Mar 5, 2012 1:36:36 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080

There is no error, exception or warning after this.
8 years ago
My web project has some groovy files but I am not able to set it up in Eclipse Helios. It is possible through IntelliJ but not with eclipse.

I have installed Groovy-Eclipse plug in, installed Groovy in my machine, set up the GROOVY_HOME and included groovyall jar in my library. But no luck.

Is it even possible with Eclipse?

8 years ago
I am working on Java from last 5+ years. I am thinking now to give java certification. It will help me to refresh my memory and give some credibility to my resume. But I am confused with SCJP and OCPJP. Which one to consider and which one is relevant?
Please help me with this.
I went ahead with upgrading the struts 2 version but getting following error while starting the Weblogic 9.2 server
Unable to load configuration. - Class: java.net.InetAddress
File: InetAddress.java
Method: getAllByName0
Line: 1133 - java/net/InetAddress.java:1133:-1
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at com.boa.ecomm.web.struts.ActionContextReleasingFilterDispatcher.init(ActionContextReleasingFilterDispatcher.java:19)
Truncated. see log file for complete stacktrace
Unable to load zip:C:/bea/weblogic92/samples/domains/workshop/servers/cgServer/tmp/_WL_user/GFOTryEAR/svf33r/war/WEB-INF/lib/struts2-core-2.2.3.1.jar!/struts-default.xml - Class: java.net.InetAddress
File: InetAddress.java
Method: getAllByName0
Line: 1133 - java/net/InetAddress.java:1133:-1
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:909)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
Truncated. see log file for complete stacktrace
struts.apache.org - Class: java.net.InetAddress
File: InetAddress.java
Method: getAllByName0
Line: 1133 - java/net/InetAddress.java:1133:-1
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:904)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)
Truncated. see log file for complete stacktrace
java.net.UnknownHostException: struts.apache.org
at java.net.InetAddress.getAllByName0(InetAddress.java:1133)
at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
at java.net.InetAddress.getAllByName(InetAddress.java:1061)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:327)
at weblogic.net.http.HttpClient.openServer(HttpClient.java:420)
9 years ago
Currently I am using struts 2 version 2.0.9 on Weblogic 9.2 application server for my project.
I want to upgrade to latest stable version of Struts2. Please tell me the pros and cons of it and how will affect my project?
9 years ago
Then how to resolve it? Should I creata a endorsed dit in <java-home>\lib\endorsed location and place all the JAXB jars from <project dir>/WEB-INF/lib to endorsed folder?
This did'nt work for me. I am still getting the same error.
I am a regular j2ee developer for one of the largest bank. Mostly worked on Struts 2, EJBs, MQs. Looking forward to contribute to open source to expand my java/j2ee programming skills and learn more. Can I get a list of java/j2ee open source projects?

I know this question may have asked many times but I want to find a project which matches my skills.
I am using WebLogic Workshop9.2 with JDK 1.5. My code is running fine on it. When I tried to run it on Weblogic 10 with JDK 1.6, I am getting following compile time error "Type mismatch: cannot convert from AccessType to XmlAccessType". I have to run with latest JAXB jars but not able to resolve it.
Please help.
XML is read by JAXB SaxParser while deploying the ear in WebLogic server. I am using VI editor to remove ^I but not able to identify null characters.