我有一个大的弹簧应用程序使用注释在春季4.3.13工作正常,我期待更新到春季5.我得到各种故障布线豆,看起来像典型的:
Unsatisfied dependency expressed through field 'pcoDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.acme.dao.impl.contracts.PotentialChangeOrderDAO' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Run Code Online (Sandbox Code Playgroud)
启用弹簧调试日志记录,只能阻止此额外行
Failed to meta-introspect annotation interface org.springframework.beans.factory.annotation.Autowired: java.lang.NullPointerException
Run Code Online (Sandbox Code Playgroud)
它不像所有@Autowired字段都失败,只是这个(到目前为止).bean由接口指定,并且实现位于接口的子包中,但之前再次使用.接口的包直接在上下文中指定:component-scan base-package ="com.acme.package.of.interface"
再次这在4.3.13中工作正常,唯一的变化是spring被升级到5.0.5-RELEASE.
他们对春天如何找到豆类有任何已知的变化吗?或者有关于此的任何文件?
我需要调用上游服务(Azure Blob 服务)将数据推送到 OutputStream,然后我需要通过 akka 将其转回客户端。如果没有 akka(只有 servlet 代码),我只会获取 ServletOutputStream 并将其传递给 azure 服务的方法。
我可以尝试偶然发现的最接近的,显然这是错误的,是这样的
Source<ByteString, OutputStream> source = StreamConverters.asOutputStream().mapMaterializedValue(os -> {
blobClient.download(os);
return os;
});
ResponseEntity resposeEntity = HttpEntities.create(ContentTypes.APPLICATION_OCTET_STREAM, preAuthData.getFileSize(), source);
sender().tell(new RequestResult(resposeEntity, StatusCodes.OK), self());
Run Code Online (Sandbox Code Playgroud)
这个想法是我正在调用上游服务以通过调用 blobClient.download(os); 来获取填充的输出流;
似乎 lambda 函数被调用并返回,但随后它失败了,因为没有数据或其他东西。好像我不应该让那个 lambda 函数做这项工作,但也许返回一些做这项工作的对象?没有把握。
如何做到这一点?
我正在寻找一种方法,当JTable滚动使得特定行变得可见时,或者当表格的底部滚动到视图中时,它会被通知.理想情况下,这应该在没有轮询的情况下完成,但是通过一些事件触发.有任何想法吗?
我的课堂作业是编写一个程序,让用户输入一组数值。如果用户输入的值不是数字,程序应该给用户 2 秒的机会正确输入一个数字,在这两次机会之后,停止要求输入并打印到目前为止正确输入的所有值的总和.
照原样,我的代码不能正常工作。当输入第一个非数字时,程序执行一次 catch 块中的代码,在 try 块的开头打印“gimme input”行,然后立即再次执行 catch 块中的代码,无需等待用户输入另一个号码。
在仔细阅读我的教科书以寻找线索时,我注意到这一行:“任何 catch 子句都不会捕获NoSuchElementException 。异常一直抛出,直到它被另一个 try 块捕获或 main 方法终止。”
这很好,因为现在至少我知道发生这种情况是有充分理由的,但是我的教科书没有包含有关此怪癖的任何进一步信息,而且我无法通过 StackOverflow 或 Google 找到任何可以理解的答案。所以我的问题是两部分:
a) 为了这个任务的目的,我应该如何解决这个问题?
b) 异常没有被 catch 子句捕获到底是什么意思?那不是catch 子句存在的目的吗?我确实想要我的任务的解决方案,但我也想了解为什么会这样,如果可能的话。
谢谢你的帮助!
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.ArrayList;
import java.util.Scanner;
public class NotANumber {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("This program computes the sum of any number of real numbers. When you are done entering values, enter something …
Run Code Online (Sandbox Code Playgroud) Oracle使用EclipseLink:
我在父(工作流)和孩子(阶段)之间有一对多的关系.在数据库中,我有一个删除约束,以便在工作流删除阶段删除.这从sqlplus工作正常.
class Workflow {
@Override
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "workflow", targetEntity = Stage.class)
@JoinColumn(name = "WORKFLOW_ID")
public Set<Stage> getStages() {
return m_stages;
}
}
class Stage {
@Override
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false, targetEntity = Workflow.class)
@JoinColumn(name = "WORKFLOW_ID", nullable = false)
public Workflow getWorkflow() {
return m_workflow;
}
}
Run Code Online (Sandbox Code Playgroud)
当我在@Transactional(propagation = Propagation.REQUIRED)方法中按名称加载工作流程然后em.remove(工作流程)该对象时,
我得到例外,例如
Error Code: 1407
Call: UPDATE STAGES SET WORKFLOW_ID = ?, FAILURE_STAGE_ID = ?, SUCCESS_STAGE_ID = ? WHERE …
Run Code Online (Sandbox Code Playgroud) 我正在执行一个下面的程序,通过java调用shell,我得到的除外,请帮助我.
程序:
import java.io.*;
import java.util.*;
public class ProcessExample {
/**
* @param args
*/
public static void main(String args[]) throws IOException {
File file=new File("/opt/nilesh/fazal");
ProcessBuilder processBuilder = new ProcessBuilder("./LicenseGen.sh --batchfile commands.txt");
processBuilder.directory(file);
processBuilder.redirectErrorStream(true);
System.out.println("nilesh");
Process process=processBuilder.start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
System.out.printf("Output of running %s is:",
Arrays.toString(args));
while ((line = br.readLine()) != null) {
System.out.println(line);
}
OutputStream os=process.getOutputStream();
OutputStreamWriter osw=new OutputStreamWriter(os);
BufferedWriter bw=new BufferedWriter(osw);
bw.write("create licensekey -x …
Run Code Online (Sandbox Code Playgroud) 我想要的是在执行fileUpload之后加载另一个页面。
我试图将此代码放在处理fileupload的bean中:
return "<JSF Page Name>?faces-redirect=true"
Run Code Online (Sandbox Code Playgroud)
但还是没有运气
我一直在尝试在java中附加两个2 D数组.是否有可能得到一个例子,因为我一直试图查找它但找不到一个.
int [][]appendArray(empty,window)
{
int [][]result= new int [empty.length][empty[0].length+window[0].length];
}
Run Code Online (Sandbox Code Playgroud) 我想使用orientdb.样本非常简单:
package models;
import java.util.List;
import com.orientechnologies.orient.core.db.object.ODatabaseObjectPool;
import com.orientechnologies.orient.core.db.object.ODatabaseObjectTx;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
public class User {
public String name;
public static void main(String[] args) {
String uri = "local:c:\\orientdb";
ODatabaseObjectTx db = ODatabaseObjectPool.global().acquire(uri, "admin", "admin");
db.getEntityManager().registerEntityClass(User.class);
User user = new User();
user.name = "aaa";
db.save(user);
List<?> list = db.query(new OSQLSynchQuery<Long>("select count(*) from User"));
System.out.println(list);
db.commit();
db.close(); // ****** throws exception
}
}
Run Code Online (Sandbox Code Playgroud)
但最后一行db.close()
会引发异常:
Exception in thread "main" com.orientechnologies.common.concur.lock.OLockException: Can't release a database URL not acquired before. URL: …
Run Code Online (Sandbox Code Playgroud) 所以我有
<a href="#">R<span class="superscript">5</span></a>
Run Code Online (Sandbox Code Playgroud)
并且我的锚的下划线被打破(意味着R的下划线在基线处,并且5的下划线在R的中间 - 因为5很小),这是我不想要的.如何让锚点下划线为R和5下的一条连续线(在基线处)?
谢谢.