- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建 JSR352 (Batch Applications for the Java Platform) 的演示在 Java SE 下,使用 JBoss 实现JBeret。我想为这项工作运行集成测试。在此批处理作业中,有 3 个组件:
io.mincong.batch.MyItemReader
io.mincong.batch.MyItemProcessor
io.mincong.batch.MyItemWriter
它们都是带有注解@Named
的命名bean,例如
@Named
public class MyItemProcessor implements ItemProcessor {
// ...
}
多亏了这个注释,我可以使用作业类而无需在我的作业文件 myJob.xml
中键入包名称前缀 io.mincong.batch
。 这在 Java EE 容器中运行良好,例如 WildFly 10。但是,在 Java SE 中,它不再起作用,我必须添加包前缀。这里的作业 xml myJob.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd"
version="1.0">
<step id="printID">
<chunk item-count="5">
<!-- This works :
<reader ref="io.mincong.batch.MyItemReader"/>
<processor ref="io.mincong.batch.MyItemProcessor"/>
<writer ref="io.mincong.batch.MyItemWriter"/> -->
<!-- This doesn't work -->
<reader ref="myItemReader"/>
<processor ref="myItemProcessor"/>
<writer ref="myItemWriter"/>
</chunk>
</step>
</job>
你可以在附件中找到2个mvn install log,有包前缀和没有包前缀。换句话说,使用和不使用 @Named
。为什么会发生这个错误?我是否缺少一些依赖项?有什么想法吗?
你也可以在下面看到我的 pom.xml。附加信息:
Mincongs-MBP:batch mincong$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building batch 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ batch ---
[INFO] Deleting /Users/mincong/Documents/workspace/batch/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ batch ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ batch ---
[INFO] Compiling 3 source files to /Users/mincong/Documents/workspace/batch/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ batch ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ batch ---
[INFO] Compiling 1 source file to /Users/mincong/Documents/workspace/batch/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ batch ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ batch ---
[INFO] Building jar: /Users/mincong/Documents/workspace/batch/target/batch.jar
[INFO]
[INFO] --- maven-failsafe-plugin:2.17:integration-test (default) @ batch ---
[INFO] Failsafe report directory: /Users/mincong/Documents/workspace/batch/target/failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running io.mincong.batch.JobIT
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.WeldStartup <clinit>
INFO: WELD-000900: 2.3.4 (Final)
Jun 26, 2016 1:21:16 PM org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create
INFO: WELD-ENV-000020: Using jandex for bean discovery
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.WeldStartup startContainer
INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.KafkaItemReader because of underlying class loading error: Type org.apache.kafka.clients.consumer.KafkaConsumer not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.KafkaItemWriter because of underlying class loading error: Type org.apache.kafka.clients.producer.KafkaProducer not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.HornetQItemReader because of underlying class loading error: Type org.hornetq.api.core.HornetQException not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.JasperReportsBatchlet because of underlying class loading error: Type net.sf.jasperreports.engine.data.JRAbstractTextDataSource not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:21:16 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.HornetQItemWriter because of underlying class loading error: Type org.hornetq.api.core.HornetQException not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:21:17 PM org.jboss.weld.environment.se.WeldContainer initialize
INFO: WELD-ENV-002003: Weld SE container STATIC_INSTANCE initialized
Jun 26, 2016 1:21:17 PM io.mincong.batch.JobIT setupJobEnv
INFO: setup env finished.
Jun 26, 2016 1:21:17 PM io.mincong.batch.JobIT shouldStart
INFO: executionId=1
Jun 26, 2016 1:21:17 PM org.jberet.runtime.runner.ChunkRunner run
ERROR: item-count=10, time-limit=0, skip-limit=-1, skipCount=0, retry-limit=-1, retryCount=0
Jun 26, 2016 1:21:17 PM org.jberet.runtime.runner.ChunkRunner run
ERROR: JBERET000007: Failed to run job myJob, printID, org.jberet.job.model.Chunk@4256e00a
java.lang.IllegalStateException: JBERET000600: Failed to create artifact with ref name myItemReader. Ensure CDI beans.xml is present and batch.xml, if any, is configured properly.
at org.jberet.runtime.context.JobContextImpl.createArtifact(JobContextImpl.java:185)
at org.jberet.runtime.runner.AbstractRunner.createArtifact(AbstractRunner.java:156)
at org.jberet.runtime.runner.ChunkRunner.run(ChunkRunner.java:134)
at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:226)
at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:147)
at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:164)
at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88)
at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:60)
at org.jberet.spi.JobExecutor$1.run(JobExecutor.java:99)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: JBERET000600: Failed to create artifact with ref name myItemReader. Ensure CDI beans.xml is present and batch.xml, if any, is configured properly.
at org.jberet.creation.ArtifactFactoryWrapper.getClassFromBatchXmlOrClassLoader(ArtifactFactoryWrapper.java:65)
at org.jberet.creation.ArtifactFactoryWrapper.create(ArtifactFactoryWrapper.java:41)
at org.jberet.runtime.context.JobContextImpl.createArtifact(JobContextImpl.java:183)
... 11 more
Caused by: java.lang.ClassNotFoundException: myItemReader
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jberet.creation.ArtifactFactoryWrapper.getClassFromBatchXmlOrClassLoader(ArtifactFactoryWrapper.java:63)
... 13 more
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.416 sec <<< FAILURE! - in io.mincong.batch.JobIT
shouldStart(io.mincong.batch.JobIT) Time elapsed: 4.366 sec <<< FAILURE!
java.lang.AssertionError: expected:<COMPLETED> but was:<FAILED>
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.junit.Assert.assertEquals(Assert.java:145)
at io.mincong.batch.JobIT.shouldStart(JobIT.java:47)
Weld SE container STATIC_INSTANCE shut down by shutdown hook
Results :
Failed tests:
JobIT.shouldStart:47 expected:<COMPLETED> but was:<FAILED>
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO]
[INFO] --- maven-failsafe-plugin:2.17:verify (default) @ batch ---
[INFO] Failsafe report directory: /Users/mincong/Documents/workspace/batch/target/failsafe-reports
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.863 s
[INFO] Finished at: 2016-06-26T13:21:20+02:00
[INFO] Final Memory: 31M/273M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project batch: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/mincong/Documents/workspace/batch/target/failsafe-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Mincongs-MBP:batch mincong$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building batch 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ batch ---
[INFO] Deleting /Users/mincong/Documents/workspace/batch/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ batch ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ batch ---
[INFO] Compiling 3 source files to /Users/mincong/Documents/workspace/batch/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ batch ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ batch ---
[INFO] Compiling 1 source file to /Users/mincong/Documents/workspace/batch/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ batch ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ batch ---
[INFO] Building jar: /Users/mincong/Documents/workspace/batch/target/batch.jar
[INFO]
[INFO] --- maven-failsafe-plugin:2.17:integration-test (default) @ batch ---
[INFO] Failsafe report directory: /Users/mincong/Documents/workspace/batch/target/failsafe-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running io.mincong.batch.JobIT
Jun 26, 2016 1:25:25 PM org.jboss.weld.bootstrap.WeldStartup <clinit>
INFO: WELD-000900: 2.3.4 (Final)
Jun 26, 2016 1:25:25 PM org.jboss.weld.environment.deployment.discovery.DiscoveryStrategyFactory create
INFO: WELD-ENV-000020: Using jandex for bean discovery
Jun 26, 2016 1:25:26 PM org.jboss.weld.bootstrap.WeldStartup startContainer
INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
Jun 26, 2016 1:25:26 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.KafkaItemReader because of underlying class loading error: Type org.apache.kafka.clients.consumer.KafkaConsumer not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:25:26 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.KafkaItemWriter because of underlying class loading error: Type org.apache.kafka.clients.producer.KafkaProducer not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:25:26 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.HornetQItemReader because of underlying class loading error: Type org.hornetq.api.core.HornetQException not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:25:26 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.JasperReportsBatchlet because of underlying class loading error: Type net.sf.jasperreports.engine.data.JRAbstractTextDataSource not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:25:26 PM org.jboss.weld.bootstrap.MissingDependenciesRegistry handleResourceLoadingException
INFO: WELD-000119: Not generating any bean definitions from org.jberet.support.io.HornetQItemWriter because of underlying class loading error: Type org.hornetq.api.core.HornetQException not found. If this is unexpected, enable DEBUG logging to see the full error.
Jun 26, 2016 1:25:26 PM org.jboss.weld.environment.se.WeldContainer initialize
INFO: WELD-ENV-002003: Weld SE container STATIC_INSTANCE initialized
Jun 26, 2016 1:25:26 PM io.mincong.batch.JobIT setupJobEnv
INFO: setup env finished.
Jun 26, 2016 1:25:26 PM io.mincong.batch.JobIT shouldStart
INFO: executionId=1
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 0
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 1
...
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 95
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 96
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 97
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 98
Jun 26, 2016 1:25:26 PM io.mincong.batch.MyItemWriter writeItems
INFO: 99
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.304 sec - in io.mincong.batch.JobIT
Weld SE container STATIC_INSTANCE shut down by shutdown hook
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO]
[INFO] --- maven-failsafe-plugin:2.17:verify (default) @ batch ---
[INFO] Failsafe report directory: /Users/mincong/Documents/workspace/batch/target/failsafe-reports
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ batch ---
[INFO] Installing /Users/mincong/Documents/workspace/batch/target/batch.jar to /Users/mincong/.m2/repository/io/github/mincongh/batch/0.0.1-SNAPSHOT/batch-0.0.1-SNAPSHOT.jar
[INFO] Installing /Users/mincong/Documents/workspace/batch/pom.xml to /Users/mincong/.m2/repository/io/github/mincongh/batch/0.0.1-SNAPSHOT/batch-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.810 s
[INFO] Finished at: 2016-06-26T13:25:28+02:00
[INFO] Final Memory: 32M/284M
[INFO] ------------------------------------------------------------------------
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.mincongh</groupId>
<artifactId>batch</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>batch</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.testSource>1.7</maven.compiler.testSource>
<maven.compiler.testTarget>1.7</maven.compiler.testTarget>
<failOnMissingWebXml>false</failOnMissingWebXml>
<arquillian.version>1.0.0.Alpha5</arquillian.version>
<wildfly.version>10.0.0.Final</wildfly.version>
<jberet.version>1.3.0.Beta2</jberet.version>
</properties>
<build>
<finalName>batch</finalName>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
<!-- enable execution to run an integration test -->
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<jberet.tmp.dir>${project.build.directory}${file.separator}tmp</jberet.tmp.dir>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-7.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<!-- Write test in JUnit 4.x -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.0.Final</version>
<scope>provided</scope>
</dependency>
<!-- jberet dependencies -->
<dependency>
<groupId>org.jboss.spec.javax.batch</groupId>
<artifactId>jboss-batch-api_1.0_spec</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>jboss-transaction-api_1.2_spec</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.marshalling</groupId>
<artifactId>jboss-marshalling</artifactId>
<version>1.4.11.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-security-manager</artifactId>
<version>1.1.2.Final</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>2.3.4.Final</version>
</dependency>
<!-- contains all classes of JBeret batch runtime. This library is
required to run batch applications in both Java SE and Java EE
environment. -->
<dependency>
<groupId>org.jberet</groupId>
<artifactId>jberet-core</artifactId>
<version>${jberet.version}</version>
</dependency>
<!-- contains implementation classes of JBeret batch runtime
specifically for Java SE environment. -->
<dependency>
<groupId>org.jberet</groupId>
<artifactId>jberet-se</artifactId>
<version>${jberet.version}</version>
</dependency>
<!-- a zip file containing the following content, and provides a
good start to write and run batch applications with JBeret in
Java SE.
* All libraries required to run batch applications in
Java SE environment
* default configuration file, jberet.properties for
configuring JBeret batch runtime in Java SE environment
* jberet-support library and its common transitive
dependencies
-->
<dependency>
<groupId>org.jberet</groupId>
<artifactId>jberet-distribution</artifactId>
<version>${jberet.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.191</version>
</dependency>
</dependencies>
</project>
最佳答案
经过几个小时的比较,我终于找到了不同之处!! beans.xml
中的 bean 发现模式被注释
并且应该是all
:
<?xml version="1.0"?>
<!-- <beans bean-discovery-mode="annotated" version="1.1" -->
<beans bean-discovery-mode="all" version="1.1"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"/>
根据 Javadoc - Enum BeanDiscoveryMode :
ALL
:将考虑存档中的所有类型。ANNOTATED
:只有那些带有 bean 定义注释的类型才会被考虑。NONE
:此存档将被忽略。关于java - JSR352:注释@Named 在 Java SE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38038184/
我需要将文本放在 中在一个 Div 中,在另一个 Div 中,在另一个 Div 中。所以这是它的样子: #document Change PIN
奇怪的事情发生了。 我有一个基本的 html 代码。 html,头部, body 。(因为我收到了一些反对票,这里是完整的代码) 这是我的CSS: html { backgroun
我正在尝试将 Assets 中的一组图像加载到 UICollectionview 中存在的 ImageView 中,但每当我运行应用程序时它都会显示错误。而且也没有显示图像。 我在ViewDidLoa
我需要根据带参数的 perl 脚本的输出更改一些环境变量。在 tcsh 中,我可以使用别名命令来评估 perl 脚本的输出。 tcsh: alias setsdk 'eval `/localhome/
我使用 Windows 身份验证创建了一个新的 Blazor(服务器端)应用程序,并使用 IIS Express 运行它。它将显示一条消息“Hello Domain\User!”来自右上方的以下 Ra
这是我的方法 void login(Event event);我想知道 Kotlin 中应该如何 最佳答案 在 Kotlin 中通配符运算符是 * 。它指示编译器它是未知的,但一旦知道,就不会有其他类
看下面的代码 for story in book if story.title.length < 140 - var story
我正在尝试用 C 语言学习字符串处理。我写了一个程序,它存储了一些音乐轨道,并帮助用户检查他/她想到的歌曲是否存在于存储的轨道中。这是通过要求用户输入一串字符来完成的。然后程序使用 strstr()
我正在学习 sscanf 并遇到如下格式字符串: sscanf("%[^:]:%[^*=]%*[*=]%n",a,b,&c); 我理解 %[^:] 部分意味着扫描直到遇到 ':' 并将其分配给 a。:
def char_check(x,y): if (str(x) in y or x.find(y) > -1) or (str(y) in x or y.find(x) > -1):
我有一种情况,我想将文本文件中的现有行包含到一个新 block 中。 line 1 line 2 line in block line 3 line 4 应该变成 line 1 line 2 line
我有一个新项目,我正在尝试设置 Django 调试工具栏。首先,我尝试了快速设置,它只涉及将 'debug_toolbar' 添加到我的已安装应用程序列表中。有了这个,当我转到我的根 URL 时,调试
在 Matlab 中,如果我有一个函数 f,例如签名是 f(a,b,c),我可以创建一个只有一个变量 b 的函数,它将使用固定的 a=a1 和 c=c1 调用 f: g = @(b) f(a1, b,
我不明白为什么 ForEach 中的元素之间有多余的垂直间距在 VStack 里面在 ScrollView 里面使用 GeometryReader 时渲染自定义水平分隔线。 Scrol
我想知道,是否有关于何时使用 session 和 cookie 的指南或最佳实践? 什么应该和什么不应该存储在其中?谢谢! 最佳答案 这些文档很好地了解了 session cookie 的安全问题以及
我在 scipy/numpy 中有一个 Nx3 矩阵,我想用它制作一个 3 维条形图,其中 X 轴和 Y 轴由矩阵的第一列和第二列的值、高度确定每个条形的 是矩阵中的第三列,条形的数量由 N 确定。
假设我用两种不同的方式初始化信号量 sem_init(&randomsem,0,1) sem_init(&randomsem,0,0) 现在, sem_wait(&randomsem) 在这两种情况下
我怀疑该值如何存储在“WORD”中,因为 PStr 包含实际输出。? 既然Pstr中存储的是小写到大写的字母,那么在printf中如何将其给出为“WORD”。有人可以吗?解释一下? #include
我有一个 3x3 数组: var my_array = [[0,1,2], [3,4,5], [6,7,8]]; 并想获得它的第一个 2
我意识到您可以使用如下方式轻松检查焦点: var hasFocus = true; $(window).blur(function(){ hasFocus = false; }); $(win
我是一名优秀的程序员,十分优秀!