@killow.1 escreveu:
criar menu de opções para biblioteca que tenha
cadastroalIVRO
Empresta livro - cod ou titulo
devolve livro - cod ou titulo
busca livro - cod ou titulo
mostra tudo
sair
Mensagens: 3
Participantes: 3
@killow.1 escreveu:
criar menu de opções para biblioteca que tenha
cadastroalIVRO
Empresta livro - cod ou titulo
devolve livro - cod ou titulo
busca livro - cod ou titulo
mostra tudo
sair
Mensagens: 3
Participantes: 3
@igoralves escreveu:
Bom dia rapaziada, poderia me informar como para setar um valor no input text da jsp com o valor que restou retornando com uma modeland view do java ?
Mensagens: 3
Participantes: 2
@Richard_Beletatti escreveu:
Galera eu tenho que fazer o seguinte:
Descreva um programa que recebe o valor de um RA (número composto por 9 dígitos) e gere um novo RA pela inversão dos 4 dígitos menos significativos do RA inicial.Exemplificando, se RA inicial for 972845236 então o RA novo deve ser 972846325. Se RA inicial for 984475211 então o RA novo deve ser 984471125.
O algoritmo deve receber RA inicial e apresentar o RA novo.
Bom eu consegui so fazer isso, nao estou conseguindo como fazer essa parte de inverter os 4 ultimos numeros, nao faco a minima ideia de como fazer isso… alguem me Help ?
package Estudo;
public class Array {
public static void main (String [] args) { String [] MeuArray = new String [] {"9","7","2","8","4","5","2","3","6"}; int tamanho = MeuArray.length; String[] arrayAux = new String[tamanho]; for (int i = 0; i < arrayAux.length; i++) { tamanho -- ; arrayAux[i] = MeuArray [tamanho]; System.out.println(arrayAux[i]); } }
}
Mensagens: 2
Participantes: 2
@rodrigo98 escreveu:
Boa tarde,
Gostaria de saber se o seguinte exercício esta correto:Exercicio) Alterar o método Bubblesort de forma que este inicie a orientação pelas primieras posiçoes colocando primeiros maiores nas ultimas posições
Resposta-)
public static void OrdencaoTrocasInt ( int iVet[])
{int iA, iB;
int iT;for(iA=1; iA < iVet.length; iA++)
{
for(iB=iVet.length-1; iB <= iA; iB–)
{
if(iVet[iB-1] < iVet[iB])
{
iT=iVet[iB-1];
iVet[iB-1=iVet[iB];
iVet[iB]=iT;
}
}
}
}obs-) fiz o codigo e troquei o sinal, porem realmente não sei se esta correto
Mensagens: 2
Participantes: 2
@mmcnet escreveu:
Boa noite ! Estou com um servidor vps, nele tem o jboss wildfly 10.0.0 Final instalado e toda vez que tento logar na área restrita da aplicação aparece esse erro, alguém sabe o que pode ser ? Estou usando JSF,CDI, segue o meu web.xml, faces-config e jboss-web.xml.
web.xml:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>cenmc-web</display-name> <welcome-file-list> <welcome-file>index.xhtml</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> <context-param> <param-name>BootsFaces_USETHEME</param-name> <param-value>default</param-value> </context-param> <context-param> <param-name>primefaces.THEME</param-name> <param-value>celeirodeluz</param-value> </context-param> <context-param> <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.jboss.weld.development</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>net.bootsfaces.get_fontawesome_from_cdn</param-name> <param-value>true</param-value> </context-param> <session-config> <session-timeout>60</session-timeout> <tracking-mode>COOKIE</tracking-mode> </session-config> <listener> <listener-class> org.jboss.weld.environment.servlet.Listener </listener-class> </listener> <resource-env-ref> <resource-env-ref-name>BeanManager</resource-env-ref-name> <resource-env-ref-type> javax.enterprise.inject.spi.BeanManager </resource-env-ref-type> </resource-env-ref> <filter> <filter-name>primeFacesFileUploadFilter</filter-name> <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class> </filter> <filter-mapping> <filter-name>primeFacesFileUploadFilter</filter-name> <servlet-name>facesServlet</servlet-name> </filter-mapping>
faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?> <faces-config 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/web-facesconfig_2_2.xsd" version="2.2"> <lifecycle> <phase-listener>br.org.cenmc.model.autenticacao.Autorizador</phase-listener> </lifecycle> <converter> <description>Convertendo Enum Papel</description> <converter-id>enumPapelConverter</converter-id> <converter-class>br.org.cenmc.faces.EnumPapelConverter</converter-class> </converter> <converter> <description>Convertendo Pessoa</description> <converter-id>pessoaConverter</converter-id> <converter-class>br.org.cenmc.faces.PessoaConverter</converter-class> </converter> </faces-config>
jboss-web.xml:
<jboss-web> <context-root>cenmc-web</context-root> </jboss-web>
Mensagens: 1
Participantes: 1
@juliokaetanovieira escreveu:
Boa noite!! Preciso criar um método que receba uma lista de números inteiros e retorne uma lista dessa lista, contendo em uma das listas os números pares e em outra lista o números
impares. Até no momento consegui fazer só isso:public List<Integer> listaparesimpares(List<Integer> numeros){ List<Integer> listaparesimpares = new ArrayList<>(); listaparesimpares.add(1); listaparesimpares.add(2); listaparesimpares.add(3); Integer par = 0; Integer impar = 0; for(int i = 0; i < listaparesimpares i++) if(i % 2 ==0) { List<> } return listaparesimpares; }
Mensagens: 3
Participantes: 3
@GAOC escreveu:
Saudações.
Sou estudante do 1º semestre de ADS e tenho uma lista pra resolver e um que estou com dúvida é basicamente sobre um campeonato, preciso mostrar a categoria de acordo com a idade e o peso ideal ( com uma fórmula) baseado no sexo do atleta.
Eu fiz uma condição para o usuário digitar 1 para masculino e 2 para feminino, mas gostaria de saber como faço pra quando digitar qualquer coisa fora disso, retornasse para o campo da resposta novamente.
No caso eu uso uma classe e depois faço a main.
public String verificaSexo() {//condição para sexo, 1 masculino e 2 feminino *if* (sexo == 1) { return "Masculino"; } else if (sexo == 2) { return "Feminino"; } return "Sexo inserido é inválido"; }
NO CASO MINHA MAIN ESTÁ ASSIM A PARTE DE MOSTRAR OS RESULTADOS:
A CONVERSÃO DA VARIÁVEL SEXO.
int sexo=Integer.parseInt(JOptionPane.showInputDialog(null,"Digite o sexo do atleta: "+"\nDigite 1 para Masculino:"+"\nDigite 2 para Feminino:","Informações dos Atletas",3));
DEPOIS DE CHAMAR INSTANCIAR E CHAMAR O OBJETO.
JOptionPane.showMessageDialog(null, "O atleta se chama: "+dados.getNome()+" "+dados.getSobrenome()+"\nSexo: " + dados.verificaSexo()+"\nO Atleta tem: "+dados.getIdade()+" anos"+ "\nEstá participando da categoria: " + dados.categoriaOficial() + "\nO peso atual é de: "+dados.getPeso()+ "\nO peso ideal para o Atleta é de: "+ dados.verificaPeso(),"Informações dos Atletas",1);
Meu código está resumido por conta das variáveis, se tiver alguma coisa difícil de entender posto novamente corrigido, é a primeira vez que uso o fórum.
Mensagens: 1
Participantes: 1
@AkaViegas escreveu:
Bom dia, prezados. Estou tentando tentar aprender a programar java, segui um vídeo um pouco antigo explicando como instalar tudo e, após vários problemas, cheguei num erro que eu não faço ideia de como resolver. Ao tentar executar o programa aparece o seguinte erro: https://uploaddeimagens.com.br/imagens/java_error-png
Tentei reinstalar a JRE, mas aparentemente o problema não é esse… Tenho instalados no PC o “jdk-12_windows-x64_bin” e “jre-8u202-windows-x64” baixados diretamente do site da Oracle. Me ajuda aí Brasil
Mensagens: 9
Participantes: 4
@Inathan escreveu:
Bom dia, acho que está tudo certo nesse código, a intenção dele é não adicionar um novo objeto se já existir um igual no array, mas infelizmente está adicionando também os iguais…
Poderiam me ajudar a achar o erro?public String adicionarProduto(Produto p) {
String result = “”;for (int i = 0; i < produtos.length; i++) { if(produtos[i] != null && p.equals(produtos[i])) { result = "Produto já cadastrado!"; break; } } for (int x = 0; x < produtos.length; x++) { if(produtos[x]==null) { produtos[x]=p; result = "Produto adicionado com sucesso!"; break; } } return result; }
Mensagens: 3
Participantes: 2
@oliverlucas escreveu:
Eu preciso fazer uma imagem em degradê, pra isso eu precisaria colocar um for para que toda vez que a cor vermelha rodasse, diminuiria -1 dela.
Só que não to conseguindo implementar isso
.
A cor vermelha tá declarada como
{255,0,0}
.Segue o código:
public static void main(String[] args) throws IOException { int width = 500; int height = 300; BufferedImage image= new BufferedImage( width, height, BufferedImage.TYPE_INT_RGB ); WritableRaster raster = image.getRaster(); int c = 255; int[] green = new int[] {35,142,35}; int[] white = new int[] {255,255,255}; int[] red = new int[] {c,0,0}; for (int h = 0; h < height; h++){ for (int w = 0; w < width; w++){ if (w < 500) { raster.setPixel(w, h, red); }
Essa é a parte que eu estou tentando implementar:
for (c = w; w < height; c--){ if (w < 500) { raster.setPixel(w, h, red); } } } } ImageIO.write(image, "PNG", new File("Degrade.png")); }
Mensagens: 5
Participantes: 3
@lucas31 escreveu:
Gostaria de saber se o codigo que escrevi esta correto e principalmente o que terei que mudar para que ele coloque primeiro os numero maiores
Enunciado
Alterar o método selectionsort de forma que este coloque primeiro os maiores nas ultimas posiçõesResposta
public static void Exercicio3(int iVet[])
{
int iA, iB, iC;
int iT;for(iA=0; iA< iVet.length-1; iA++)
{
iC=iA;
iT=iVet[iA];
for(iB=iA+1; iB < iVet.length; iB++)
{
if(iVet[iB] < iT)
{
iC=iB;
iT=iVet[iB];
}
}
iVet[iC]=iVet[iA];
iVet[iA]=iT;
}
}
Mensagens: 1
Participantes: 1
@xAcer escreveu:
Boa tarde
estou fazendo um atividade de um sistema de estacionamento,tenho a data de entrada e saida do carro, na tabela esta como date(HH:mm dd/MM/yyyy).
o meu problema é que quando eu mando para o banco mySQL perco a HH:mm fica 00:00.
a coluna do banco esta como DateTime.desde já Agradeço!
RESOLVIDO
O problema estava, pq no DAO, eu estava dando um PreparedStatement.setDate,ai mudei para setTimestamp e funcionou!
Mensagens: 1
Participantes: 1
@semperfy escreveu:
Ola pessoal, gostaria de tirar uma duvida, e quem sabe, alguem possa “me dar um norte” nesse problema:
Tenho varios equipamentos que usam comunicação socket, porem trabalham em modo servidor, consegui fazer a comunicação com o aparelho usando a api do fabricante, enviar e receber os dados, porém, consegui conectando apenas em 1, e logo apos o recebimento e envio, a thread se encerra, n sendo possivel mais validar os dados, este já seria o primeiro problema, o segundo, e o qual é a grande duvida, é: consigo fazer minha aplicacao cliente se comunicar com varios servidores, e, manter essa comunicação enviando e recebendo dados sempre que os servidores solicitarem, ativa, ate o encerramento via botão ou outro comando qualquer?
Agradeço desde já.
Mensagens: 2
Participantes: 2
@guilhermebhte escreveu:
Configuração
package br.eti.netsoft; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class AuthSegurancaApplication { public static void main(String[] args) { SpringApplication.run(AuthSegurancaApplication.class, args); } }
controller
package br.eti.netsoft.controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(value = "/teste") public class Teste { @PostMapping(name = "salvar") public void salvar() { } }
pom.xml
<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>br.eti.netsoft</groupId> <artifactId>auth-seguranca</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.3.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.security.oauth</groupId> <artifactId>spring-security-oauth2</artifactId> <version>2.3.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-jwt</artifactId> <version>1.0.10.RELEASE</version> </dependency> <dependency> <groupId>io.cucumber</groupId> <artifactId>cucumber-junit</artifactId> <version>4.2.6</version> <scope>test</scope> </dependency> <!-- postgresql --> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> <!-- Migracoes - Flyway --> <!-- <dependency> --> <!-- <groupId>org.flywaydb</groupId> --> <!-- <artifactId>flyway-core</artifactId> --> <!-- </dependency> --> <!-- Hibernate Java 8 Support --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-java8</artifactId> </dependency> <!-- Suporte do Jackson para as datas do Java 8 --> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> <organization> <name>auth-seguranca</name> </organization> </project>
log ao subir o servidor
20:22:03,358 INFO [org.jboss.modules] (main) JBoss Modules version 1.8.6.Final 20:22:03,870 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.3.Final 20:22:03,885 INFO [org.jboss.threads] (main) JBoss Threads version 2.3.2.Final 20:22:04,047 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 14.0.0.Final (WildFly Core 6.0.1.Final) starting 20:22:05,337 INFO [org.wildfly.security] (ServerService Thread Pool -- 27) ELY00001: WildFly Elytron version 1.6.0.Final 20:22:06,196 INFO [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 20:22:06,267 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 24) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation. 20:22:06,298 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found auth-seguranca-0.0.1-SNAPSHOT.war in deployment directory. To trigger deployment create a file called auth-seguranca-0.0.1-SNAPSHOT.war.dodeploy 20:22:06,354 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http) 20:22:06,395 INFO [org.xnio] (MSC service thread 1-4) XNIO version 3.6.5.Final 20:22:06,410 INFO [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.6.5.Final 20:22:06,508 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 41) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4) 20:22:06,584 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 48) WFLYCLINF0001: Activating Infinispan subsystem. 20:22:06,619 INFO [org.jboss.as.jaxrs] (ServerService Thread Pool -- 50) WFLYRS0016: RESTEasy version 3.6.1.Final 20:22:06,629 INFO [org.jboss.as.connector] (MSC service thread 1-6) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.11.Final) 20:22:06,631 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0018: Started Driver service with driver-name = h2 20:22:06,651 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 55) WFLYJSF0007: Activated the following JSF Implementations: [main] 20:22:06,662 INFO [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 57) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem 20:22:06,669 INFO [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 58) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem 20:22:06,675 INFO [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 59) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem 20:22:06,688 INFO [org.jboss.as.security] (ServerService Thread Pool -- 66) WFLYSEC0002: Activating Security Subsystem 20:22:06,694 INFO [org.jboss.as.security] (MSC service thread 1-5) WFLYSEC0001: Current PicketBox version=5.0.3.Final 20:22:06,699 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 68) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique. 20:22:06,731 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0003: Undertow 2.0.13.Final starting 20:22:06,739 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 70) WFLYWS0002: Activating WebServices Extension 20:22:06,761 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS] 20:22:06,765 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 60) WFLYNAM0001: Activating Naming Subsystem 20:22:06,795 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default] 20:22:06,910 INFO [org.jboss.as.naming] (MSC service thread 1-5) WFLYNAM0003: Starting Naming Service 20:22:06,920 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default] 20:22:07,228 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 69) WFLYUT0014: Creating file handler for path 'C:\Users\Guilherme Costa\wildfly-14.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]'] 20:22:07,728 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 49) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors 20:22:07,736 INFO [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing. 20:22:07,737 INFO [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host. 20:22:07,806 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0012: Started server default-server. 20:22:07,810 INFO [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 5.0.8.Final 20:22:07,812 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0018: Host default-host starting 20:22:07,831 INFO [org.jboss.as.patching] (MSC service thread 1-1) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none 20:22:07,907 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-5) WFLYDM0111: Keystore C:\Users\Guilherme Costa\wildfly-14.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost 20:22:07,912 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\Guilherme Costa\wildfly-14.0.0.Final\standalone\deployments 20:22:07,928 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080 20:22:07,947 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "auth-seguranca-0.0.1-SNAPSHOT.war" (runtime-name: "auth-seguranca-0.0.1-SNAPSHOT.war") 20:22:08,293 INFO [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0493: EJB subsystem suspension complete 20:22:08,445 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS] 20:22:09,319 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443 20:22:09,477 INFO [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBossWS 5.2.3.Final (Apache CXF 3.2.5.jbossorg-1) 20:22:14,248 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener due to an exception (enable DEBUG log level to see the cause) 20:22:14,251 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener due to an exception (enable DEBUG log level to see the cause) 20:22:14,254 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause) 20:22:14,257 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause) 20:22:14,269 WARN [org.jboss.as.ee] (MSC service thread 1-7) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpRequest$RequestAsyncListener due to an exception (enable DEBUG log level to see the cause) 20:22:14,378 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 42.2) 20:22:14,379 WARN [org.jboss.weld.deployer] (MSC service thread 1-7) WFLYWELD0013: Deployment auth-seguranca-0.0.1-SNAPSHOT.war contains CDI annotations but no bean archive was found (no beans.xml or class with bean defining annotations was present). 20:22:14,452 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = auth-seguranca-0.0.1-SNAPSHOT.war_org.postgresql.Driver_42_2 20:22:14,616 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-4) ISPN000128: Infinispan version: Infinispan 'Estrella Galicia' 9.3.1.Final 20:22:14,831 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 72) WFLYCLINF0002: Started client-mappings cache from ejb container 20:22:15,011 INFO [io.undertow.servlet] (ServerService Thread Pool -- 79) 1 Spring WebApplicationInitializers detected on classpath 20:22:15,069 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 79) Inicializando Mojarra 2.3.5.SP2 para o contexto '/auth-seguranca-0.0.1-SNAPSHOT' 20:22:17,774 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 79) WFLYUT0021: Registered web context: '/auth-seguranca-0.0.1-SNAPSHOT' for server 'default-server' 20:22:17,796 INFO [org.jboss.as.server] (ServerService Thread Pool -- 42) WFLYSRV0010: Deployed "auth-seguranca-0.0.1-SNAPSHOT.war" (runtime-name : "auth-seguranca-0.0.1-SNAPSHOT.war") 20:22:17,908 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server 20:22:17,912 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management 20:22:17,915 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 20:22:17,917 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 14.0.0.Final (WildFly Core 6.0.1.Final) started in 15024ms - Started 522 of 707 services (326 services are lazy, passive or on-demand)
http://localhost:8080/auth-seguranca-0.0.1-SNAPSHOT/teste, ou http://localhost:8080/auth-*seguranca/teste da erro 403 forbien
application.properties
spring.datasource.url=jdbc:postgresql://localhost:5432/gestao?createDatabaseIfNotExist=true&useSSL=false spring.datasource.username=postgres spring.datasource.password=63Netsis417 spring.datasource.driver-class-name=org.postgresql.Driver spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=none spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
O que está faltando ??
Mensagens: 1
Participantes: 1
@evandro_araujo escreveu:
Tenho a seguinte estrutura:
1 - Projeto XXXX - Model , onde tem as entidades do COR
Projeto Maven , e contem o arquivopersistence.xml
com todas as entidades do projeto, e por exemplo tenho essa entidade@Entity @Table(name = "empresa", schema = "cadastro") @ALL @JsonIgnoreProperties(ignoreUnknown = true) @JsonIdentityInfo(generator = JSOGGenerator.class) public class Empresa extends AuthAuditable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id") private Integer id; @Size(max = 255) @Column(name = "razao_social") private String razaoSocial; @Basic(optional = false) @NotNull @Size(min = 1, max = 255) @Column(name = "nome_fantasia") private String nomeFantasia; @Size(max = 20) @Column(name = "telefone") private String telefone; // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation @Size(max = 20) @Column(name = "fax") private String fax; // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation @Size(max = 50) @Column(name = "email") private String email; @Size(max = 255) @Column(name = "endereco") private String endereco; @JoinColumn(name = "municipio_ibge_id", referencedColumnName = "id") @ManyToOne private MunicipioIbge municipioIbge; ... Getter e Setter
2 - Crie uma API, utilizando SPRING BOOT, com a seguinte caracteristicas :
No POM, inclui a dependencia do Projeto XXXX
<dependency> <groupId>br.com.xxxxxx</groupId> <artifactId>xxxxxxx-model</artifactId> <version>0.4</version> </dependency>
Segue abaixo a minha entidade :
@Entity @Table(name = "cartao") public class Cartao implements Serializable { /** * */ private static final long serialVersionUID = -7332367273991883359L; @Id @SequenceGenerator(name = "cartao_id", sequenceName = "cartao_seq", initialValue = 1, allocationSize = 1) @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "cartao_id") private Long id; @Column private String descricao; @JoinColumn(name = "empresa_id", referencedColumnName = "id") @ManyToOne(optional = false) private Empresa empresa; ... Getter e Setter
- Tenho o arquivo application.properties, configurado o banco de dados
Porém quando executo meu projeto spring Boot , esta dando erro abaixoCaused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.xx.Cartao.empresa references an unknown entity: br.xxx.model.cadastro.Empresa
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:97) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processEndOfQueue(InFlightMetadataCollectorImpl.java:1827) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processFkSecondPassesInOrder(InFlightMetadataCollectorImpl.java:1771) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1658) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:287) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:904) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935) ~[hibernate-core-5.3.7.Final.jar:5.3.7.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:390) ~[spring-orm-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:377) ~[spring-orm-5.1.3.RELEASE.jar:5.1.3.RELEASE]
Mensagens: 3
Participantes: 2
@Jonathan_souza escreveu:
olá :),sou um programador iniciante em java e tenho um projeto já quase em finalização de um jogo de plataforma 2D,e as questões é:
Precisa de que para que ninguem roube (tire,pegue,tome) de mim,o meu jogo,minha história,meus arquivos,as musicas,as sprites.
(sendo que tudo nesse jogo fui eu que fiz,desde as musicas,as sprites,tiles até a história)?
É necessário alguma compilação para proteção do meu código?
Enquanto a licença do eclipseIDE,eu posso publicar meu jogo feito nele?
Tenho que dizer algo sobre o eclipseIDE no meu jogo ou devo pagar algo para que o jogo seja meu.(ou divulga-lo.
Eu queria coloca-lo em um site simples,para que as pessoas pudessem jogar,mas…
eu não quero que outras pessoas roubem o meu projeto e coloquem no nome delas ou copiem minha ideia ou façam sabe lá o que com meu jogo.Só quero que o jogo seja meu e que ninguem possa tirar ele de mim.Se alguem puder responder-me:
Agradeço desde jáPerdoe-me se escrevi ou me expressei mal(eu não entendo direito a vida nova nem os perigos).
Mensagens: 3
Participantes: 3
@ldsmaga escreveu:
Boa tarde.
Sou novo no mundo da programação e estou estudando a sintaxe de Java.
Criei uma calculadora IMC com classes e métodos, e gostaria de saber como faço para aplicar a parte de Swing nesses códigos.
Não sabia como pesquisar especificamente isso, espero que entendam.
Grato.
Mensagens: 4
Participantes: 3
@bsmachado escreveu:
Pessoal, tudo bom?
Eu recentemente desenvolvi um pequeno sistema em Swing usando o Netbeans 8.2 com MySQL. Depois fui ver não instalei nenhum servidor que vem embutido com o Netbeans e por isso gostaria de criar uma aplicação web com o Netbeans 9 ou 10. pois falaram que ele está mais fluido na parte de web.
Roda tranquilo 2 versões da IDE numa mesma máquina, windows 10?
Outra coisa, alguém indica algum curso de JEE com Mysql usando Netbeans?
Agradeço a ajuda.
Mensagens: 2
Participantes: 2
@Thiaguinho_Castelhan escreveu:
Alguém sabe como eu faço pra que as informações do
Smartwatch
vá par um tela noJInternalframe
e mostra as informações dele?
Mensagens: 3
Participantes: 2