Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!

Yogesh Gandhi

Ranch Hand
+ Follow
since Dec 05, 2008
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 Yogesh Gandhi


I have been using javax.mail package to send emails.

I used Transport.send method which throws a MessagingException

Now you see when we send more than 1000 mails, there is a validation at the server side or somewhere, which blocks our IP (if its not properly registered.... may be not a  registered domain or something)
So, after 1000 mails or so, the java program does send mails, but the mails never reach the recepient.

And we never come to know that emails are not going at our end in java program, as the Transport.send doesnt throw exception.

Can someone please guide  me if it is technically possible to track such failures?

3 weeks ago

Stephan van Hulst wrote:You shouldn't have to. The URL in a WSDL is usually just a default. You can override the default URL when you construct an instance of the client.

So that means changing it to https, doesnt require clients to install some sort of certificates or anything? Just changing the endpoint URL is sufficient?
1 month ago
I am a web service consumer of a soap web service using a soap client.

Now the web service is going to some other url and also its going on https.

Does client needs to be regenerated? Or it needs any other changes except the change of endpoint url?

Note: The service's internal functionality remains the same, (it is only migrating from http to https and on some different server).
Also it might be going on CLOUD, so there might be a need of PROXY (which earlier was not needed as it was hosted on intranet earlier).

Someone kindly throw some light on this, it'll be a great help.

I have posted the same question on stackoverflow also
2 months ago

David Nicholls wrote:Hi again,

in this case start your servlet container using these flags.

What is your environment? Are you using eclipse? Using tomcat?

Anyway. You may just as well alter your code:
Just put the following static initializer block in your thread class (or any class that is loaded before calling the service).

static {
System.setProperty("https.proxyHost", "IPgoesHere");
System.setProperty("https.proxyPort", "PortGoesHere");
System.setProperty("http.proxyHost", "IPgoesHere");
System.setProperty("http.proxyPort", "PortGoesHere");

I recommend starting the JVM using the -D options. Then you don't have to change your code.

So we are sure on this that if I use -D option I dont need to change my code?

Well in another scenario (Where I had a main program java code)  where I was calling httpURL.openConnection()
I had to use overloaded method httpURL.openConnection(proxy)

and pass a Proxy object in order to make it work. Even though I had it passed as JVM arguments to the main program, this openConnection call still required the proxy object in order to work correctly.
2 months ago
I found out a work around to access the variable in the scriptlet. Though not as elegant way of doing it, but still it solves the problem

In this above example, the reqirement was to access the abc variable in the scriptlet

And then get that from request.getAttribute("abc")

3 months ago

Joe Ess wrote:I'm saying the variable will be in the Value Stack.  It's an integral part of Struts 2.  see here
My personal opinion is that scriptlets are awful and one should avoid them at all costs.  It would also be wise to sit down and learn how to use Struts 2 effectively.  By taking the half-and-half route, you are missing out on the benefits of using Struts 2 while also causing more problems for yourself by trying to write code to get around the framework.

I understand what you are saying, but the problem I have in hand is, that code is an already running application, which has tons of JSPs and it is already using scriptlets and variables as shown in my first post.

Now I do not want to mess up the things any further. At present the job I have in hand is, to make it compatible with Struts2.
3 months ago

Joe Ess wrote:The "var" attribute is the name of the iterator on the Value Stack (see here).  The tag is not creating a variable with that name.

Thanks for your response. But I need that as a variable as well (as it was being used in struts1). So that I can go ahead with minimal changes in the JSP.

Are you saying that its not possible?
3 months ago

Joe Ess wrote:Did you try it?  My wild guess would be that it would not work.  The two versions of Struts are very different code bases, including the JSP tag libraries.

Well I didnt' try exactly this, but other way round I tried.

Struts 1 Action class
Struts 2 JSP

And it works...But at this moment I am facing another problem.

I am setting attribute in ACtion class into request, which I am not able to display on the JSP

3 months ago

If I change Action class to struts 2 and keep using struts 1 JSP file?

Is it possible? Will it work?
3 months ago

I have a requirement where I am migrating struts 1 to struts2

Now in the JSP that is already written in struts1, there are scriptlets being used which are accessing the variable defined in <logic:iterator as follows >

I have minimized the code above to the least, so that it is easy to explain the requirement. Though the scriptlet has much bigger code inside it (in actual)

Now the requirement here is to migrate it to struts 2

In struts 2, I do it something as follows

Here I am not able to access the task variable inside scriptlet as I was able to access in struts1.

It is giving compilation error.

I cannot use the struts 2 tags, because such kind of scriptlets are many in the JSP, and I want to go with the least changes so that I dont need to change the complete JSP (whcih ofcourse is error-prone)
3 months ago

Norm Radder wrote:

java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version;

That error looks like the class file was created by a younger version of java compared with the JVM's version of java

Thanks for taking out your precious time and replying to my post.

Yes, you are right, and this was the exact issue.

Actually I was using commons-lang3-3.11 version which I downloaded from maven repository and it was built using java 1.8
When I found this, I downloaded the lower version of the commons-lang, which was compiled using java version 1.5

Since i was using java version 1.6 on my websphere, putting this new jar solved my problem.
3 months ago
I have one struts 2 web application war file, which is running on my local tomcat.

I checked inside WEB-INF/lib and it has all the required dependencies (for struts 2) -- Jars.jpg attached.

I assume that if my WEB-INF/lib directory contains the required jars, I should not be providing the jars anywhere else.

When I deployed the same war file on websphere, I am getting class not found exception. / No Class found def error.

E0293E: [Servlet Error]-[]: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
       at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(
       at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(
       at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(
       at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
       at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(

E0293E: [Servlet Error]-[GenericServletWrapper]: java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/apache/commons/lang3/StringUtils, offset=6
       at java.lang.ClassLoader.defineClassImpl(Native Method)
       at java.lang.ClassLoader.defineClass(

[12/22/20 4:09:03:657 PST] 00000117 ecs           W scanJAR unable to open input stream for resource org/apache/logging/log4j/Marker.class in archive WEB-INF/lib/log4j-api-2.13.3.jar
       at org.objectweb.asm.ClassReader.<init>(Unknown Source)
       at org.objectweb.asm.ClassReader.<init>(Unknown Source)
       at org.objectweb.asm.ClassReader.<init>(Unknown Source)

Can someone please help me in resolving the errors?

3 months ago

My Requirement is to migrate my web-application from Struts1 to struts 2

The web-app runs on websphere, and it has several portlets which are managed by websphere Portal administration.

My application is an EAR file having some different porlets (war files). and some war files having the Back end code.

My task is to migrate complete EAR to struts2.

I thought lets first migrate the front end part of it ie. portlets.

I read various websites about how to migrate struts1 to struts2. I did the required changes in web.xml and converted struts-config.xml( struts1 ) to struts.xml (struts2)

There is this one line in web.xml which is causing trouble

The below class comes in PortalStruts.jar (present in WEB-INF/lib folder of the portlet war file)

and below is struts.xml

These two classes WpsRequestProcessor and WpsStrutsPortlet belong to websphere portlet framework I believe. And I dont know if I need to make changes to these classes, and how to go about it.

Meanwhile I tried to deploy the Portlet war with the above changes, but I got the following error

[12/15/20 6:42:01:169 PST] 0000013c PortletContai E endPage EJPPG1126E: An error occurred while method endPage was processed by portlet Control@-1370172183 (Struts2 Project21 portlet, [ObjectIDImpl 'Z7_7G56HG01N0J810QD6LFOHI10K2', NAVIGATION_NODE, VP: 0, [Domain: rel], DB: 0000-0716132108174C14806EA63E1C650054], [ObjectIDImpl 'Z6_7G56HG01N0D900QLGPR8HA3043', CONTENT_NODE, VP: 0, [Domain: rel], DB: 0000-071613210817B40480AE306F14D50064], 1100. org.apache.jetspeed.portlet.UnavailableException: EJPYE0013E: The request processor must be a subclass of the Struts Portlet Framework request processor.

Can someone please help me how should I proceed with portlet migration, and any video or guide can also help.
4 months ago

I am trying to create a new web project using eclipse

File-> new -> Dynamic web project

Next Next and Finish

Here i get the web.xml

and it shows me the following error

cvc-elt.1.a: Cannot find the declaration of element 'web-app'. (if i select 2.5 dynamic web module version)

Error while downloading '' to C:
\Users\yg178f\.lsp4xml\cache\http\\xml\ns\javaee\web-app_3_0.xsd. (if i select 3.0 dynamic web module version)

Here is my web.xml

4 months ago