Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

Anurag Swaym

Greenhorn
+ Follow
since Aug 12, 2002
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 Anurag Swaym

Thanks Paul & Jayesh for the explanation. Both of your explanations were very clear. I am looking at some concrete steps on how I can measure this.

We need to run a sample code to see how much "resources" have been consumed. So, if I take creation of JAXB context example again, here are the steps I was thinking I could do to get some numbers.

1. Run the java program with a single thread to create the context. Single thread might not have significant variations. So, it might have to be multiple concurrent requests.
2. Monitor the CPU usage (the JAXB context example should give me higher than normal CPU usage because of reflection)
3. Get a heap-dump (using WAS) & profile it to see the heap dump usage (in the JAXB example I do not expect the heap dump usage to be abnormal.
4. capture the program response time (assuming this will be higher)

The above 4 steps should give me some basic info. Are there any other steps or checks to do to see if the operation is really expensive or not? For now, I am not considering any I/O or DB operations.
8 years ago
I wanted to check if anyone can help me with some theory pointers & also some tools which can help me quantify costs.

I understand that some Objects might be "expensive" to create. For example - JAXBContext. So its preferred to make it as a singleton to maintain only one instance.

But, I wanted to understand what does it mean when the javadocs say that an object is "expensive" to create - does expensive mean, more CPU utilization, more time to create an object & why does it take more time compared to other java object creations.

I would appreciate if someone can help me with the following 2 things.

1. Articles/links to an in-depth explanation of what "expensive" means; preferably explanations at a byte-code level
2. Any tools that I can use to write a stand-along java program & quantify the costs.

Thanks in advance for all your help.
8 years ago
Allright...I have some closure on this issue.

The issue is related Weblogic 10.0. As Joe mentioned some classpath issues. I thought I had successfully tested struts1.x on Weblogic 10.0, but I was wrong. When I tried struts 1.x, I kept getting variations of FormBean "not found" or "null" errors.

Thanks to Joe Ess suggestion, I upgraded to Weblogic 10.3 and I immediately achieved successful results for both struts1.3 and struts2.0 version without any changes to the existing WAR.

I had a question regarding moving from 10.0 to 10.3. Is it better to upgrade or to completely uninstall 10.0 and then start on 10.3. I have just started building a webapp and do not want to run into issues later.

Thanks Joe and David for your help and suggestions.
12 years ago
Thanks for replying back Joe.

Thanks David for the tip on pinging Weblogic support. I have not yet pinged weblogic support regarding this issue. I will do it next.

I am currently using Weblogic version10.0.

12 years ago
I am trying the empty HelloWorld application using Struts2. I have Struts1 successfully deployed on Weblogic. I have successfully done struts2 using Tomcat with the same folder structure. I identified 2 different exceptions.

The complete stack traces for Exception 1 is:

<Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:88)
at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1725)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

Stack trace for exception 2 is
Action class [HelloWorldAction] not found - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:355)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:265)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:189)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:320)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:88)
at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1725)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
>
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405) - I decompiled XmlConfigurationProvider class. The verifyAction() method has an "URI" as its input parameter and uses the class loader returns a boolean if the action class is present at that location. I verified that the class is present at the specified location in the staging area.

Someone suggested it might be a security/firewall issue. I have turned off all firewall on my computer.

So, not sure whats happening.
12 years ago
Thanks for the tip Joe.

But, I initially started out that setup..where-in all the jars were under WEB-INF/lib folder. Because of the error, I started making changes to the classpath and went down that path.

After your suggestion, I have again reverted back to the original configurstion, but still get the

<Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60

and later unable to find the action error

Action class [HelloWorldAction] not found - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:60
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)>
12 years ago
Hi All -

I am trying a "Hello World" example using Struts2 with Weblogic 10 server, but running into issues. I have followed the correct procedures and have the correct directory structure. I have cross-verified with multiple sites.

But, I am getting 2 Errors while starting the managed weblogic server..not sure if they are inter-related

My first error in the server log file is
<Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
Unable to load configuration. - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:61
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)

- My web.xml entry is
><filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>

The second error in the stack is -
Action class [/HelloWorldAction] not found - action - file:/C:/Project_home/domains/DomainWithClusters/servers/ManagedServer_1/stage/webapps/webapps/WEB-INF/classes/struts.xml:7:61
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:405)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:355)

Now, I have setup the classpaths correctly by modifying the server startup scripts to load the necessary jars for Struts2...I have placed the jars in the lib folder under webapp\WEB-INF\....but nothing seems to work.

This seems to be specific to Weblogic. Has anybody run into this issue or any ideas on how to resolve them?

Thanks for your help.
12 years ago
Does anyone know, how to connect to a SQL Server from IBM Websphere using Type 4 JDBC ?
I have downloaded the SQL Server driver from the microsoft site. I then updated the classpath variable with the following 3 jar files. (msbase.jar, msutil.jar, mssqlserver.jar)
I am getting a Class Not Found exception.
I am able to successfully create a JDBC connection using Type 1 (JDBC-ODBC bridge) connection. Any help is appreciated. Thanks.
18 years ago
Does anyone know, how to connect to a SQL Server from IBM Websphere using Type 4 JDBC ?
I have downloaded the SQL Server driver from the microsoft site. I then updated the classpath variable with the following 3 jar files. (msbase.jar, msutil.jar, mssqlserver.jar)
I am getting a Class Not Found exception.
I am able to successfully create a JDBC connection using Type 1 (JDBC-ODBC bridge) connection. Any help is appreciated. Thanks.
Does anyne know how to integrate IBM Visuage for Java 3.5 IDE with Tomcat 4.0 server? I have an exe file of Tomcat, with which I installed Tomcat Version 4.0. I am able to run startup and shutdown Tomcat services. I am not sure about how to integrate with Visualage for Java 3.5. Any responses will be appreciated. Thanks,
18 years ago
Is it possible to reference one array to another.
For example:
float Array1[] = {1,2,3,4,5};
float Array2[];
Array2 = Array1; //Is this legal ?
Array2[3] = 2 //Is this correct ?
Thanks for the help.
This is from a mock exam from the sun site.
. public class MyThread implements Runnable {
2. private String holdA = "This is ";
3. private int[] holdB = {1,2,3,4,5,6,7,8,9,10};
4.
5. public static void main(String args[]) {
6. MyThread z = new MyThread();
7. (new Thread(z)).start();
8. (new Thread(z)).start();
9. }
10.
11. public synchronized void run() {
12. for(int w = 0;w < 10;w++) {
13. System.out.println(holdA + holdB[w] + ".");
14. }
15. }
16. }
D. Compilation succeeds and the program prints each value in the holdB array at the end of the "This is " line. Each value is printed two times before the program ends, and the values are not printed in sequential order.
E. Compilation succeeds and the program prints each value in the holdB array at the end of the "This is " line. Each value is printed in order from 1 to 10 and, after the value 10 prints, it starts printing the values 1 to 10 in order again.
My question is why cannot the answer be "D". Aren't thread implementation platform dependent, and you cannot predict which thread is being run at a particular time.
If they have the same priority (I assumed same priority (5) since priority has not been explicitly mentioned), even though the threads are synchronized, can you really predict that the 2nd thread will be run after the 1st thread is completely finished ?
Thanks.
My question was specific for Java certification exam. You know that a block of code is incorrect and is going to generate some errors.
My question is: Is there a logical way, by which you can predict that this block of code is going to generate compiler error as opposed to run-time error.
Thanks
Is there a rule of thumb to distinguish between Compiler Error Vs. Run-time error.
Syntax errors obviously generate Compiler errors. Apart from Syntax errors, how can you say whether a particular group of code produces compiler or Run-time error ?
Thanks.