java – required a bean named ‘entityManagerFactory’ that could not be found

. ____ _ __ _ insira o código aqui
/ / __ _ () __ __ _
( ( )_
| ‘_ | ‘| | ‘ / ` |
/ __)| |)| | | | | || (
| | ) ) ) )
‘ || .__|| ||| |_, | / / / /
=========|
|==============|
/=////
:: Spring Boot :: (v2.1.12.RELEASE)

2021-04-05 14:07:12.362 INFO 19212 — ( restartedMain) c.t.s.DesafioSupply.Application : Starting Application on spon190100264 with PID 19212 (C:Usersjose.leocadioDesktopDesafioSupplyAgroTOTVSDesafioSupplytargetclasses started by jose.leocadio in C:Usersjose.leocadioDesktopDesafioSupplyAgroTOTVSDesafioSupply)
2021-04-05 14:07:12.368 INFO 19212 — ( restartedMain) c.t.s.DesafioSupply.Application : No active profile set, falling back to default profiles: default
2021-04-05 14:07:12.688 INFO 19212 — ( restartedMain) .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set ‘spring.devtools.add-properties’ to ‘false’ to disable
2021-04-05 14:07:12.689 INFO 19212 — ( restartedMain) .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the ‘logging.level.web’ property to ‘DEBUG’
2021-04-05 14:07:17.693 INFO 19212 — ( restartedMain) .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-04-05 14:07:18.103 INFO 19212 — ( restartedMain) .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 395ms. Found 3 JPA repository interfaces.
2021-04-05 14:07:20.148 INFO 19212 — ( restartedMain) faultConfiguringBeanFactoryPostProcessor : No bean named ‘errorChannel’ has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2021-04-05 14:07:20.167 INFO 19212 — ( restartedMain) faultConfiguringBeanFactoryPostProcessor : No bean named ‘integrationHeaderChannelRegistry’ has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2021-04-05 14:07:20.781 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration’ of type (org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$633c801a) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.210 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘integrationDisposableAutoCreatedBeans’ of type (org.springframework.integration.config.annotation.Disposables) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.365 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.integration.config.IntegrationManagementConfiguration’ of type (org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$ce2e3b49) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.446 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration’ of type (org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$a9c04669) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.485 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration’ of type (org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$e2a7ef36) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.543 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘mbeanServer’ of type (com.sun.jmx.mbeanserver.JmxMBeanServer) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:25.746 INFO 19212 — ( restartedMain) o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-04-05 14:07:25.834 INFO 19212 — ( restartedMain) o.apache.catalina.core.StandardService : Starting service (Tomcat)
2021-04-05 14:07:25.835 INFO 19212 — ( restartedMain) org.apache.catalina.core.StandardEngine : Starting Servlet engine: (Apache Tomcat/9.0.30)
2021-04-05 14:07:26.874 INFO 19212 — ( restartedMain) o.a.c.c.C.(Tomcat).(localhost).(/) : Initializing Spring embedded WebApplicationContext
2021-04-05 14:07:26.874 INFO 19212 — ( restartedMain) o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 14185 ms
2021-04-05 14:07:27.942 INFO 19212 — ( restartedMain) o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService ‘taskScheduler’
2021-04-05 14:07:32.596 WARN 19212 — ( restartedMain) ConfigServletWebServerApplicationContext : Exception encountered during context initialization – cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘enderecoController’: Unsatisfied dependency expressed through field ‘service’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘enderecoService’: Unsatisfied dependency expressed through field ‘repository’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘enderecoRepository’: Cannot create inner bean ‘(inner bean)#3ed12fb9’ of type (org.springframework.orm.jpa.SharedEntityManagerCreator) while setting bean property ‘entityManager’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘(inner bean)#3ed12fb9’: Cannot resolve reference to bean ‘entityManagerFactory’ while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘entityManagerFactory’ available
2021-04-05 14:07:32.608 INFO 19212 — ( restartedMain) o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService ‘taskScheduler’
2021-04-05 14:07:32.640 INFO 19212 — ( restartedMain) o.apache.catalina.core.StandardService : Stopping service (Tomcat)
2021-04-05 14:07:32.763 INFO 19212 — ( restartedMain) ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-04-05 14:07:33.228 ERROR 19212 — ( restartedMain) o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field repository in com.totvs.supplyagro.DesafioSupply.Cadastros.Endereco.domain.EnderecoService required a bean named ‘entityManagerFactory’ that could not be found.

The injection point has the following annotations:
– @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean named ‘entityManagerFactory’ in your configuration.

Process finished with exit code 1

java – Dynamically choose bean without Qualifier annotation

I have a service that gets an URL from the user input, extracts the body content of this URL, apply CSS, and finally returns the result as a stream.

The tricky part is that I have different implementations depending on the URL, if the URL is not recognized, then a “default” implementation is used.
To do so, I used a BeanFactory to choose the correct implementation on Runtime.

@Service
@Qualifier("defaultHtmlToHtmlService")
public class DefaultHtmlToHtmlImpl implements HtmlToHtmlService {

    @Override
    public InputStream htmlToHtml(String url) throws IOException {
        Document document = Jsoup.connect(url).get();
        Element content = document.body();

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        outputStream.write(content.outerHtml().getBytes());
        outputStream.close();

        return new ByteArrayInputStream(outputStream.toByteArray());
    }
}

@Component
public class BeanFactory {


private final HtmlToHtmlService defaultHtmlToHtmlService;

private final HtmlToHtmlService impl1;

private final HtmlToHtmlService impl2;

@Autowired
public BeanFactory(@Qualifier("defaultHtmlToHtmlImpl") HtmlToHtmlService defaultHtmlToHtmlService,
                   @Qualifier("impl1") HtmlToHtmlService impl1,
                   @Qualifier("impl2") HtmlToHtmlService impl2) {
    this.defaultHtmlToHtmlService = defaultHtmlToHtmlService;
    this.impl1 = impl1;
    this.impl2 = impl2;
}

public HtmlToHtmlService getHtmlToHtmlImpl(String url) {
    if (url.contains("some pattern")) {
        return impl1;
    } else if (url.contains("some other pattern")) {
        return impl2;
    } else {
        return defaultHtmlToHtmlService;
    }
}

This is working just fine. However, my issue is that I don’t want my BeanFactory to share any information with the rest, but I do not know how to decouple it. Basically, I want to remove the @Qualifier annotation, and not to have to manually enter the new URLs patterns in the Bean Factory in the future when I will get more implementations.

I saw that maybe @PostConstruct annotation or to use static blocks could be the solution, but I am really not sure how to apply it in this case.

4.1 jelly bean – VLC black screen, and Disable HW Overlays

I have a Samsung Galaxy Xcover 2, with rooted Android 4.1.2.

I have installed VLC v3.0.13 on it – which is seemingly the last version that can be installed on Android 4.1.2 (all later builds of VLC for Android require Android 4.2+). I really like VLC because it has NFS sharing built in, so I could in principle watch videos from an NFS network share, which I’ve done previously on other devices with great success.

The problem is: when I play any video on it (mostly 360p .mp4 obtained from youtube-dl), audio can be heard, however in full screen mode, screen is black; when GUI with player controls are shown, one can somewhat discern a part of the video being shown in a stripe underneath the controls; and when the device/screen is rotated, there is a brief flash of the video shown, but then it disappears, and the screen goes back to black.

I have found this thread:

… which seems to describe the exact same problem:

The problem: No video, just a black screen except when you change
device orientation (landscape to portrait for example), when you exit
the playback or when you click settings button, the video appears for
a fragment of a second.

Audio and subtitles playing correctly.

Probably this problem only occurs in some devices.with pre kitkat
versions.

The solution: disable HW overlays in Settings > Developer options (if
Developer options don’t shows:
http://www.androidcentral.com/how-enable-developer-settings-android-42)

Ok, so I went to Android Settings / Developer Options, and checked “Disable HW overlays”, however, that seems to have no effect (video still does not appear/screen is still black); besides, when I reboot the phone, “Disable HW overlays” is unchecked again – which is also an experience from a Samsung device later in the same thread:

I have this exact same issue, and “Disable Hardware overlays” does not work on my Samsung Android phone. Also everytime the phone is rebooted this feature is turned off, meaning hardware overlays are enabled.

So, my question is – is there anything I can do, to get VLC to properly play the video on the screen on this device?

java – prototype bean vs singleton is better when request consumers are high and incoming requests are growing to peak

There is an External source posts the request –> Kafka –> Kafka Consumer calls MyComputation’s business logic. Assume that these are deployed in cloud (aws or azure whatever cloud we can), we have Kafka Cluster with 4 nodes, and Kafka consumer service with 4 nodes. All 8 Linux VM’s with 2 Core, 2GB RAM (just for reference this is not much important in my question)

Option-1:

  1. There is a unit of some complex business logic (CPU & Memory intensive, but not IO intensive) in spring bean called MyComputation.java (with spring bean scope prototype) to safeguard from concurrency issues, or to have it thread-safe.
  2. We have Kafka consumer to receive the requests from external service
  3. Kafka consumer has a logic that calls org.springframework.context.ApplicationContext getBean() at runtime to get the prototype bean of MyComputation.java and executes the complex business logic inside it.

Option-2:

  1. There is a unit of some complex business logic (CPU & Memory intensive, but not IO intensive) in spring bean called MyComputation.java (with spring bean scope singleton) and make our logic with some thread safety handling mechanism.
  2. We have Kafka consumer to receive the requests from external service
  3. Kafka consumer has a logic that will have autowired MyComputation.java class (with singleton by default) and call the business logic and avoid creating the entire bean object per request.

Now, my doubt is which one is the better Option-1 or 2? when the rate of computation execution time is lower than the rate of the incoming requests. And I have been asked to opt one option out of 2 mentioned above beyond anything we might want to increase hardware we can add. But the intent of the question is to choose the better option mentioned above.

Please suggest to me which option is better Option #1 or #2??

4.3 jelly bean – What is this N-shaped icon on my HTC One?

It means that you have NFC enabled. Some manufacturers (LG and HTC, I know for certain) have started adding an icon to let you know that you have NFC enabled since it can have potential security implications related to mobile payment systems. It would also be useful to know if you intend to use features like Android Beam.

If you’d like to get rid of the icon, you can disable NFC in your settings by selecting “More…” in the Wireless & Networks subheading and then unchecking the “NFC” option (you can view Sprint’s official instructions here).

The icon they’re using is the official logo of the NFC Forum.

4.1 jelly bean – Install Android 4.1 on unknown custom Chinese tablet with X210 processor

I want to install Android 4.1 on a custom tablet running custom hardware and a custom Android 4.0.4 because I need TLS 1.2 to work on it.

I understand there is quite a big chance of bricking the tablet but I’m willing to risk it.

Here is some info for the device

  • Device Model: Unknown
  • Android: 4.0.4
  • Processor: X210 (armeabi-v7a)
  • Processor frequency: Unknown
  • Cores: 1
  • Audio chipset: X210
  • GPU: Imagination Technologies Power VR SGX 540
  • Display resolution: 753×480 @68 Hz (6.2″)
  • RAM: 381 MB
  • Internal Storage: 540 MB

I’m just not sure how to go about it or what ROM should I use.

Do I try to find an original Google ROM or one of those custom CyanogenMod ones? I want to try something with the maximum chance of success, so any tips and guides are highly appreciated.

spring – ¿Cómo incluyo un Java Bean dentro de una posición de una lista con JSTL?

Intento agregar un Java bean dentro de una lista con JSTL imitando asi el comportamiento de un contador, pero no se como agregarlo o si es posible.

Java Bean creado con JSTL:

<c:set var="cont" value="${0}" />

Arreglo donde lo quiero incluir y que se incremente de uno en uno el objeto previamente creado:

 <c:choose>
        <c:when test="${videosControl(cont).status eq 1}">
           <input type="checkbox" checked>
           <c:set var="cont" value="${cont+1}" />
        </c:when>
        <c:otherwise>
          <input type="checkbox">
          <c:set var="cont" value="${cont+1}" />
        </c:otherwise>
  </c:choose>

Intente tambien esto:

Cree una variable contador y lo agregue al modelo con Spring:

int cont = 0;
        
model.addAttribute("cont", cont);

Luego en el archivo jsp realicé el mismo codigo pero no supe como interactuar con el objeto de modelo para asi poder modificarlo e incrementar de uno en uno la posición de la lista.

Cualquier posible solución o alternativa es bienvenida, gracias.

java – Red Hat Decision Manager – Como criar um data set no Decision Central do tipo bean?

Estou tentando criar um data set do tipo java bean no Decision Central para armazenar os dados da classe do meu projeto:

inserir a descrição da imagem aqui

E nas configurações do meu projeto consta a classe:inserir a descrição da imagem aqui

Mas recebo a seguinte mensagem:

inserir a descrição da imagem aqui

Esta é a minha classe java:
inserir a descrição da imagem aqui

Alguém que já utilizou o Decision Manager da Red Hat pode me ajudar como posso resolver isso e oque estou fazendo de errado?

Are bean bag chairs worth buying?

Are bean bag chairs worth buying? Is it really comfortable to seat?

business logic – How to process a long list of data from database with Message-driven bean due to the asynchronous requirement properly

There is a task in our JavaEE project: a user in the frontend page A can click a button to request to get a zip with the processed data. As the process of the request in the backend needs plenty of time, this process should be implemented in an asynchronous manner, say after clicking the request button, the user does not need to wait for the request but can go to other frontend page to do other requests and when the zip request processing is complete, there will be a link to the generated zip on page A.

In the backend there is the following workflow:

  1. query a long list of data from the relational database
  2. process the whole list of data, each of which will be mutated and returned as the output
  3. the output will be writen to multiple text files
  4. all the text files will be compressed to a zip file as the final result

Due to the asynchronous requirement, message-drive bean (MDB) is selected as the solution. But how to implement it with MDB?

Current design uses 2 MDB on one server: the first one, DataQueryBean, query data from the database and then send data one-by-one to another MDB, RecordProcessBean, which will process each of the incoming data from DataQueryBean and will store the mutated result into a temporay database table. When all data is processed by SingleRecordProcessBean, the DataQueryBean will send a final command message to RecordProcessBean then the RecordProcessBean will generate the zip.

This design seems to break the single responsibility rule. RecordProcessBean not only process the original incoming data but also generate the final zip, i.e. multiple reasons to change on the RecordProcessBean. Secondly, the times of calling the RecordProcessBean is the amount of data records queried, so I wonder if calling on the same MDB thousands/millions of times would affect the performance even though the calling happens on the same server Would like to hear some experts’ opinions about the pros and cons of the current design

It just came across my mind that why not let ONLY ONE MDB, DataProcessBean, query the data and then process all the data in a loop, and then generate the zip in another MDB, ZipBean. Whould like to hear some experts’ opinions on this pros and cons of this design candicate as well

Any better design suggestion is welcomed