我们将应用程序从JBoss 5迁移到JBoss6,其中一个主要原因是利用了servlet 3.0的新功能.除了JBoss 6和servlet 3.0的一个新功能之外,一切正常:将会话cookie设置为仅通过安全通道传输,即使请求是通过纯HTTP进行的.这对我们来说是一个非常重要的安全功能,可以通过添加来实现
<secure>true</secure>
Run Code Online (Sandbox Code Playgroud)
在web.xml中.这是我们web.xml的一部分:
<session-config>
<session-timeout>25</session-timeout>
<cookie-config>
<http-only>true</http-only>
<secure>true</secure>
</cookie-config>
<tracking-mode>COOKIE</tracking-mode>
Run Code Online (Sandbox Code Playgroud)
当我们删除
<secure>true</secure>
Run Code Online (Sandbox Code Playgroud)
一切正常.当它存在时,即使在安全页面(HTTPS)或不安全页面(HTTP)上,也会为每个请求生成新的jsessionid.此外,登录无效,因为在使用安全凭据登录后,用户将被重定向回登录页面.
我想这可能也是Tomcat 7的一个问题,因为它也使用了servlet 3.0规范.任何建议将不胜感激.
问候
什么是Jboss EAP 6的默认管理控制台密码..?
它不允许我看到没有密码的管理控制台.我也找不到配置页面.
请指教.
我知道在JSF2中有很多关于将空字符串转换为null的帖子.通常的处方是将以下内容添加到web.xml中.
<context-param>
<description>Does not appear to work</description>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
这根本不起作用 - 根本没有.然后我创建了一个自定义字符串转换器来测试它是否可行.我明确地将它作为转换器添加到我的inputText中(否则它在空白时不会触发).
当INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL设置为true时,转换器接收null,输入文本的setter仍然接收"".
当INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL设置为false(或注释掉)时,转换器接收""并且输入文本的setter接收""(即使在转换器返回null之后).
@FacesConverter(forClass=java.lang.String.class, value="emptyStringToNull")
public class StringConverter implements Converter, Serializable {
private static final long serialVersionUID = -1121162636180944948L;
public Object getAsObject(FacesContext context, UIComponent component, String value) {
if (value == null || value.trim().isEmpty()) {
return null;
}
return value;
}
public String getAsString(FacesContext context, UIComponent component, Object object) {
if (object == null)
return null;
return object.toString();
}
}
Run Code Online (Sandbox Code Playgroud)
我试过(无济于事)在getAsObject中显式设置组件提交的值:
if (component instanceof EditableValueHolder)
((EditableValueHolder) component).setSubmittedValue(null);
Run Code Online (Sandbox Code Playgroud)
我正在使用JBoss6(6.1的快照)和JSF …
我正在使用JBoss 6.1,我得到了一个带有注释方法的安全EJB @RolesAllowed("Admin")
.我试图用Arquillian测试这个方法.
我已经@Before
在测试中成功完成了EJB日志,但是,它无法调用该方法.从TRACE日志中,我可以看到主体和角色是正确的(在这种情况下,'myuser'
和'Admin'
),但安全EJB的方法信息是错误的(requiredRoles
为空).
TRACE [org.jboss.security.plugins.authorization.JBossAuthorizationContext] Control flag for entry:org.jboss.security.authorization.config.AuthorizationModuleEntry{org.jboss.security.authorization.modules.DelegatingAuthorizationModule:{}REQUIRED}is:[REQUIRED]
TRACE [org.jboss.security.authorization.modules.ejb.EJBPolicyModuleDelegate] method=public au.com.domain.DTOObject au.com.ejb.SecureServiceBean.save(au.com.domain.DTOObject), interface=Local, requiredRoles=Roles()
TRACE [org.jboss.security.authorization.modules.ejb.EJBPolicyModuleDelegate] Exception:Insufficient method permissions, principal=myuser, ejbName=SecureServiceBean, method=save, interface=Local, requiredRoles=Roles(), principalRoles=Roles(Admin,)
Run Code Online (Sandbox Code Playgroud)
我能够在同一个EJB中成功调用一个方法@PermitAll
.
我已经查找了关于安全EJB的Arquillian文档,但找不到任何文档.
非常感谢您的帮助.
- 林
我正在尝试使用8080端口号启动JBoss 6.1.0.但Oracle RDBMS正在8080端口上运行.所以我得到了java.bind错误.所以我试图在\ server\all\deploy\jbossweb.sar\server.xml中将Jboss AS端口更改为8181.
但它没有意义.我仍然得到同样的错误.
谢谢
我正在编写一个RESTful服务(在JBoss上使用CXF),我在其中使用Spring(Autowired)注入另一个类.但是这个类没有被注入而且是空的.
Web服务接口和类(需要注入的地方)
package com.company.project.web;
@Path("/myws")
public interface IMyWebService {
@POST
@Path("/doSomething")
@Consumes("application/json")
@Produces("application/json")
MyResponse doSomething(MyRequest myRequest)
}
@Service("myWebService")
public class MyWebService implements IMyWebService {
@Autowired
private IMyCore myCore;
public MyResponse doSomething(MyRequest myRequest) {
....
}
}
Run Code Online (Sandbox Code Playgroud)
那必须注入
package com.company.project.biz;
public interface IMyCore {
MyResponse doSomething(MyRequest myRequest);
}
@Component("myCore")
public class MyCore implements IMyCore {
public MyResponse doSomething(MyRequest myRequest) {
.....
}
}
Run Code Online (Sandbox Code Playgroud)
beans.xml中
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://www.springframework.org/schema/context …
Run Code Online (Sandbox Code Playgroud) 我正在运行我的服务器JBoss
6.x运行时服务器eclipse Kepler
.当我运行我的服务器时,我得到了
JBoss 6.x Runtime Server [Started,synchronized]
Run Code Online (Sandbox Code Playgroud)
但是当访问时
http://localhost:8080/
http://localhost:8080/admin-console
Run Code Online (Sandbox Code Playgroud)
我有空白页面.我改变一些设置,但没有任何帮助.我xampp
已经安装在我的Windows操作系统上.
jboss
使用命令提示符下,tomcat
从xampp
也得到自动启动.所有端口都工作正常.服务器端口选择8080但仍然缺少一些请任何人帮助我.
我有一个在jboss 6.1上运行的应用程序,它基于已经存在于数据库中的信息在启动时定义了很多dinamyc定时器(例如每分钟doSomething).计时器基于以下信息创建:
TimerConfig timerConfig = new TimerConfig();
timerConfig.setInfo(info);
timerConfig.setPersistent(false);
Timer timer = timerService.createCalendarTimer(scheduleExpression,
timerConfig);
Run Code Online (Sandbox Code Playgroud)
今天我发现创建的"每分钟"计时器不再起作用了.检查昨天的日志,我发现这个奇怪的错误(下面的完整strack跟踪)
Error invoking timeout for timer: [id=32b0902e-d1ee-4090-9938-98349a20340d timedObjectId=jboss.j2ee:ear=myear.ear,jar=myjar.jar,name=AppScheduler,service=EJB3 auto-timer?:false persistent?:false
timerService=org.jboss.ejb3.timerservice.mk2.TimerServiceImpl@4036a060 initialExpiration=Thu Jan 17 00:00:00 GMT-02:00 2013 intervalDuration(in milli sec)=0 nextExpiration=Sun Jan 20 06:06:00 GMT-02:00 2013 timerState=IN_TIMEOUT:
javax.ejb.ConcurrentAccessTimeoutException: EJB 3.1 PFD2 4.8.5.5.1
concurrent access timeout on [advisedMethod=public void my.app.AppScheduler.process(javax.ejb.Timer), unadvisedMethod=public void my.app.AppScheduler.process(javax.ejb.Timer), metadata=null, targetObject=my.app.AppScheduler@97672ba, arguments=[Ljava.lang.Object;@3f661630]
- could not obtain lock within 5MINUTES
at org.jboss.ejb3.concurrency.aop.interceptor.ContainerManagedConcurrencyInterceptor.invoke(ContainerManagedConcurrencyInterceptor.java:176) [:1.0.0-alpha-4]
at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:86) [jboss-aop.jar:2.2.2.GA]
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.7.21]
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) …
Run Code Online (Sandbox Code Playgroud) 我在项目中使用JAVA SE 1.7和JAVA EE 7,
哪些是可用的服务器(商业/免费),它们将支持JAVA EE 7 web profile 2.1?(必需组件).我需要使用Servlet 3.1和CDI 1.1 ..etc.
JavaEE的-spec_WebProfile
我尝试使用JBoss EAP 6.1/Jboss 7,但我开始知道它将支持JAVA EE 6 web配置文件.(web-profile1,web-profile2)
我发现JAVA EE 7兼容服务器是GlassFish Server Open Source Edition 4.0,TMAX JEUS 8.
还有其他服务器?
当我尝试将jbosseap6.3安装为服务时.我得到了以下错误.任何人都对以下错误有任何想法.任何一个光明灯都意味着它对我很有帮助.
java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE"
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:119)
at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:338)
at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:291)
at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:300)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:542)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
at org.jboss.as.logging.logmanager.ConfigurationPersistence.configure(ConfigurationPersistence.java:149)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:300)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:262)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at org.jboss.modules.Main.main(Main.java:443)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:117)
... 18 more
Caused by: java.io.FileNotFoundException: C:\jboss-eap-6.3\standalone\log\server.log (The process cannot access the file because it is …
Run Code Online (Sandbox Code Playgroud)