AWG Blogs

  • Getting ADB Working for SPH-M840 - Had a SPH-M840 Galaxy Ring Virgin Mobile 3G Android version 4.1.2, attempting to install apps from Android Studio failed to detect device. Installed SAMSUN...
    7 months ago
  • How to check if I have write permissions to an Oracle table - SELECT CASE WHEN COUNT(*) > 0 THEN 'YES' ELSE 'NO' END AS PERMISSIONS FROM ( SELECT privilege FROM ( select * from dba_tab_privs where (grantee = 'MY_USE...
    7 months ago
  • JSF vs Struts 2 - JSF was designed in part by the authors of Struts to create a "Struts" that did a more accurate implementation of MVC (Struts is technically "Model 2") a...
    8 months ago
  • XML Beans vs JAXB - Seems XML Beans is superior: JAXB provides support for the XML schema specification, but handles only a subset of it; XMLBeans supports all of it. Also, by...
    1 year ago
  • Algorithms and OOP - In addition to DCI, "generic programming" as well as the move to functional programming appears to add nuance to the OOP notion of joining behavior with da...
    1 year ago
  • Flyweight vs Singleton - Implementations seems to be virtually identical, differing only in style, where the flyweight object is created and held by associated objects (containers:...
    1 year ago
  • init-param vs context-param - see for background. Gist: context-param variables are global and accessible thro...
    1 year ago
  • rbenv vs RVM - RVM is responsible not only for changing Ruby versions, but for installing rubies and managing gemsets, as well. ...Along with rbenv [to manage ruby versi...
    2 years ago

Sunday, November 2, 2014

Solving Sruts2 Core Jar File Conflict

I was adding a Struts2 application to an embedded Tomcat 6 instance by adding the context and assigning the path to the Struts2 application programmatically. The Struts2 application's WEB-INF/lib was empty similar to what's known as a "skinny war." When attempting to access a jsp page though I would get the error: "/struts-tags" not found.

This was solved by adding struts2-core- to the WEB-INF/lib. However then application would not load and I would get:
Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file:C:/MyCustomContainer/plugins/struts2-core-!/struts-default.xml:29:72 - bean - jar:file:/D:/temp/configs/pings/strutssd/WEB-INF/lib/struts2-core-!/struts-default.xml:29:72

So I removed struts2-core- from the plugins dir leaving only the copy in the WEB-INF/lib. This fixed the problem and the Struts2 application finally worked.

Note this could cause problems if I were to add another Struts2 application to the container although I haven't tried it.

Related problems with workarounds including removing struts-tags.tld and putting in WEB-INF, or adding Class-Path entries  to MANIFEST.MF:

Saturday, March 8, 2014

Deploy Small Java App to OpenShift

This is the code deploy method. For deploying an existing WAR there are other methods will plenty of how-tos on the web.

- Create a JBoss Application Server 7 app preferably from the rhc client.
- Create a file under src\main\java\action and paste in the sample TestBean class from this tutorial on JSP actions:
- Create a folder "classes" under src\main\webapp\WEB-INF (although I'm not sure this step is necessary)
- Create a file "main.jsp" under src\main\webapp and paste in the corresponding sample code from the above referenced tutorial
- Git add, commit, and push it up.
- Load it in the browser e.g. http://jbossas-<your namespace>

see also: