当我将 jboss-deployment-struct.xml 添加到我的 .war 中并在 AS7 中部署时,出现以下错误。
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
Message: Unexpected element '{urn:jboss:deployment-structure:1.2}jboss-deployment-structure'
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
Run Code Online (Sandbox Code Playgroud)
下面附有示例 xml。
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>
Run Code Online (Sandbox Code Playgroud)
有什么原因导致我收到部署错误吗?
信息:我的应用程序是一个简单的 JAX-RS 服务,它将一些值存储在 JBoss 7.1 提供的缓存中。
我想使用 Arquillian 调用服务并测试响应。但不幸的是,当我尝试运行测试时出现此错误:
java.lang.IllegalArgumentException:
Can not set org.infinispan.manager.CacheContainer field
com.company.DataCache.container to
org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager
Run Code Online (Sandbox Code Playgroud)
这是我的 DataCache 类:
@ManagedBean
public class DataCache<K, V> {
@Resource(lookup="java:jboss/infinispan/container/hibernate")
private CacheContainer container;
private Cache<K, V> cache;
@PostConstruct
public void start() {
this.cache = this.container.getCache();
}
public Cache<K, V> getCache() {
return cache;
}
}
Run Code Online (Sandbox Code Playgroud)
我的测试类看起来像这样:
@RunWith(Arquillian.class)
@RunAsClient
public class SyncClientServerTest extends RbmlClientServerTest {
@Deployment(testable = false)
public static WebArchive createDeployment() {
MavenDependencyResolver mvnResolver = DependencyResolvers.use(MavenDependencyResolver.class).loadMetadataFromPom("pom.xml").goOffline();
return ShrinkWrap
.create(WebArchive.class, "cache-service.war")
.addPackages(true, …
Run Code Online (Sandbox Code Playgroud) dependency-injection exception infinispan jboss-arquillian jboss7.x
我正在尝试使用共享的 Infinispan 缓存(异步复制)对一对服务器进行集群。一个总是成功启动,并在 JDBC 数据库中正确注册自己。当另一个启动时,它在数据库中正确注册,我看到它们之间有一堆喋喋不休,然后,在等待第二个服务器的响应时,我得到
`org.infinispan.commons.CacheException: Initial statue transfer timed out`
Run Code Online (Sandbox Code Playgroud)
我认为这只是配置问题,但我不确定如何调试我的配置问题。我花了几天时间配置和重新配置我的 Infinispan XML 和 JGroups.xml:
无限跨度:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:6.0"
xsi:schemaLocation="urn:infinispan:config:6.0 http://www.infinispan.org/schemas/infinispan-config-6.0.xsd
urn:infinispan:config:remote:6.0 http://www.infinispan.org/schemas/infinispan-cachestore-remote-config-6.0.xsd"
xmlns:remote="urn:infinispan:config:remote:6.0"
>
<!-- *************************** -->
<!-- System-wide global settings -->
<!-- *************************** -->
<global>
<shutdown hookBehavior="DEFAULT"/>
<transport clusterName="DSLObjectCache">
<properties>
<property name="configurationFile" value="jgroups.xml"/>
</properties>
</transport>
<globalJmxStatistics enabled="false" cacheManagerName="Complex.com"/>
</global>
<namedCache name="ObjectCache">
<transaction transactionMode="TRANSACTIONAL" />
<locking
useLockStriping="false"
/>
<invocationBatching enabled="true"/>
<clustering mode="replication">
<async asyncMarshalling="true" useReplQueue="true" replQueueInterval="100" replQueueMaxElements="100"/>
<stateTransfer fetchInMemoryState="true" />
</clustering>
<eviction strategy="LIRS" maxEntries="500000"/>
<expiration …
Run Code Online (Sandbox Code Playgroud) 我知道这已被问过很多次了(已经在这里和其他网站上发布了大部分帖子),但我没有解决我的问题.
我的设置是:jpa 2 + hibernate 4 + spring 4 + primefaces + jboss eap 7
问题:我有一个懒惰的集合到另一个bean,但是当我在bean上调用.size()方法时,它会抛出"LazyInitializationException:懒得初始化一个角色集合:com.pe.controlLines.data .model.Activity.activityRisks,无法初始化代理 - 没有会话"
我确定在@Transactional方法和 http://blog.timmattison.com/archives/2012/04/19/tips-for-debugging-springs-transactional-annotation/之后,这个LazyInitializationException之后有一个活动的事务所以我是100%确定当时正在运行的交易.
我的实体声称:
@Entity
public class Company {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long companyId;
@Column
private String name;
@OneToOne(cascade={CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE})
private Activity companieActivities;
@OneToMany
private Collection<SourceSupervision> sourceSupervisions;
Run Code Online (Sandbox Code Playgroud)
和嵌套类
@Entity
@Indexed
public class Activity {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long activityId;
@ManyToOne
@JoinColumn(name="parentActivityId")
private Activity parent;
@Column
@Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO)
@Analyzer(definition = …
Run Code Online (Sandbox Code Playgroud) 我正在尝试我的第一个REST应用程序.
以下是我的配置:
以下是Maven下载的罐子列表:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.prasad</groupId>
<artifactId>messenger</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>messenger</name>
<build>
<finalName>messenger</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
<exclusions>
</exclusions>
</dependency>
<!-- uncomment this to get JSON support
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
</dependency> …
Run Code Online (Sandbox Code Playgroud) 我已经在 windows 7 x64 操作系统上安装了 Jboss EAP-7.0.0。
当我通过 bin direcotry 内的 standalone.bat 文件运行 Jboss EAP-7.0.0 时,它启动时没有任何问题,部署的 .war 文件也可以正常工作,但当我尝试serice.bat install
在 bin direcotry 内运行命令时,它在控制台中提供以下输出:Please install native utilities into expected location D:\jboss EAP-7.0.0\EAP-7.0.0\..\jbcs-jsvc-1.0
我试着用谷歌搜索这个问题。我还尝试点击此链接:无法将 EAP 7 作为 Windows 服务启动。(您可能需要登录网页才能查看整个讨论)和此链接4.3。在 MICROSOFT WINDOWS SERVER 中配置 JBOSS EAP 作为服务,但产品下拉列表为空(请参见图片)
我真的很困惑,需要你的帮助:我如何下载和安装 jbcs-jsvc-1.0 ?
我已经建立了一个Jboss域环境,它由两个Jboss服务器组成,其中一个是主服务器,另一个是从属服务器。但是,当我尝试将简单的Java Web演示部署到服务器组中时,从属日志中出现以下错误:
[Server:server-one] 16:20:37,024 ERROR [org.jboss.as.controller] (pool-1-thread-2) Operation ("add") failed - address: ([("deployment" => "jspdemo.war")]) - failure description: "No deployment content with hash eeeabd6c922da77e90db743602e6d24ba5592ce2 is available in the deployment content repository."
Run Code Online (Sandbox Code Playgroud)
这是控制台管理的屏幕截图:
我有客户端服务器应用程序,JBossAS7和客户端使用服务器提供的远程EJB.我必须将文件从客户端传递到服务器,然后通过InputStream进一步处理.还必须将文件从服务器传递到客户端,在服务器上我得到OutputStream.文件大小不受限制,甚至可能是5GB.我该怎么做才能实现这种情况的解决方案?传递byte []数组似乎不是一个好的解决方案,RMI限制了我读过的大小.RMIIO是GPL(我需要商业用途的解决方案).http转移是唯一合理的方式吗?
编辑:似乎RMIIO总是LGPL!
我有一个通过JBoss7.1 Web界面创建的Infinispan缓存.它被配置为索引的分布式缓存.
在我的jboss-deployment-structure.xml
文件中,我添加了依赖项org.infinispan
,org.hibernate
因此我可以访问我的缓存.我还在以下内容中添加了maven依赖项:
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>5.1.7.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query</artifactId>
<version>5.1.7.Final</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
5.1.7.Final是我正在使用的JBoss7.1.3中的org.infinispan模块中包含的版本.这将引入所有必需的依赖项(包括lucene
和hibernate-search-engine
),因此我在项目中拥有必要的库.但是,在执行此处提到的初始步骤时:
SearchManager searchManager = Search.getSearchManager( cache );
Run Code Online (Sandbox Code Playgroud)
它调用ComponentRegistryUtils.getComponent(cache, SearchFactoryIntegrator.class)
失败抛出IllegalArgumentException
:
此缓存未启用索引.接口org.hibernate.search.spi.SearchFactoryIntegrator在注册表中找不到
我的缓存启用了索引,cache.getCacheConfiguration().indexing().enabled()
返回时可以看到true
.但应用程序认为不是.也许这是因为缓存ComponentRegistry
不能访问org.hibernate.search.spi.SearchFactoryIntegrator
类(缓存是JBoss全局组件,而hibernate搜索lib在我的WAR WEB-INF/lib
目录中).
还有另一种方法我应该这样做吗?
我目前正在尝试使用Maven设置Spring MVC 3.1.1项目并在JBoss 7.1.1上进行部署.我已经尝试了一些教程,但是我无法完成任何操作,因为在某些时候我会遇到教程中假定的并且在我的设置中不存在的东西.
我的第二次尝试是使用eclipse创建一个"Spring MVC项目",并将配置文件从一个正在运行的Spring MVC项目复制/粘贴到我的新项目,但到目前为止还不错.
我使用JPA创建了我的整个域,现在我尝试部署,我得到了这个异常: Schema export unsuccessful: java.lang.UnsupportedOperationException: The application must supply JDBC connections.
我发现很多论坛帖子等人都有同样的问题,但没有一个提议的解决方案适合我的问题.Postgresql驱动程序在maven依赖项中定义良好,并且位于构建路径中.
这是main/src/resources/META-INF/persistence.xml文件:
<persistence-unit name="root">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.macoloc.domain.Colocation</class>
<class>com.macoloc.domain.Invitation</class>
<class>com.macoloc.domain.Key</class>
<class>com.macoloc.domain.Message</class>
<class>com.macoloc.domain.MessageSeenBy</class>
<class>com.macoloc.domain.Payment</class>
<class>com.macoloc.domain.PaymentParticipation</class>
<class>com.macoloc.domain.Ping</class>
<class>com.macoloc.domain.Subtask</class>
<class>com.macoloc.domain.Task</class>
<class>com.macoloc.domain.TaskOrder</class>
<class>com.macoloc.domain.User</class>
<class>com.macoloc.domain.Versionable</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
Run Code Online (Sandbox Code Playgroud)
这是src/main/webapp/WEB-INF/web.xml文件:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml,/WEB-INF/spring/infrastructure/infrastructure.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping> …
Run Code Online (Sandbox Code Playgroud)