I am developing a liferay portal and I want to use different domains for each language. I have modified the servlet-mapping from web.xml but I ge this error
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> http://www.domain.ro/c/portal/protected in security constraint
at org.apache.catalina.core.StandardContext.addConstraint(StandardContext.java:2869)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1244)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1357)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Can you please help me?
This is not the right way, leave the web.xml as the original.
Which Liferay version?
Notice that new Liferay 6.2 allows to have differente language setting per site. In previous liferay version you have to create an ext plugin to hack the ServicePreAction class (not so easy).
Related
We are migrating our application from JSF (MyFaces, Trinidad) 1.2 to JSF (MyFaces, Trinidad) 2.0. I have done the all basic changes like updating the XMLNS for Faces-Config, updating the Web.xml to support 3.0, removed Facelets, el-api, el-ri Jars.
When I set the classloaderMode to PARENT_LAST in Websphere 8.5.5 for picking our MyFaces & Trinidad jar, I'm getting the below error.
A java: URL name was used, but Naming was not configured to handle java: URL names. The likely cause is a user in error attempting to specify a java: URL name in a non-J2EE client or server environment. Throwing ConfigurationException
But I'm NOT getting the same exception when I set the classloaderMode to PARENT_FIRST. How can I resolve this problem? Please help me.
The error sounds like you have include WAS JNDI classes in your WAR, which when combined with PARENT_LAST causes the JDK JNDI to use those uninitialized classes rather than the ones included with WAS. You should not repackage WAS JARs in your application.
I have created web dynamic project with jsf2, Primefaces 3.4, Tomcat7.Application runs fine. If i deploy the EAR of the same project on Websphere8 instead of Tomcat7, I am getting Exceptions.I am not sure of what is happening. I am new to JSF2 and Wepshere8.
can you provide me the links on how to start sample jsf2 + primefaces project on Websphere 8
Thanks in advance.
Got it. Try to add com.sun.faces.config.ConfigureListener instead of org.apache.myfaces.webapp.StartupServletContextListener in your web.xml, restart your server and then run it.
The code should look like the following.
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
For using different implementations of JSF, the WebSphere Application Server JSF engine determines if the SUN RI or Apache MyFaces is used from the application server run time. After the JSF engine determines the implementation that is used, the correct listener class is registered with the web container. You do not need to add the com.sun.faces.ConfigureListener or the org.apache.myfaces.StartupConfigureListener to the web.xml file.
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/cweb_javaserver_faces.html
Please see above...
I too faced the same problem.
Websphere by default support sun impl and apache myfaces and its jsf 1.2.
To use jsf 2 implementation.
1.Make sure to remove servlet.jar from your application.Its need for tomcat however not in websphere.
2.Change the classloader policy for ear to parent last.Parent last means lib in your app will have higher priority.if not found will load from WAS class path.
3.Also make sure to change the webmodule class loader policy to parent last.
4.Restart websphere.
To solve the classloader of primefaces in websphere 8.5 classes replace the jsf
jsf-api
jsf-impl
javaee-api
for the native implementation of websphere
myfaces-api
myfaces-impl
I have been struggling with the unholy alliance that is WebSphere 7+ and Mojarra 2.0.4 and have run into something of a showstopper.
I followed the directions as specified at this forum post and got Mojarra 2.0.4 initializing properly: http://forum.primefaces.org/viewtopic.php?f=3&t=6860
Basically I created an isolated classloader shared library that refers externally to the Mojarra and Primefaces jars, added the shared library to the webapp and reversed the classloader to go PARENT_LAST. All of that works.
When I attempt to access my web app http://server:port/context/index.xhtml it is hitting the FacesServlet correctly but then instantly the Request Dispatcher is redirecting to index.jsp???
I don't have any JSP specified ANYWHERE in my code, my app, my web.xml, and in fact I specified DEFAULT-SUFFIX to be .xhtml and that didn't help. All my web pages are .xhtml extension and FacesServlet is mapped correctly to *.xhtml.
I have tried adding XHTML as a mime type to WebSphere, disabling the Request Dispatcher, all to no avail. I have been able to get this running correctly on Tomcat 6-7, JBoss 6 and Glassfish 3 with no problems but for some reason WebSphere insists on a JSP file extension?
I appreciate any help you might have.
WAS7 sometimes does not undeploy the web applications properly. Clearing WAS_PROFILE_HOME/temp and WAS_PROFILE_HOME/wstemp may help.
Please help with this issue, I'm going mad...
I'm trying to make a client-server web application using Weblogic 10 as an application server and IIS as a webserver (corporate constraints), with EJB 3 and Struts 2. I am however having strage problems which I cannot solve.
Using Struts 2.2 I get the following stack trace while starting the server:
<12-ott-2010 16.02.21 CEST> <Error> <HTTP> <BEA-101165> <Could not load user def
ined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher.
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inj
ect.ContainerImpl$MethodInjector
File: ContainerImpl.java
Method: inject
Line: 295 - com/opensymphony/xwork2/inject/ContainerImpl.java:295:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.
java:190)
at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterMa
nager.java:320)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
Truncated. see log file for complete stacktrace
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
[...]
java.lang.IllegalArgumentException: Javassist library is missing in classpath! P
lease add missed dependency!
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)
[...]
However, the Javassist package is clearly visible in the web classpath (/WEB-INF/lib direcotry) among all the other Struts-related libraries, I can also browse its packages and classes. I also put it in the CLASSPATH library and in Weblogic initializaion parameters but nothing works. I don't know what to think. Is this a Struts 2/Weblogic integration bug?
Even weirder is the fact that initially I managed to make Struts 2 work. Then for some reason (I don't really know what for) it stopped and I can't get rid of that error.
Thanks for your help.
Often solutions come when all hope is lost. Apparently all I had to do was moving all Struts libraries (including Javassist) to the /lib directory of the parent EAR project. This sounds weird to me, but it works and I'm sticking with the solution.
I'm not very familiar with Weblogic and Enterprise apps in general, so it didn't came to mind readily that the server treats the EAR as the base context and not the contained WAR.
Wonder if anyone has come accross this problem. I have created a demo portlet using the grails portlet and liferay plugins.
After installing the grails plugins in a project i simply ran the following commands
grails create-portlet MyFirst
grails generate-portlet-views MyFirst
grails liferay-deploy
The portlet deploys fine. However when i try to add the portlet to a page then i get the following stacktrace. Anyone have any ideas ?
23:04:52,134 ERROR [jsp:165] javax.servlet.ServletException: File "/WEB-INF/grails-app/views/myfirst/render.jsp" not found
I am running liferay version 5.2.3 that has tomcat version 6.0.18 embedded. I am also using JVM 1.6
thanks in advance.
The current versjon of the Grails portlet plugin (0.7) doesn't support portletnames with capital cases. Change MyFirst to myfirst and it will work like a charm (well, almost ;)
Regards
Armaz
It looks like it's not able to find render.gsp (the default gsp for a porltet if no mode specific view is found).
What did generate-portlet-views generate for you?
Take a closer look to your stacktrace - it attempts to look for render.jsp, not gsp. render.jsp is the default template LR attempts to find if it does not find what it is looking for depending on the action.
Read Armaz's answer, he is correct. You must change template folder name to lower case: myFirst => myfirst.
The next problem you might experience is solved here: Grails Liferay portlet not invoking action ;)