小编Tho*_*hom的帖子

外键没有父错误

这就是为什么我放弃使用Hibernate来管理我的关系的原因.太多新的白发.

Hibernate 3.6.10

好的,我有两个课程,Schedule和Event.时间表有很多事件,但事件只有一个时间表.

时间表:

/**
 * 
 */
package com.heavyweightsoftware.leal.model.schedule;

import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.heavyweightsoftware.leal.helper.DateHelper;
import com.heavyweightsoftware.leal.model.Pojo;

/**
 * A particular collection of events that can be shared
 * @author Thom
 */
@Entity
@Table(name = "SCHEDULE")
@NamedQueries( {
    @NamedQuery(name = Schedule.COUNT_SCHED_ID,      query =  "SELECT COUNT(*) " +
                                                              "FROM Schedule s " +
                                                              "WHERE s.scheduleId = …
Run Code Online (Sandbox Code Playgroud)

java hibernate

3
推荐指数
1
解决办法
2万
查看次数

在界面上查找注释

我有一个带有实现栏的接口Foo.接口Foo有一个带有方法注释@Secured的方法"doMe()".这是唯一受到保护的方法.

现在我编写了以下代码来浏览类并查找带有@Secured的方法.(此方法尚未完成,我正在尝试通过第一次单元测试.)

  /**
   * Determine if a method is secured
     * @param method the method being checked
     * @return true if the method is secured, false otherwise
     */
    protected static boolean isSecured(Method method) {
  boolean secured = false;
  Annotation[] annotations = method.getAnnotations();
  for(Annotation annotation:annotations){
    if(Secured.class.equals(annotation.getClass())){
      secured = true;
      break;
    }
  }

  if(secured){
    return true;
  }

  return secured;
}
Run Code Online (Sandbox Code Playgroud)

除了doMe()之外的方法在foo和Bar的getAnnotations()上返回0个成员.问题是doMe()还为Foo和Bar返回0个成员.

我正在寻找一个比我更了解反思的人,因为这不应该很难找到.:)

谢谢.

java reflection annotations

3
推荐指数
1
解决办法
189
查看次数

如何发送文本消息而不是字节消息

我正在使用与我的 JMS 队列对话的 blueprint.xml 构建骆驼路线。我遇到了神秘的错误,我的 Spring Boot 应用程序充当队列的消费者,将我的 xml 作为字节消息而不是文本消息发送,并且 Spring 消费者对此感到窒息。

这是两条消息,其中一条有效:

2016-06-24 07:08:22,671 | INFO  | Sending message: ActiveMQBytesMessage {commandId = 8, responseRequired = true, messageId = ID:ThomasLaptop-54711-1466766502054-1:1:2:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:ThomasLaptop-54711-1466766502054-1:1:2:1, destination = queue://tripRequest.updateStatus.v1.0, transactionId = null, expiration = 1466766522670, timestamp = 1466766502670, arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = Camel-ID-ThomasLaptop-54704-1466766499471-0-3, replyTo = temp-queue://ID:ThomasLaptop-54711-1466766502054-1:1:1, persistent = true, type = null, priority = 4, groupID = null, groupSequence = …
Run Code Online (Sandbox Code Playgroud)

java apache-camel spring-jms spring-boot

3
推荐指数
1
解决办法
4327
查看次数

sidenav 生成已声明为结束的抽屉

我有以下代码:

<mat-card class="settings-panel">
  <mat-card-title>
    Settings
  </mat-card-title>
  <mat-card-content>
    <mat-sidenav-container class="settings-container">
      <mat-sidenav #sides align="end" class="settings-sidenav" mode="side">
        <app-sides></app-sides>
      </mat-sidenav>

      <mat-sidenav #toppings align="end" class="settings-sidenav" mode="side">
        <app-toppings></app-toppings>
      </mat-sidenav>

      <div class="settings-sidenav-content">
        <button type="button" mat-button (click)="sides.open()">
          Sides
        </button>
        <br/>
        <button type="button" mat-button (click)="toppings.open()">
          Toppings
        </button>
      </div>

    </mat-sidenav-container>
  </mat-card-content>
</mat-card>
Run Code Online (Sandbox Code Playgroud)

它似乎可以正常工作,但 Web 控制台中出现错误:

Error: A drawer was already declared for 'position'="end"
Run Code Online (Sandbox Code Playgroud)

这让我觉得我在滥用控制权,但我不知道如何继续。

angular-material angular

3
推荐指数
1
解决办法
2958
查看次数

根据数据库值动态加载spring xml文件

我们目前有一个Spring Web应用程序,正在使用XML文件进行配置.我们正在启动Spring DispatcherServlet,它创建一个XmlWebApplicationContext并从默认位置加载它:spring-servlet.xml.

我使用context-param contextConfigLocation指定了几个额外的配置文件.这会从XML文件加载我们的整个应用程序.

所以这就是我想要做的.XML文件包含数据库连接信息和用于访问这些表的DAO.我想使用其中一个DAO从数据库中读取值并从XML文件中加载另一组bean.

因此,如果检索到的数据库值为橙色,我想从orange.xml加载bean.如果它是苹果,我想加载apple.xml.我希望这些bean成为相同应用程序上下文的一部分,因此在加载之后,我可以向前推进而不会注意到差异.

我想知道我是否应该实现自己的XmlWebApplicationContext子类并让DispatcherServlet实现它,但我不太确定如何继续.

java spring java-ee

2
推荐指数
1
解决办法
3729
查看次数

将main/java类添加到intellij中的test/java目录中

我是intellij的新手.我正在从eclispe Kepler切换.

我没有maven项目,但我确实有maven目录结构.我的类在src/main/java中,我的测试在src/test/java中.

我的单元测试很抱怨,因为他们找不到src/main/java中的类.将此添加到构建路径的正确方法是什么,以便我的单元测试可以找到源?

java junit intellij-idea

2
推荐指数
2
解决办法
6740
查看次数

在intellij里面找不到spock

我是intellij和spock的新手.

我正在使用gradle将spock测试添加到我的spring启动项目中.这是我的build.gradle:

buildscript {
    ext {
        springBootVersion = '1.4.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'

jar {
    baseName = 'theta-server'
    version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('org.spockframework:spock-core:1.0-groovy-2.4')
}


eclipse {
    classpath {
         containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
         containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
    }
}
Run Code Online (Sandbox Code Playgroud)

所以我添加了一个spock测试:

package com.heavyweightsoftware.theta.server.controller

/**
 * 
 */
class ThetaControllerTest extends spock.lang.Specification {
    def "Theta"() { …
Run Code Online (Sandbox Code Playgroud)

intellij-idea gradle spock

2
推荐指数
1
解决办法
1509
查看次数

如何在 Angular 中将对象转换为 JSON

为 angularjs 找到了一些答案,例如:How to use angular.toJson on a angular controller or scope but not not Angular 2 and following.

我是 Angular 的新手,完成了教程,现在正在尝试构建我的第一个实时应用程序。我有一个凭据对象,其中包含用户名和密码字段。我想将其外部化为 JSON 以发送到我的 Web 服务。我发现这个:https : //angular.io/api/common/JsonPipe似乎可以做我想做的事,但这个例子是 HTML 格式的,我想在我的服务中做到这一点,所以这是我的服务:

import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { JsonPipe } from '@angular/common';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';

@Injectable()
export class LoginService {
  authToken = ""
  loginUrl = "localhost:8093/login"

  constructor(private http: HttpClient) { } …
Run Code Online (Sandbox Code Playgroud)

json angular

2
推荐指数
1
解决办法
3930
查看次数

Intellij 找不到我的 Spring Boot 应用程序

自从我将 IntelliJ 升级到 Ultimate 2019.2 后,我突然开始遇到以下问题:

/opt/jdk-11/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:43359,suspend=y,server=n -Dspring.profiles.active=dev -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=始终 -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:/snap/intellij- idea-ultimate/159/plugins/Groovy/lib/agent/gragent.jar -javaagent:/snap/intellij-idea-ultimate/159/plugins/java/lib/rt/debugger-agent.jar -Dfile.encoding=UTF -8 -classpath /home/thomas/workspace/AddyCaddy/out/生产/类:/home/thomas/workspace/AddyCaddy/out/生产/资源:/home/thomas/workspace/AddyCaddy/libs/heavyweight-util-1.11 .jar:/home/thomas/workspace/AddyCaddy/libs/AddyCaddy-client-0.5.1-SNAPSHOT.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework.boot/ spring-boot-starter-actuator/2.1.5.RELEASE/4abebc4ec0ee87155bfa8daf6a9d63366308e58a/spring-boot-starter-actuator-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/ org.springframework.boot/spring-boot-starter-data-jpa/2.1.5.RELEASE/f33f69b3744d07f832db6ab48eab227ccde9e922/spring-boot-starter-data-jpa-2.1.5.RELEASE.jar:/home/thomas/.gradle/缓存/modules-2/files-2.1/org.mariadb.jdbc/mariadb-java-client/1.5.9/75d4d6e4cdb9a551a102e92a14c640768174e214/mariadb-java-client-1.5.9.jar:/home/thomas/.gradle/caches/ module-2/files-2.1/org.springframework.boot/spring-boot-starter-web/2.1.5.RELEASE/d46494b46a626cbd8f253066a2d7413412efc908/spring-boot-starter-web-2.1.5.RELEASE.jar:/home/thomas /.gradle/caches/modules-2/files-2.1/com.h2database/h2/1.4.199/7bf08152984ed8859740ae3f97fae6c72771ae45/h2-1.4.199.jar:/home/thomas/.gradle/caches/modules-2/files- 2.1/net.sf.dozer/dozer/5.5.1/f2e52ef54166788ae29b5b4eec6fdb9cd580acab/dozer-5.5.1.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring- boot-starter-aop/2.1.5.RELEASE/464cfb573009e724ea76ca404f106b1b19e759ff/spring-boot-starter-aop-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org. springframework.boot/spring-boot-starter-jdbc/2.1.5.RELEASE/6f187e708a47b0d37552a01292ce649a97a0059d/spring-boot-starter-jdbc-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/ files-2.1/org.springframework.boot/spring-boot-devtools/2.1.5.RELEASE/82da693e16b112f535e2cb2682a29b23f7378dd0/spring-boot-devtools-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules- 2/files-2.1/org.springframework.boot/spring-boot-starter-json/2.1.5.RELEASE/cf880b4a4713b2a1aea21f929df718a0260aa29/spring-boot-starter-json-2.1.5.RELEASE.jar:/home/thomas/。 gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/2.1.5.RELEASE/74952d169c2da56f7794b3a88508e52005bb8f36/spring-boot-starter-2.1.5.RELEASE.jar:/home/thomas /.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-actuator-autoconfigure/2.1.5.RELEASE/4e6774d2f4a70e62092dbaace39190f8b1df8083/spring-boot-actuator-autoconfigure-2.1.5.RELEASE。 jar:/home/托马斯/.gradle/caches/modules-2/files-2.1/io.micrometer/micrometer-core/1.1.4/96eabfe2343a4a4676d215b2122cbbc4d4b6af9b/micrometer-core-1.1.4.jar:/home/thomas/.gradle/caches/modules-2/文件-2.1/javax.transaction/javax.transaction-api/1.3/e006adf5cf3cca2181d16bd640ecb80148ec0fce/javax.transaction-api-1.3.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/javax.xml。绑定/jaxb-api/2.3.1/8531ad5ac454cc2deb9d4d32c40c4d7451939b5d/jaxb-api-2.3.1.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.hibernate/hibernate-core/5.3。 10.Final/e608b854325005edbf43cb2b6041fdafd3f2eb57/hibernate-core-5.3.10.Final.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-jpa/2.1。 8.RELEASE/385ab53309b4f0dfb317c4753fe853821ff15c08/spring-data-jpa-2.1.8.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aspects/5.1.7。 RELEASE/15309277b9a18c8dae21272be3e57b69a67c41f6/spring-aspects-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-tomcat/2.1。 5.RELEASE/49de1c20ea6b8c6920d0a66329f9bf980e4498eb/spring-boot-starter-tomcat-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.hibernate.validator/hibernate-validator/ 6.0.16.Final/ad9557c558972093c0567a2a1f224f318c00f650/hibernate-validator-6.0.16.Final.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webmvc/5.1.7。 RELEASE/686326ff513bf4e852b3ee359cf741d92ab82cfe/spring-webmvc-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/5.1.7.RELEASE/595dd528ec66eccc6cf4375ea3b 56f3605fa1d1f/ spring-web-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/commons-beanutils/commons-beanutils/1.9.1/d2662a4e018671ed061e9acca6299a31b7652f3c/commons-beanutils-1.9。 1.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.8.1/6505a72a097d9270f7a9e7bf42c4238283247755/commons-lang3-3.8.1.jar:/home /thomas/.gradle/caches/modules-2/files-2.1/org.slf4j/jcl-over-slf4j/1.7.26/33fbc2d93de829fa5e263c5ce97f5eab8f57d53e/jcl-over-slf4j-1.7.26.jar:/home/thomas/。 gradle/caches/modules-2/files-2.1/com.zaxxer/HikariCP/3.2.0/6c66db1c636ee90beb4c65fe34abd8ba9396bca6/HikariCP-3.2.0.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/ org.springframework.data/spring-data-commons/2.1.8.RELEASE/d68b9a9850ee21319469c40bdbdfe4eaaf29557/spring-data-commons-2.1.8.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files- 2.1/org.springframework.boot/spring-boot-starter-logging/2.1.5.RELEASE/b4fe11fb0e606b67b9fb2bd9ae4fe65b484445dd/spring-boot-starter-logging-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/ module-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar:/home/thomas/.gradle/caches/modules-2/files- 2.1/org.apache.logging.log4j/log4j-to-slf4j/2.11.2/6d37bf7b046c0ce2669f26b99365a2cfa45c4c18/log4j-to-slf4j-2.11.2.jar:/home/thomas/。gradle/caches/modules-2/files-2.1/org.slf4j/jul-to-slf4j/1.7.26/8031352b2bb0a49e67818bf04c027aa92e645d5c/jul-to-slf4j-1.7.26.jar:/home/thomas/.gradle/caches/ module-2/files-2.1/org.slf4j/slf4j-api/1.7.26/77100a62c2e6f04b53977b9f541044d7d722693d/slf4j-api-1.7.26.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/ org.springframework.boot/spring-boot-autoconfigure/2.1.5.RELEASE/69ae2819b295603563b95f79abae53f2631c5b94/spring-boot-autoconfigure-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files- 2.1/org.springframework.boot/spring-boot-actuator/2.1.5.RELEASE/eccd3c70cfbe9534db19fbdd6cbf86fab884c3c0/spring-boot-actuator-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/ files-2.1/org.springframework.boot/spring-boot/2.​​1.5.RELEASE/939061a385b4e30e115978d78a7412fb984674df/spring-boot-2.1.5.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files- 2.1/javax.annotation/javax.annotation-api/1.3.2/934c04d3cfef185a8008e7bf34331b79730a9d43/javax.annotation-api-1.3.2.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org。 springframework/spring-context/5.1.7.RELEASE/b4154d41a70c56eeca42974825fe64a8576642dd/spring-context-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring- aop/5.1.7.RELEASE/8138b5e3dd01d514741de35d7f5050599c617509/spring-aop-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-orm/5.1。 7.RELEASE/1e532795f730814b07961fbf5f14e14bd2507fcd/spring-orm-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/5.1.7.RELEASE/ d00069664e066c4021fa3de167ad755e4148f340/spring-jdbc-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/5.1.7.RELEASE/d437d5d353312d94206b4 69b43e203eba1bdcec6/弹簧- tx-5.1.7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/5.1.7.RELEASE/14cd651e4aa3514e75710c9450c7a0c89413e63f/spring-beans-5.1。 7.RELEASE.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/5.1.7.RELEASE/7b47446553c83a5a7323d647f5c1793106b2948c/spring-expression-5.1.7.RELEASE。 jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.1.7.RELEASE/280f821b9ed4dad9993f1d551d6e86557092ae58/spring-core-5.1.7.RELEASE.jar:/home /thomas/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.23/ec62d74fe50689c28c0ff5b35d3aebcaa8b5be68/snakeyaml-1.23.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/ com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.9.8/28ad1bced632ba338e51c825a652f6e11a8e6eac/jackson-datatype-jsr310-2.9.8.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/ com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.9.8/bcd02aa9195390e23747ed40bf76be869ad3a2fb/jackson-datatype-jdk8-2.9.8.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/ com.fasterxml.jackson.module/jackson-module-parameter-names/2.9。8/c4eef0e6e20d60fb27af4bc4770dba7bcc3f6de6/jackson-module-parameter-names-2.9.8.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9。 8/11283f21cc480aa86c4df7a0a3243ec508372ed2/jackson-databind-2.9.8.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.hdrhistogram/HdrHistogram/2.1.9/e4631ce165eb400edecfa32e03 d3f1be53dee754/HdrHistogram-2.1.9。 jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.latencyutils/LatencyUtils/2.0.3/769c0b82cb2421c8256300e907298a9410a2a3d3/LatencyUtils-2.0.3.jar:/home/thomas/.gradle/caches/ module-2/files-2.1/org.aspectj/aspectjweaver/1.9.4/9205229878f3d62fbd3a32a0fb6be2d6ad8589a9/aspectjweaver-1.9.4.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/javax.activation/ javax.activation-api/1.2.0/85262acf3ca9816f9537ca47d5adeabaead7cb16/javax.activation-api-1.2.0.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.hibernate.common/hibernate- commons-annotations/5.0.4.Final/965a18fdf939ee75e41f7918532d37b3a8350535/hibernate-commons-annotations-5.0.4.Final.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.jboss.logging/ jboss-logging/3.3.2.Final/3789d00e859632e6c6206adc0c71625559e6e3b0/jboss-logging-3.3.2.Final.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/javax.persistence/javax.persistence- api/2.2/25665ac8c0b62f50e6488173233239120fc52c96/javax.persistence-api-2.2.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.javassist/javassist/3.23.2-GA/c5afe660a95e87ceb5 18e4f5cf02f5c56b547683/javassist- 3.23.2-GA.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.9.12/39050dbbd36862ea87eb9a64158854b04619ccd6/byte-buddy-1.9.12.jar: /home/thomas/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.7/83cd2cd674a217ade95a4bb83a8a14f351f48bd0/antlr-2.7.7.jar:/home/thomas/.gradle/caches/modules-2/文件-2.1/org.jboss/jandex/2.0.5.Final/7060f67764565b9ee9d467e3ed0cb8a9c601b23a/jandex-2.0.5.Final.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/com.fasterxml/同学/1.4.0/291658ac2ce2476256c7115943652c0accb5c857/classmate-1.4.0.jar:/home/thomas/.gradle/caches/modules-2/files-2.1/org.dom4j/dom4j/2.1.1/3dce5dbb3571aa820c677fadd8349b fa8f00c199/dom4j-2.1。 …

java intellij-idea spring-boot

2
推荐指数
1
解决办法
3505
查看次数

Drawable“无法解析此资源 URL”

好的,我浏览了 android 文档,搜索了示例,并阅读了类似这样的 stackoverflow 问题:无法解析符号 @drawable/ic_launcher,但我仍然无法弄清楚发生了什么。

我的 Xamarin Android 应用程序中有一个 ImageButton,我已在 XML 文件中定义了它。这里:

    <TextView
        android:layout_width="40sp"
        android:layout_height="wrap_content"
        android:text=""
        android:gravity="center" />
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/increase_quantity_button"
            android:src="@drawable/arrow_drop_up"
            android:contentDescription="@string/increaseQuantity"/>
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/decrease_quantity_button"
            android:src="@drawable/arrow_drop_down"
            android:contentDescription="@string/decreaseQuantity"/>
    </LinearLayout>
    <ImageButton
        android:layout_width="40sp"
        android:layout_height="wrap_content"
        android:id="@+id/delete_item_button"
        android:src="@drawable/delete"
        android:contentDescription="@string/delete"/>

</LinearLayout>
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/item_description"/>
Run Code Online (Sandbox Code Playgroud)

然后我将这些文件放入我的可绘制文件夹中,如下所示。

在此输入图像描述

然后,当我构建应用程序时,我得到:This resource URL cannot be resolved

我不知道下一步该尝试什么。

c# android xamarin.android xamarin

2
推荐指数
1
解决办法
1214
查看次数