- 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/
我有一堆字符串,其中包含以姓氏,名字格式命名的名称列表,并用逗号分隔,如下所示: names 序列化字符串中的“first name last name”,我们在Stack Overflow上找到一个
在尝试合并多个数据框时,我得到了一些非常奇怪的东西。帮助! 我需要通过“RID”和“VISCODE”列合并一堆数据框。这是它的外观示例: d1 = data.frame(ID = sample(9,
让我们尽可能简单地做第一个例子。 我想知道如何应用这个宏;像这里适用于例如printf("%s",macro(arg)); #include #include #include #define
以下2个bean声明之间有什么区别吗? @Bean(name = "bean1") public A getA() { return new A(); } @Bean @Quali
if(c.get_name(&name) && name && !strcmp(name, contName)) 谁能告诉我这行代码在 C++ 中的含义 最佳答案 如果 c 有一个名字并且它等于 co
我是 Rails 的初学者,在改进我的搜索查询时遇到了一些问题: 在我调用的 Controller 中: def index if params[:search] @persons = Pers
谁能帮我解决这段代码的最后一部分的编译错误它的说法创建构造函数请帮助 public class Officer { public static void main(String args[]
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 8 年前。 Improve t
我创建了一个 Web 应用程序,它具有使用 JSF 技术的 createBook.xhtml 并且它使用托管 Bean。在此页面中,用户必须在输入字段中填写所需信息,然后点击提交按钮。然后应使用 do
嘿,我正在尝试弄清楚如何将在 mySQL 中工作的语句转换为 PostgreSQL 并且很好奇是否有人知道解决方案。 这是在 mySQL 中有效的语句: def self.by_name(keywor
如果我要创建所有类型的类型,而不是使用字符串和原始类型,那么最大的缺点是什么? 通常它看起来像: String name = person.getName(); int age = person.ge
我正在尝试从以下内容中提取郊区名称: 12 street name, suburb name, CTG 1234 在 PHP 中使用正则表达式。 街道和郊区名称都可以是任意数量的单词长度。 CTG 是
我有一个呈现个人详细信息组件的父组件,并且正在注入(inject)父组件的验证器范围。如果我使用 v-validate 指令和 this.$validator.validateAll() 或 this
现在,据我了解,name[] 声明中的 extern 告诉编译器它的定义在其他地方(在我的程序中,我定义了它低于我使用它的部分)。但是为什么 strlen() 和 sizeof 会有不同的结果?str
我一直在解决一个问题: "Design a program that asks the user for a series of names (in no particular order). Aft
我的 XML 如下所示: 我想使用 JAXB 来阅读该内容。 我知道我能做到 @XmlRootElement(name="thing") public class Thing{
对于字符串 name[],我们可以使用 strlen(name)+1 和 sizeof(name) 互换 在我们的代码中没有经过深思熟虑?他们不一样吗?我检查了一下,发现两者的返回类型都是相同的,si
我正在尝试从以下内容中提取郊区名称: 12 street name, suburb name, CTG 1234 在 PHP 中使用正则表达式。 街道和郊区名称的长度可以是任意数量。 CTG 是 st
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 8 年前。 Improve t
bash 手册列出了 for 的语法。复合语句为for name [ [ in [ word ... ] ] ; ] do list ; done这意味着 do 之前的分号如果 in 是可选的子句省略
我是一名优秀的程序员,十分优秀!