我试图将我的JBOSS 5.1应用程序迁移到JBOSS 7.0.2.在管理控制台中,我选择部署 - >添加内容和我的.war并尝试启用它.我已经解决了一些问题,但是无法解决这个问题:(简而言之,在最后很长时间)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.ZaprogsProject.war:main" from Servic
e Module Loader]
Run Code Online (Sandbox Code Playgroud)
我复制到JBOSS7\standalone\lib\以下文件:
spring-aop-3.0.5.RELEASE.jar
spring-asm-3.0.5.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-context-support-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-expression-3.0.5.RELEASE.jar
spring-jdbc-3.0.5.RELEASE.jar
spring-orm-3.0.5.RELEASE.jar
spring-test-3.0.5.RELEASE.jar
spring-tx-3.0.5.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
Run Code Online (Sandbox Code Playgroud)
我读过这个:https ://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 (调试并解决ClassNotFoundExceptions和NoClassDefFoundErrors)但无法为我找到解决方案并仍然得到相同的错误.有人可以帮忙吗?
22:19:12,091 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."ZaprogsProject.war".INSTALL: o
rg.jboss.msc.service.StartException in service jboss.deployment.unit."ZaprogsProject.war".INSTALL: Failed to process phase INSTALL of deployment "ZaprogsProject
.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) …Run Code Online (Sandbox Code Playgroud) 我在WHERE子句中的CASE语句有问题.在我的查询中,我想获得日期之前的行.日期检查3列.date1是NOT NULL所以我不需要有一个NULL检查,但日期date2,date3可以是NULL所以我想检查空值,并相应地检查日期条件.我尝试了两种方法,但无法弄清楚如何正确地做到这一点.你能帮我吗?
查询1:
SELECT *
FROM
docs
WHERE
date1 < '20120601'
AND CASE
WHEN date2 IS NOT NULL AND date3 IS NOT NULL THEN date2 < '20120601'
WHEN date2 IS NOT NULL AND date3 IS NULL THEN date2 < '20120601'
WHEN date2 IS NULL AND date3 IS NOT NULL THEN date3 < '20120601'
END
Run Code Online (Sandbox Code Playgroud)
这在以下情况下给出了错误: Incorrect syntax near '<'.
我修改了我的查询:
SELECT *
FROM
docs
WHERE
date1 < '20120601'
AND CASE
WHEN date2 IS NOT …Run Code Online (Sandbox Code Playgroud) 我正在使用Visual Studio 2010 Express Edition编写应用程序.我在使用Excel Automation时遇到问题.我添加了一个COM参考Microsoft Excel 12.0对象库.它添加了以下参考文献:
Microsoft.Office.Core
Microsoft.Office.Interop.Excel
VBIDE
Run Code Online (Sandbox Code Playgroud)
我还添加了一个using子句:
using Microsoft.Office.Interop.Excel;
Run Code Online (Sandbox Code Playgroud)
然后我从微软获取了一个代码片段:
m_objExcel = new Excel.Application();
m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;
m_objBook = (Excel._Workbook)(m_objBooks.Add(m_objOpt));
Run Code Online (Sandbox Code Playgroud)
并强调Excel和喊叫:
找不到类型或命名空间名称"Excel"(您是否缺少using指令或程序集引用?)
我安装了Office 2007 Professional Plus和".net 2.0 Microsoft Forms的互操作性组件"(抱歉,从波兰语翻译).目标框架是.NET 4 Client Profile.
什么想法可能是错的?
我有一个Delphi 7程序,它必须复制docx文件.我正在使用Windows API CopyFile函数.问题是这个函数似乎隐藏了转换为旧的doc格式.第一件事:复制后文件大小增加.第二:在Office 2007中打开文件时,我收到一条错误消息,指出:检查您对文档或磁盘的权限,检查可用磁盘空间.
而且奇怪的是:如果我在TotalCommander中更改了从docx到doc的复制文件的扩展名,它会正常打开.所以它似乎使隐藏的转换不知道为什么.
在两台不同的计算机上测试过.Win XP Prof SP3,Office 2007 Prof Plus SP2
有任何想法吗?
功能体如下:
function TDlgNowySzablon.PobierzPlikNaDoc() : string;
var
openDlg : TOpenDialog;
begin
Result:='';
openDlg:=TOpenDialog.Create(self);
openDlg.Filter:='Dokumenty Microsoft Word (*.doc;*docx)|*.doc;*.docx';
if openDlg.Execute then begin
Result := IObsSzab.GetTempFullFileName( ExtractFileExt(openDlg.FileName) );
if not CopyFile(PChar(openDlg.FileName),PChar(Result),true) then begin
Result:='';
end;
end;
openDlg.Free;
end;
Run Code Online (Sandbox Code Playgroud) 在SQL Server中,我想要PIVOT表并添加WHERE子句,但我无法弄清楚语法。
Run Code Online (Sandbox Code Playgroud)dbo.SOME_VIEW YEAR AMOUNT ==================== 2014 1 2013 2 2012 5.6 2011 574 2010 123
SELECT
*
FROM SOME_VIEW
PIVOT (SUM(AMOUNT) FOR [YEAR] IN ([2012], [2013], [2014])) AS PIVOTED
Run Code Online (Sandbox Code Playgroud)
现在,我只想从视图中获得将要年份的行,因此我想添加
WHERE YEAR IN (2012, 2013, 2014)
放在WHERE之后FROM SOME_VIEW
SELECT
*
FROM SOME_VIEW WHERE YEAR IN (2012, 2013, 2014)
PIVOT (SUM(AMOUNT) FOR [YEAR] IN ([2012], [2013], [2014])) AS PIVOTED
Run Code Online (Sandbox Code Playgroud)
我得到:Incorrect syntax near the keyword 'PIVOT'。当我WHERE在末尾添加时,我得到了Invalid column name 'YEAR'。 …
将 Apache POI 从 3.17 更新到 4.0.0 后,我上线了:
OPCPackage pck = OPCPackage.open(this.getTemplate());
一个例外:
java.lang.IllegalArgumentException: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:144)
at __redirected.__DocumentBuilderFactory.setAttribute(__DocumentBuilderFactory.java:125)
at org.apache.poi.ooxml.util.DocumentHelper.trySetXercesSecurityManager(DocumentHelper.java:143)
at org.apache.poi.ooxml.util.DocumentHelper.<clinit>(DocumentHelper.java:108)
at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:392)
at org.apache.poi.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:104)
at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:54)
at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:258)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:725)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:275)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:181)
Run Code Online (Sandbox Code Playgroud)
他们在如何使用 logback 禁用 accessExternalDTD 和 entityExpansionLimit 警告中说,我应该排除 xerces,但我已经有了:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.0</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我的设置:
回到 3.17 解决了这个问题。
我想在 JPA 中映射不寻常的表设置。这是一个简化的示例:
book
company_id int
book_id int
series_id int
borrow
company_id int
book_id int
type char
Run Code Online (Sandbox Code Playgroud)
问题borrow.book_id是超载:
borrow.type是'B',那么borrow.book_id == book.book_idborrow.type是'S',那么borrow.book_id == book.series_id这种关系在逻辑上borrow是多对一的book。直接用例是:获取borrow给定books列表的所有行。这应该如何在 Spring Data JPA 中映射?