我正在迁移到JBoss AS 7,并使用maven build,在我看来maven-ear-plugin还不支持JBoss AS 7.默认情况下,它使用JBoss AS 4.
这会导致问题吗?
我还在努力弄清楚如何构建我的档案,现在有与JBoss AS 7类加载器工作方式的变化有关的问题.
我有一个带有嵌套EJB项目的EAR文件,一个.war动态Web项目和一个包含实体bean定义的.jar文件.
我正在尝试使用此远程接口创建一个简单的基于SOAP的Web服务:
package session;
import javax.ejb.Remote;
import javax.jws.WebMethod;
import javax.jws.WebService;
@Remote
@WebService
public interface HelloWorldRemote {
@WebMethod
public String greet(String from);
@WebMethod
public String getMessage();
}
Run Code Online (Sandbox Code Playgroud)
和这个实现类:
package session;
import javax.ejb.Stateless;
import javax.jws.WebService;
@Stateless
@WebService(endpointInterface = "session.HelloWorldRemote", serviceName = "HelloWorldWS")
public class HelloWorldImpl implements HelloWorldRemote {
public String greet(String from) {
return "Hello, " + from + ".";
}
public String getMessage() {
return "It's working.";
}
}
Run Code Online (Sandbox Code Playgroud)
但是,当我部署EAR文件时,日志没有提及类,WSDL,Web服务或任何会让我相信它正在尝试根据我的注释创建Web服务的任何内容.
我错过了什么?
我正处于从JBoss AS 6到JBoss AS 7的迁移过程中,并且我的测试有问题.我们假设一个简单的实体EJB:
@Entity public class MyTest implements Serializable
{
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private long id;
@NotNull
private String headline;
} //getter/setter
Run Code Online (Sandbox Code Playgroud)
在我@Stateless Bean做这样的事情(就像之前的JBoss5和JBoss6):
@Inject private EntityManager em;
public <T extends Object> T persist(T o) throws MyContraintViolationException
{
System.out.println("***************** persist:");
try
{
em.persist(o);
}
catch (Exception e)
{
System.out.println("*************** exception:");
// Further investigation of Exception e,
// then throw MyContraintViolationException
}
}
Run Code Online (Sandbox Code Playgroud)
如果我不违反@NotNull约束,这可以正常工作.如果headline==null,我得到例外,但不要输入我的catch块:
12:19:45 INFO ******************** persist:
12:19:45 WARN …Run Code Online (Sandbox Code Playgroud) 有什么区别
final Properties properties = new Properties(System.getProperties());
Run Code Online (Sandbox Code Playgroud)
和
final Properties properties = new Properties();
properties.putAll(System.getProperties());
Run Code Online (Sandbox Code Playgroud)
我已将我的应用程序移至OpenShift,现在,为了方便实际工作,我想启用页内错误和警告.目前,我看到一个空白页面.
我该如何启用错误?
在PHP中,它在 php.ini
error_reporting = E_ALL
display_errors = 1
Run Code Online (Sandbox Code Playgroud) 我想将一些对象实例绑定到使用 Javassist 创建的类。这个对象是从某个来源读取的,数据是不知道的。
// Create the class.
CtClass subClass = pool.makeClass( fullName );
final CtClass superClass = pool.get( Foo.class.getName() );
subClass.setSuperclass( superClass );
// Add a static field containing the definition. // Probably unachievable.
final CtClass defClass = pool.get( SomeMetaData.class.getName() );
CtField defField = new CtField( defClass, "DEF", subClass );
defField.setModifiers( Modifier.STATIC );
subClass.addField( CtField.Initializer.??? );
return subClass.toClass();
Run Code Online (Sandbox Code Playgroud)
但是当我检查 API 时,Javassist 似乎创建了一个真正的字节码,它根据“调用这个”或“实例化那个”或“使用这个常量”来存储初始化。
有没有办法让 Javassist 添加一个静态字段,该字段已初始化为运行时给定的现有实例?
我是新手JBOSS.我下载jboss-as-7.1.1.Final.zip并解压缩此zip文件.然后我转到bin文件夹并双击standalone.bat但新的cmd窗口在2-3秒内打开和关闭.
我尝试通过cmd启动服务器.我以两种方式打开cmd
1.正常模式
我得到两种方式:
Calling "P:\Software\JBOSS\jboss-as-7.1.1.Final\bin\standalone.conf.bat"
'findstr' is not recognized as an internal or external command,
operable program or batch file.
然后停止
所以JBoss服务器无法启动.
我添加了环境变量.
JBOSS_HOME : P:\Software\JBOSS\jboss-as-7.1.1.Final
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_21
如何在Window 7上运行JBoss服务器并在其中部署项目?
是否可以使用一些智能管道和编码,以递归方式合并yaml文件?在PHP中,我创建了一个数组(每个模块可以添加或更新系统中的/的配置节点).
目标是导出shellcript,它将所有单独的模块文件夹的配置文件合并为大合并文件.例如,它更快,更高效,客户在我们通过FTP部署新版本时不需要模块化.
它应该像PHP函数一样: array_merge_recursive
文件系统结构如下:
mod/a/config/sys.yml
mod/a/config/another.yml
mod/b/config/sys.yml
mod/b/config/another.yml
mod/c/config/totally-new.yml
sys/config/sys.yml
Run Code Online (Sandbox Code Playgroud)
配置看起来像:
date:
format:
date_regular: %d-%m-%Y
Run Code Online (Sandbox Code Playgroud)
例如,一个模块可以这样做:
date:
format:
date_regular: regular dates are boring
date_special: !!!%d-%m-%Y!!!
Run Code Online (Sandbox Code Playgroud)
到目前为止,我有:
#!/bin/bash
#........
cp -R $dir_project/ $dir_to/
for i in $dir_project/mod/*/
do
cp -R "${i}/." $dir_to/sys/
done
Run Code Online (Sandbox Code Playgroud)
这当然会破坏循环中所有现有的配置文件..(其余的系统文件都是唯一命名的)
基本上,我需要一个用于命令行的yaml解析器,以及一个像array_merge_recursive一样的替代方法.然后一个yaml作家输出它合并.我担心我必须开始学习Python,因为bash不会在这个上削减它.
我正在使用Jersey 1.0 http-client调用资源并反序列化响应JSON,如下所示:
Client client = Client.create(new DefaultClientConfig())
ClientResponse clientResponse = client.resource("http://some-uri").get(ClientResponse.class)
MyJsonRepresentingPOJO pojo = clientResponse.getEntity(MyJsonRepresentingPOJO.class)
Run Code Online (Sandbox Code Playgroud)
现在,响应JSON具有一些新字段,并且出现以下异常:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "xyz"
Run Code Online (Sandbox Code Playgroud)
如何将杰克逊的反序列化模式更改为NON-STRICT,以便它将忽略新字段?
假设我有:
class Foo {}
class Bar extends Foo {}
var clazz = Bar;
Run Code Online (Sandbox Code Playgroud)
我发现要到达Bar那里clazz.prototype.constructor。
我如何找出 的父类是什么Bar?
java ×5
jboss7.x ×3
annotations ×1
bash ×1
constructor ×1
ejb ×1
jackson ×1
java-ee-6 ×1
java-ee-7 ×1
javascript ×1
javassist ×1
jboss ×1
jersey ×1
jersey-1.0 ×1
jpa-2.0 ×1
json ×1
map ×1
maven ×1
migration ×1
openshift ×1
persistence ×1
php ×1
properties ×1
recursion ×1
reflection ×1
static ×1
superclass ×1
typescript ×1
web-services ×1
yaml ×1