[Installation, Configuration & DEPLOYMENT] - Re: How to disable JBoss Web Services
by kashif_jboss
ok Peter I Agree with you that i have done something wrong with it and i am misinterpreting it.
now let me tell you wht i have done with it.
i deleted following folders from Jboss 5.0 A/S.
jboss-5.0.0.GA/server/default/deployers/jbossws.deployer
jboss-5.0.0.GA/server/default/deploy/jbossws.sar
Then i restarted Jboss and it stuck with following message on console for a minute.
19:02:43,520 INFO [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@fc9e7e(root=/u/bin/jboss-5.0.0.GA/server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
19:02:43,521 INFO [ProfileServiceImpl] Loaded profile: ProfileImpl@199f443{key=org.jboss.profileservice.spi.ProfileKey(a)143b82c3[domain=default,server=default,name=default]}
19:02:53,323 INFO [WebService] Using RMI server codebase: http://192.168.0.86:8083/
19:03:51,035 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://192.168.0.86/jndi/rmi://192.168.0.86:1090/jmxconnector
19:03:51,977 INFO [MailService] Mail Service bound to java:/Mail
19:04:00,995 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this...
OK, NOW lets assume that JBOSS wasn't deploying WebService at that time and i was misinterpreting the console log output. then at same time i checked the Server.log at location:
jboss-5.0.0.GA/server/default/log/server.log
and i found it saying that:
2009-02-11 19:02:53,303 DEBUG [org.jboss.system.ServiceConfigurator] (main) ThreadPool set to MBeanProxyExt[jboss.system:service=ThreadPool] in jboss:service=WebService
2009-02-11 19:02:53,304 DEBUG [org.jboss.system.ServiceController] (main) Creating service jboss:service=WebService
2009-02-11 19:02:53,305 DEBUG [org.jboss.web.WebService] (main) Creating jboss:service=WebService
2009-02-11 19:02:53,323 INFO [org.jboss.web.WebService] (main) Using RMI server codebase: http://192.168.0.86:8083/
2009-02-11 19:02:53,324 DEBUG [org.jboss.web.WebService] (main) Created jboss:service=WebService
2009-02-11 19:02:53,325 DEBUG [org.jboss.system.ServiceController] (main) starting service jboss:service=WebService
2009-02-11 19:02:53,325 DEBUG [org.jboss.web.WebService] (main) Starting jboss:service=WebService
2009-02-11 19:02:53,332 DEBUG [org.jboss.web.WebServer] (main) Started server: ServerSocket[addr=/0.0.0.0,port=0,localport=8083]
2009-02-11 19:02:53,338 DEBUG [org.jboss.web.WebService] (main) Started WebServer with address: /0.0.0.0:8083
2009-02-11 19:02:53,338 DEBUG [org.jboss.web.WebService] (main) Started jboss:service=WebService
2009-02-11 19:02:53,340 DEBUG [org.jboss.system.ServiceCreator] (main) About to create xmbean object: jboss:service=NamingBeanImpl with code: org.jnp.server.NamingBeanImpl with descriptor: resource:xmdesc/NamingBean-xmbean.xml
2009-02-11 19:02:53,411 DEBUG [org.jboss.system.ServiceCreator] (main) Created mbean: jboss:service=NamingBeanImpl
2009-02-11 19:02:53,412 DEBUG [org.jboss.system.ServiceController] (main) Creating service jboss:service=NamingBeanImpl
2009-02-11 19:02:53,413 DEBUG [org.jboss.system.ServiceController] (main) starting service jboss:service=NamingBeanImpl
2009-02-11 19:02:53,484 DEBUG [org.jnp.server.NamingBeanImpl] (main) Using NamingServer: org.jnp.server.NamingServer@1637d45
2009-02-11 19:02:53,484 DEBUG [org.jnp.server.NamingBeanImpl] (main) Installed global NamingServer: org.jnp.server.NamingServer@1637d45
2009-02-11 19:02:53,538 DEBUG [org.jnp.server.NamingBeanImpl] (main) InitialContext Environment:
2009-02-11 19:02:53,539 DEBUG [org.jnp.server.NamingBeanImpl] (main) key=java.naming.factory.initial, value(java.lang.String)=org.jnp.interfaces.NamingContextFactory
2009-02-11 19:02:53,539 DEBUG [org.jnp.server.NamingBeanImpl] (main) key=java.naming.factory.url.pkgs, value(java.lang.String)=org.jboss.naming:org.jnp.interfaces
2009-02-11 19:02:53,563 DEBUG [org.jboss.system.ServiceCreator] (main) About to create xmbean object: jboss:service=Naming with code: org.jboss.naming.NamingService with descriptor: resource:xmdesc/NamingService-xmbean.xml
2009-02-11 19:02:53,642 DEBUG [org.jboss.naming.Naming] (main) isTraceEnabled: false
if i am misinterpreting the console log output then can you please tell me wt are the server logs saying at same time (Creating jboss:service=WebService and Starting jboss:service=WebService)? i ll be more than thankful to you Peter.
Best Regards,
Kashif
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208940#4208940
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208940
17 years, 5 months
[JBoss Portal] - Re: Redirect portal
by alessio.papi
Hi,
my idea (implemented in my project) was to extend DefaultPortalCommandFactory and SignOutURLFactory to change the page/URL to redirect to role default page. The two factoris replace the standard factories CommandFactory and SignOutURLFactory.
For example, the redirect to home factory is something like this :
public class RedirectHomeFactory extends DefaultPortalCommandFactory {
/** Log */
private static final Log LOG = LogFactory.getLog(RedirectHomeFactory.class);
/** Slash */
private static final String SLASH = "/";
/** Mapping */
private Properties mapping;
/**
* Get mapping
* @return Mapping
*/
public Properties getMapping() {
return mapping;
}
/**
* Set mapping
* @param mapping Mapping
*/
public void setMapping(Properties mapping) {
this.mapping = mapping;
}
/**
* {@inheritDoc}
*/
@Override
public ControllerCommand doMapping(ControllerContext context, ServerInvocation serverInvocation, String host, String contextPath, String requestPath) {
// Command
ControllerCommand command = null;
// Get http request and check roles
HttpServletRequest request = serverInvocation.getServerContext().getClientRequest();
// Redirect only if portal is not specified
if (requestPath != null && (requestPath.trim().length() == 0 || requestPath.trim().equals(SLASH))) {
// Flag
boolean found = false;
// Role
String role = null;
// Get roles
Enumeration enumeration = mapping.keys();
while (!found && enumeration.hasMoreElements()) {
// Get role
role = (String) enumeration.nextElement();
// Check role
if (request.isUserInRole(role)) {
// Get portal and page of role
String[] portalAndPage = mapping.getProperty(role).split(SLASH);
if (portalAndPage == null || portalAndPage.length < 2) {
throw new IllegalStateException("Wrong portal/page for role " + role);
}
// Get portal
Portal portal = getContainer().getContext().getPortal(portalAndPage[0]);
if (portal == null) {
throw new IllegalStateException("Default portal does not exist");
}
// Get default page
Page page = portal.getPage(portalAndPage[1]);
if (page == null) {
throw new IllegalStateException("Default page does not exist");
}
// Log
LOG.debug("Redirect to " + portal.getName() + " " + page.getName());
command = new ViewPageCommand(page.getId());
found = true;
}
}
if (!found) {
// Log
LOG.debug("Default redirect, no mapped role");
// Default command
command = super.doMapping(context, serverInvocation, host, contextPath, requestPath);
}
} else {
// Log
LOG.debug("Default redirect");
// Default command
command = super.doMapping(context, serverInvocation, host, contextPath, requestPath);
}
return command;
}
}
and the mbean that replace the standard portal mbean :
<!-- Redirect to user home -->
<mbean code="com.yourcompany.RedirectHomeFactory"
name="portal:commandFactory=RedirectHome" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
role=portal/default
<depends optional-attribute-name="NextFactory" proxy-type="attribute">portal:commandFactory=Delegating
<depends optional-attribute-name="Container" proxy-type="attribute">portal:container=PortalObject
you have to change the portal mbean controller properties :
<!--
<depends
optional-attribute-name="CommandFactory"
proxy-type="attribute">portal:commandFactory=DefaultPortal
-->
<depends
optional-attribute-name="CommandFactory"
proxy-type="attribute">portal:commandFactory=RedirectHome
For the signout the code is the same :
public class SignOutFactory extends SignOutURLFactory {
/** Log */
private static final Log LOG = LogFactory.getLog(SignOutFactory.class);
/** Location */
private static final String LOCATION = "location";
/** Mapping */
private Properties mapping;
/**
* Get mapping
* @return Mapping
*/
public Properties getMapping() {
return mapping;
}
/**
* Set mapping
* @param mapping Mapping
*/
public void setMapping(Properties mapping) {
this.mapping = mapping;
}
/**
* {@inheritDoc}
*/
@Override
public ServerURL doMapping(ControllerContext context, ServerInvocation serverInvocation, ControllerCommand controllerCommand) {
// URL
ServerURL serverURL = super.doMapping(context, serverInvocation, controllerCommand);
if (serverURL != null) {
// Get http request and check roles
HttpServletRequest request = serverInvocation.getServerContext().getClientRequest();
// Flag
boolean found = false;
// Role
String role = null;
// Get roles
Enumeration enumeration = mapping.keys();
while (!found && enumeration.hasMoreElements()) {
// Get role
role = (String) enumeration.nextElement();
// Check role
if (request.isUserInRole(role)) {
// Get location for role
try {
serverURL.setParameterValue(LOCATION, URLEncoder.encode(mapping.getProperty(role), "UTF-8"));
} catch (UnsupportedEncodingException encEx) {
LOG.error("Unsupported encoding " + encEx);
}
found = true;
}
}
}
return serverURL;
}
}
the mbean :
<!-- Redirect to user login -->
<mbean code="yourcompany.SignOutFactory"
name="portal:urlFactory=SignOut" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
role=portal/YourPortal
/signout
<depends optional-attribute-name="Factory" proxy-type="attribute">portal:urlFactory=Delegating
and comment out the portal signout mbean :
<!--
<mbean
code="org.jboss.portal.core.controller.command.mapper.SignOutURLFactory"
name="portal:urlFactory=SignOut"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
/signout
<depends
optional-attribute-name="Factory"
proxy-type="attribute">portal:urlFactory=Delegating
-->
This solution redirects to default role portal only if the user doesn't specify the complete URL, to prevent users to go to another portal you have to add security-constraint into your portal-object.xml file.
HTH
Alessio
(Sorry for poor English...)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208933#4208933
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208933
17 years, 5 months