references to SystemProperties in web.xml and jboss-web.xml works in JBoss5 but not in JBoss7 - jboss

Under JBoss 5.1 we used to "stage" values in the web.xml and the jboss-web.xml by using SystemProperties. In the web.xml that looked like this:
<web-app [...]>
[...]
<auth-constraint>
<role-name>${myRole}</role-name>
</auth-constraint>
[...]
<login-config>
<auth-method>${myAuthMethod}</auth-method>
</login-config>
<security-role>
<role-name>${myRole}</role-name>
</security-role>
</web-app>
Additionally we did the same thing for the jboss-web.xml and the security-domain. Not adding the concrete values is crutial because the WAR-modules we did that are generated by our code generator.
JBoss 7 does not replace these values any more - which is correct according to the spec but in our case quite uncomfortable.
Any ideas how one could:
do some kind of replacement at runtime?
refreign having to replace those values at runtime?
... ?

See https://issues.jboss.org/browse/AS7-3816.
The fix for system property substitution for ejb-jar.xml is going to JBoss AS 7.1.2.
You can check the source or contact the assignee to ensure that is also going to be also fixed for web.xml. Even if it's not yet, it should be possible to convince Bartosz Baranowski to fix it too.
Update
https://issues.jboss.org/browse/AS7-4479 - we've been heard :)

Definitely not my forté, but you might want to look at the migration guide. There also might be some useful information in the authentication documentation.

polemoser - according to which specs? Im waiting for issue to be merged into master before fixing any other related.

Related

Unexpected element '{urn:jboss:domain:keycloak:1.0}subsystem

Happy New Year to all.
I have a keycloak/wildfly question.
I am attempting to secure my war for WildFly 9.0.2.Final deployment. I follow the directions in section 7.2.1 of http://docs.jboss.org/keycloak/docs/1.0.4.Final/userguide/pdf/keycloak-reference-guide-en-US.pdf
I get the error Unexpected element '{urn:jboss:domain:keycloak:1.0}subsystem
I have carefully followed each step as listed below.
cd $WILDFLY_HOME
unzip keycloak-wildfly-adapter-dist.zip
edit the standalone.xml and add the following:
<server xmlns="urn:jboss:domain:1.4">
<extensions>
<extension module="org.keycloak.keycloak-wildfly-subsystem"/>
...
</extensions>
<profile>
<subsystem xmlns="urn:jboss:domain:keycloak:1.0"/>
...
</profile>
It is the line subsystem xmlns="urn:jboss:domain:keycloak:1.0 that is flagged in the error.
What am I missing? Thank you in advance.
May be it's a little bit too late. I think the problem could be that you forget to merge modules, bins folder from key-cloak into Jboss, so that the container itself doesn't recognize the keycloak.

ATG CRS changing context root causes raw JSP to display

I am working on ATG 10.1.2 with Endeca 3.1.2 with the CRS app. Here is what I've done so far.
wanted to change my context root to /mystore
I changed the contexts in web.xml, application.xml and MANIFEST.MF entry for CommerceReferenceStore, subsequently changed my site configuration for one of the CRS stores to have my custom baseUrl and production URL.
In my case I am not using path based multi-site approach. my baseUrl and production Url are same. If I start my application, all pages are coming fine. However, when I try to browse the category pages (cartridges), the JSP's code is displayed on the browser, they do not compile.
I found some solution on oracle community that I should remove the FORWARD dispatcher from PageFilter from my web.xml, and that should solve the issue. I did that, now the page compiles, but intermittent raw JSPs are displayed along with JSP comments on the browser.
Below threads might give you some context on my issue.
https://community.oracle.com/thread/2508338
https://community.oracle.com/thread/3518254
Has someone tried it and have a solution, please share your inputs.
Would suggest you look at your configuration for these components as changing the context root might require configuration changes to:
ContentItemToRendererPath in the ATG documentation
The getRendererPathForContentItem() method returns the web-app relative path of the JSP file used to render the ContentItem.
/atg/endeca/servlet/request/NucleusHttpServletRequestProvider which provides access to the endeca components
/atg/endeca/assembler/AssemblerPipelineServlet with a full explanation here.
Try to add REQUEST and ERROR as well to the dispatcher element.
If you have ...
<filter>
<filter-name>PageFilter</filter-name>
<filter-class>atg.filter.dspjsp.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PageFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
then change it to...
<filter>
<filter-name>PageFilter</filter-name>
<filter-class>atg.filter.dspjsp.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PageFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
Sorry for posting the answer to this after so long.
This was an issue with Oracle Commerce itself. You should try to get a patch for it from Oracle, if you see this on Oracle Commerce version 10.x

Specifying multiple filters in portlet.xml (gatein)

I have created a portlet that runs under Gatein on JBoss 7.2. (To be precise, this was a web app converted to a portlet.) I need two filters on my portlet, the Gatein CDI filter and the Primefaces Upload filter (since my portlet needs to handle uploads). In my portlet.xml file, I tried specifying the two filters like so:
<filter>
<filter-name>PortletCDIFilter</filter-name>
<filter-class>org.gatein.cdi.PortletCDIFilter</filter-class>
<lifecycle>ACTION_PHASE</lifecycle>
<lifecycle>EVENT_PHASE</lifecycle>
<lifecycle>RENDER_PHASE</lifecycle>
<lifecycle>RESOURCE_PHASE</lifecycle>
</filter>
<filter>
<filter-name>PrimeFacesFileUploadFilter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<lifecycle>ACTION_PHASE</lifecycle>
<lifecycle>EVENT_PHASE</lifecycle>
<lifecycle>RENDER_PHASE</lifecycle>
<lifecycle>RESOURCE_PHASE</lifecycle>
</filter>
<filter-mapping>
<filter-name>PortletCDIFilter</filter-name>
<portlet-name>FleetManagementPortlet</portlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>PrimeFaces FileUploadFilter</filter-name>
<portlet-name>FleetManagementPortlet</portlet-name>
</filter-mapping>
However, when I try to access the portlet, I get an error in the log file saying that there is no portlet named FleetConnector.FleetManagementPortlet (my war file is FleetConnector.war). Interestingly, before I added the second filter and filter-mapping blocks, I did not get any error, even though the portlet name is the same.
I have not been able to find any example of the syntax to specify multiple filters in portlet.xml, so I'm not sure my syntax is correct. Any help would be appreciated.
Okay, I found out what the problem with my configuration was. The PrimeFaces upload filter is for servlets - not for portlets. The API is different. There was an error in the log indicating that the filter did not have the correct API, but the last error shown indicated that the portlet name was incorrect, which was not the case. I will now search for an upload filter that works with portlets.

GWT: example of an "Admin" and "Normal-mode" application

I am using GWT (and GWT-Plateform) and GAE, and I would like to have an Admin and a Normal-mode of my application.
I read this post https://turbomanage.wordpress.com/2009/11/19/tips-on-organizing-gwt-modules/#comment-5064 and I would like to see a complete project structure of an application using an Admin and a Normal-mode application. Do you know any sample code of this case (with GWT and GAE if possible...and with GWTP would be perfect) ?
In the link, M. Chandler says that I could have 3 modules (admin, app, common) and just 2 entry point (admin and app). Admin and app inherits common. But I do not know more stuffs such as :
- I am using "Client Bundle" so will it be possible to have my resource folder just inside the "common module". Will it works ? Do I need just one CSS for the 2 modules (admin and normal-mode) ?
- Does my whole domain model needs to be in the common module ?
Any recommendation about how to structure a code with an Admin module using GWT is welcome.
My current problem is that I do not know how to do this with Eclipse (should I copy paste the "client", "server", "share" folders of the "app" package and to add them in a new package named "admin" and then to delete and modify some files ? It seems complicated...or is there just some minimal files and configurations to do ?)
Thanks you,
It's quite easy...
check this link: https://developers.google.com/appengine/docs/java/config/webxml#Security_and_Authentication
You need two entry points.
First for Normal-Mode
Second for Admin-Mode
Everything for admin mode is unter the path /admin/...
In the web.xml you configure now the security constraints in web.xml:
<security-constraint>
<web-resource-collection>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
For the user registration and login control you can use the USERS-Api from Google:
https://developers.google.com/appengine/docs/java/users/overview

Jetspeed null PortletDefinition

I am running a jetspeed portal which contains various portlet applications and have come across an issue after a recent reinstall where some of the portlets will return
Cannot pass a null PortletDefinition
to a PortletEntity
Any idea what is causing this issue? I investigated a bit and it seems that jetspeed runs a process when new portlets are added where it creates mappings in its DB (derby in my case). If this does not complete it seems to cause this problem. Is my assumption correct? If yes, how can I restart this process?
Many thanks
This exception can be caused by having a mismatched portlet name on on your page. This often happens when the portlet application is deployed with one name, but then the page fragment references another name, for example, on your page you have:
<fragment id="1234" type="portlet" name="myApp::myPortlet">
and when you deploy your war file, it is named for example myApp-1.0-SNAPSHOT.war
The fragment's name attribute should have the value "${portlet.war.name}::${portlet.name}. The first part (${portlet.war.name}) is the name of the portlet war file, minus the .war. The second part comes from the value of the tag in the portlet.xml file.
You can either rename your war file, or change your page definition to include the version. I don't recommend putting the version number in the fragment though, as it can change.
A third solution is to actually change the name of the portlet app in your web.xml by setting an init param named contextName on the Jetspeed Container servlet. In the example below its set to "myApp":
<servlet>
<description>MVC Servlet for Jetspeed Portlet Applications</description>
<display-name>Jetspeed Container</display-name>
<servlet-name>JetspeedContainer</servlet-name>
<servlet-class>
org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
<init-param>
<param-name>contextName</param-name>
<param-value>myApp</param-value>
</init-param>
<load-on-startup>100</load-on-startup>
</servlet>