Hot questions for Using Enterprise JavaBeans in xml

Question:

I have a Wildfly server running and I have an ejb project and a client in java. When I try to run the client I get the following exception:

    [ERROR] Failed to execute goal on project online-shop-ejb-client: Could not resolve dependencies for project com.wildfly.proj:online-shop-ejb-client:jar:0.0.1-SNAPSHOT: Could not find artifact com.wildfly.proj:online-shop-ejb:jar:client:0.0.1-SNAPSHOT -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project online-shop-ejb-client: Could not resolve dependencies for project com.wildfly.proj:online-shop-ejb-client:jar:0.0.1-SNAPSHOT: Could not find artifact com.wildfly.proj:online-shop-ejb:jar:client:0.0.1-SNAPSHOT
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:257)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.wildfly.proj:online-shop-ejb-client:jar:0.0.1-SNAPSHOT: Could not find artifact com.wildfly.proj:online-shop-ejb:jar:client:0.0.1-SNAPSHOT
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:211)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
    ... 23 more
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact com.wildfly.proj:online-shop-ejb:jar:client:0.0.1-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:205)
    ... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.wildfly.proj:online-shop-ejb:jar:client:0.0.1-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
    ... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.wildfly.proj:online-shop-ejb:jar:client:0.0.1-SNAPSHOT
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:434)
    ... 27 more

Here is the pom of my ejb project:

<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>
    <parent>
        <groupId>com.wildfly.proj</groupId>
        <artifactId>online-shop</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>online-shop-ejb</artifactId>
    <packaging>ejb</packaging>
    <name>online-shop-ejb</name>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.1.4.GA</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- WildFly plugin to deploy the application -->
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.0.2.Final</version>
                <configuration>
                    <filename>${project.build.finalName}.jar</filename>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <!-- enforce Java 8 -->
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <ejbVersion>3.2</ejbVersion>
                    <!-- Generate ejb-client for client project -->
                    <generateClient>true</generateClient>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

And here is the pom of the client project:

<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>
    <parent>
        <groupId>com.wildfly.proj</groupId>
        <artifactId>online-shop</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>online-shop-ejb-client</artifactId>
    <name>online-shop-ejb-client</name>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-ejb-client-bom</artifactId>
                <version>10.1.0.Final</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.wildfly.proj</groupId>
            <artifactId>online-shop-ejb</artifactId>
            <type>ejb-client</type>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.transaction</groupId>
            <artifactId>jboss-transaction-api_1.2_spec</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.2_spec</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-ejb-client</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-api</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.xnio</groupId>
            <artifactId>xnio-nio</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.remoting3</groupId>
            <artifactId>jboss-remoting</artifactId>
            <version>3.3.3.Final</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.sasl</groupId>
            <artifactId>jboss-sasl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.marshalling</groupId>
            <artifactId>jboss-marshalling-river</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <!-- maven-compiler-plugin here -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>java</executable>
                    <workingDirectory>${project.build.directory}/exec-working-directory</workingDirectory>
                    <arguments>
                        <argument>-classpath</argument>
                        <classpath />
                        <argument>com.wildfly.proj.client.TicketAgencyClient</argument>
                    </arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Answer:

You generate the ejb-client from the ejb module here :

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <ejbVersion>3.2</ejbVersion>
                    <!-- Generate ejb-client for client project -->
                    <generateClient>true</generateClient>
                </configuration>
            </plugin>

So by deduction, I think you have not installed in your Maven local repository the artifact com.wildfly.proj:online-shop-ejb:0.0.1-SNAPSHOT which contains the ejb and the ejb-client .

To do that, you have to run mvn clean intall from the com.wildfly.proj:online-shop-ejb:0.0.1-SNAPSHOT module.

Question:

I am new to Java Enterprise, sorry if this has been answered,I could not find anything specific. I am trying to loop through a datatable, and call a method with the id from every result and display some info. My XML looks like this:

        <h:dataTable styleClass="data" value="#{moduleBean.allModules}" var="m" class="modulelist">
      <h:column>
        <f:facet name="header">#{uistrings.module_name}</f:facet>
      #{m.name}
      </h:column>
      <h:column>
          <f:facet name="header">#{uistrings.approved}</f:facet>
              <h:outputText value="#{moduleBean.findStats(m.id}"/>
      </h:column>
    </h:dataTable>

moduleBean.allmodules() returns a list of module objects. This works fine. The problem is moduleBean.findStats().

Error message:

    javax.el.MethodNotFoundException: java.lang.NoSuchMethodException: no.uia.slit.web.ModuleBean$$OwbNormalScopeProxy0.findStats(java.lang.Long)

viewId=/teacher/status.xhtml
location=D:\code\github\neiva\build\web\teacher\status.xhtml
phaseId=RENDER_RESPONSE(6)

Caused by:
java.lang.NoSuchMethodException - no.uia.slit.web.ModuleBean$$OwbNormalScopeProxy0.findStats(java.lang.Long)
at java.lang.Class.getMethod(Class.java:1773)

/teacher/status.xhtml at line 27 and column 72 value="#{moduleBean.findStats(m.id)}"

If I change the method to not take any parameters, and call it like "#{moduleBean.findStats"} it works, but how can I pass parameters to the method?

the method is defined like this:public String findStats(long id){}


Answer:

Try defining the method to receive a Long (object) instead of long (primitive).

public String findStats(Long id){}

Question:

How can I inject EJBs into the XmlAdapters?

The idea is I want to get list of IDs by rest API and convert this array of IDs to List of Objects for Entity Object. For example:

public class Post {
    List<Category> categories;
    ...
}

public class AdaptedPost {
    List<Long> categories;
    ...
}

public class PostAdapter extends XmlAdapter<AdaptedPost, Post> {

    @EJB
    CategoryFacade categoryFacade;

    @Override
    public Post unmarshal(final AdaptedPost adaptedPost) throws Exception {
        // Use facade class to retrieve category object from ID
    }
    ...    
}

Answer:

There is no support defined for injection into javax.xml.bind.annotation.adapters.XmlAdapter objects.

You will need to acquire your EJB the old fashioned way using a JNDI lookup.

Question:

I'm facing some problem using JBoss 7 here, i don't know why, but after i do the lookup i try to send a collection to my server and then turn the xml files into DB data. But, as soon as the lookup is made and i try to send the collections i receive this error msg:

Exception in thread "main" java.io.StreamCorruptedException: Unexpected byte found when reading an object: 0
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:755)
at org.jboss.marshalling.river.BlockUnmarshaller.readToEndBlockData(BlockUnmarshaller.java:124)
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1613)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1273)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276)
at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:437)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:202)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
at $Proxy0.importXml(Unknown Source)
at principal.FeedClientDB.processArq(FeedClientDB.java:116)
at principal.FeedClientDB.processArq(FeedClientDB.java:101)
at principal.FeedClientDB.main(FeedClientDB.java:58)
Caused by: an exception which occurred:
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in object of type xml.XmlDoc
in element at index [0] of size [49]

The element which i'm trying to send is an object that contains an attribute transient inputStream. I don't know if it should act this way or not.


Answer:

I have seen this error whenever the client and server are running different versions of java. For example, client running on java6 and server running on java7. Check https://developer.jboss.org/message/820070

If you have a redhat account, try https://access.redhat.com/solutions/167873

Question:

I have problem with POSTing xml file to web service server. I was following this tutorial: EJB WEB SERVICE TUTORIAL everything works except POSTing xml file. I am trying to do this via Poster chrome extension and get this error in JBoss console:

13:11:33,929 WARN  [org.jboss.resteasy.core.SynchronousDispatcher] (http-localhost-127.0.0.1-8080-1) Failed executing POST /customers: org.jboss.resteasy.spi.BadRequestException: Could not find message body reader for type: java.util.List<com.example.ejbrest.Customer> of content type: text/plain;charset="UTF-8"
at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:153) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:124) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:147) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]

I was trying find solution on the internet but unfortunately nothing found.


Answer:

It looks like you're posting a Customer List from a non structured format (text-plain). Resteasy will only be able to unmarshall from a structured format like xml,json. So your client app is the culprit in that case. If you really want to unmarshall from a String of character then you'll have to provide your own MessageBodyReader.

Question:

I found this setting on maven cargo:

<plugin>
    <inherited>false</inherited>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven3-plugin</artifactId>
    <configuration>
        <container>
            <containerId>wildfly10x</containerId>
            <zipUrlInstaller>
                <url>http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip</url>
                <downloadDir>${project.basedir}/.cargo/downloads</downloadDir>
                <extractDir>${project.basedir}
                    /.cargo/extracts</extractDir>
            </zipUrlInstaller>
        </container>
    </configuration>
    <executions>
        <execution>
            <id>install-cargo</id>
            <phase>process-test-resources</phase>
            <goals>
                <goal>install</goal>
            </goals>
        </execution>
    </executions>
</plugin>

But this does not seem to work.

Can anyone provide me the correct configuration.

Also I want to add a user. How to do that?


Answer:

This is what worked for me:

<profiles>
        <!-- mvn clean package cargo:run -->
        <profile>
            <id>wildfly-standalone</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <version>${cargo-maven2-plugin.version}</version>

                        <configuration>

                            <container>
                                <containerId>wildfly10x</containerId>
                                <zipUrlInstaller>
                                    <url>http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip</url>
                                </zipUrlInstaller>
                            </container>

                            <configuration>
                                <properties>
                                    <cargo.hostname>127.0.0.1</cargo.hostname>
                                    <cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
                                    <cargo.servlet.users>testUser:admin1234!</cargo.servlet.users>
                                </properties>
                            </configuration>

                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

To download and install the settings you need to run the following command:

mvn clean package cargo:run

Question:

I'm currently working on a tutorial Simple JMS example with Glassfish and a RESTful webservice using Glassfish 4 with Jersey 2 Servlet Container (not Jersey 1 from the tutorial) without using Maven.

It ends up with an error 404. The application was successfully deployed and i don't know why i'm getting an error.

When i'm looking in my glassfish directory there should be the deployed application somewhere. It might be at glassfish/domains/domain1/applications/__internal/JMS1/.. but this directory is empty.

UPDATE

I figured out that glassfish deploys the applications generated by eclipse at glassfish/domains/domain1/eclipseApps/JMS1/... So the applications are successfully deployed.

What am i doing wrong? Am i accessing just a wrong URL or something like that?

HERE IS MY CODE

Log

2018-03-12T16:34:32.824+0100|Information: Server shutdown initiated
2018-03-12T16:34:32.843+0100|Information: Unregistered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@3071d086 from service registry.
2018-03-12T16:34:32.844+0100|Information: FileMonitoring shutdown
2018-03-12T16:34:32.853+0100|Information: JMXStartupService: Stopped JMXConnectorServer: null
2018-03-12T16:34:32.854+0100|Information: JMXStartupService and JMXConnectors have been shut down.
2018-03-12T16:34:33.034+0100|Schwerwiegend: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5a3b7ca7]) and a value of type [org.glassfish.admingui.theme.AdminguiThemeContext] (value [org.glassfish.admingui.theme.AdminguiThemeContext@5431ce55]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
2018-03-12T16:34:33.035+0100|Schwerwiegend: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5a3b7ca7]) and a value of type [org.glassfish.admingui.theme.AdminguiThemeContext] (value [org.glassfish.admingui.theme.AdminguiThemeContext@5431ce55]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
2018-03-12T16:34:33.036+0100|Schwerwiegend: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5a3b7ca7]) and a value of type [org.glassfish.admingui.theme.AdminguiThemeContext] (value [org.glassfish.admingui.theme.AdminguiThemeContext@5431ce55]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
2018-03-12T16:34:33.036+0100|Schwerwiegend: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5a3b7ca7]) and a value of type [org.glassfish.admingui.theme.AdminguiThemeContext] (value [org.glassfish.admingui.theme.AdminguiThemeContext@5431ce55]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
2018-03-12T16:34:33.037+0100|Schwerwiegend: The web application [] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5a3b7ca7]) and a value of type [org.glassfish.admingui.theme.AdminguiThemeContext] (value [org.glassfish.admingui.theme.AdminguiThemeContext@5431ce55]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
2018-03-12T16:34:33.142+0100|Information: JdbcRuntimeExtension,  getAllSystemRAResourcesAndPools = [GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool]
2018-03-12T16:34:33.161+0100|Information: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter stopping...
2018-03-12T16:34:36.340+0100|Information: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter stopped.
2018-03-12T16:34:36.341+0100|Information: RAR7094: jmsra shutdown successful.
2018-03-12T16:35:22.889+0100|Information: Running GlassFish Version: GlassFish Server Open Source Edition  4.0  (build 89)
2018-03-12T16:35:22.892+0100|Information: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
2018-03-12T16:35:23.016+0100|Information: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2018-03-12T16:35:23.017+0100|Information: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2018-03-12T16:35:23.022+0100|Information: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
2018-03-12T16:35:23.426+0100|Information: Grizzly Framework 2.3.1 started in: 44ms - bound to [/0.0.0.0:8.080]
2018-03-12T16:35:23.508+0100|Information: Grizzly Framework 2.3.1 started in: 48ms - bound to [/0.0.0.0:8.181]
2018-03-12T16:35:23.516+0100|Information: Grizzly Framework 2.3.1 started in: 2ms - bound to [/0.0.0.0:4.848]
2018-03-12T16:35:23.791+0100|Information: Authorization Service has successfully initialized.
2018-03-12T16:35:23.833+0100|Information: Grizzly Framework 2.3.1 started in: 2ms - bound to [/0.0.0.0:3.700]
2018-03-12T16:35:24.140+0100|Information: visiting unvisited references
2018-03-12T16:35:24.693+0100|Information: visiting unvisited references
2018-03-12T16:35:24.927+0100|Information: visiting unvisited references
2018-03-12T16:35:25.020+0100|Information: visiting unvisited references
2018-03-12T16:35:25.033+0100|Information: visiting unvisited references
2018-03-12T16:35:25.604+0100|Information: SEC1002: Security Manager is OFF.
2018-03-12T16:35:25.604+0100|Information: SEC1010: Entering Security Startup Service
2018-03-12T16:35:25.606+0100|Information: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
2018-03-12T16:35:25.639+0100|Information: SEC1011: Security Service(s) Started Successfully
2018-03-12T16:35:25.822+0100|Information: this.makeModuleFor(org.glassfish.main.web.glue, null) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.web.glue [263]], State = [READY]
2018-03-12T16:35:25.822+0100|Information: this.makeModuleFor(org.glassfish.web.javax.servlet.jsp, null) returned OSGiModuleImpl:: Bundle = [org.glassfish.web.javax.servlet.jsp [149]], State = [READY]
2018-03-12T16:35:25.962+0100|Information: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
2018-03-12T16:35:25.970+0100|Information: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
2018-03-12T16:35:25.975+0100|Information: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
2018-03-12T16:35:26.001+0100|Information: Created virtual server server
2018-03-12T16:35:26.003+0100|Information: Created virtual server __asadmin
2018-03-12T16:35:26.096+0100|Information: Setting JAAS app name glassfish-web
2018-03-12T16:35:26.097+0100|Information: Virtual server server loaded default web module 
2018-03-12T16:35:28.110+0100|Information: JTS5014: Recoverable JTS instance, serverId = [3700]
2018-03-12T16:35:28.706+0100|Information: JMS010: ADDRESSLIST in setJmsServiceProvider: mq://localhost:7676/
2018-03-12T16:35:28.706+0100|Information: JMS08: JMS Service Connection URL is : mq://localhost:7676/
2018-03-12T16:35:29.808+0100|Information: HV000001: Hibernate Validator 5.0.0.Final
2018-03-12T16:35:29.992+0100|Information: Grizzly Framework 2.3.1 started in: 2ms - bound to [/0.0.0.0:7.676]
2018-03-12T16:35:29.997+0100|Information: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter: Version:  5.0  (Build 14-e) Compile:  April 12 2013 0104
2018-03-12T16:35:29.997+0100|Information: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter starting: broker is EMBEDDED, connection mode is Direct
2018-03-12T16:35:32.907+0100|Information: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter Started:EMBEDDED
2018-03-12T16:35:32.945+0100|Information: JMS013: Assuming destination type javax.jms.Queue for MDB SimpleMessageDrivenBean from administered object SimpleQueue
2018-03-12T16:35:33.182+0100|Information: WELD-000900 2.0.0 (SP1)
2018-03-12T16:35:33.313+0100|Information: EJB5181:Portable JNDI names for EJB SimpleJMSRestfulWebService: [java:global/JMS1/restful-webservice/SimpleJMSRestfulWebService!de.datagroup.jms.SimpleJMSRestfulWebService, java:global/JMS1/restful-webservice/SimpleJMSRestfulWebService]
2018-03-12T16:35:34.231+0100|Warnung: Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
2018-03-12T16:35:34.231+0100|Warnung: Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
2018-03-12T16:35:35.063+0100|Information: Initiating Jersey application, version Jersey: 2.0 2013-05-03 14:50:15...
2018-03-12T16:35:35.427+0100|Information: Loading application [JMS1#restful-webservice.war] at [restful-webservice]
2018-03-12T16:35:35.430+0100|Information: Loading application JMS1 done in 11.460 ms
2018-03-12T16:35:35.447+0100|Information: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
2018-03-12T16:35:35.457+0100|Information: GlassFish Server Open Source Edition  4.0  (89) startup time : Felix (2.316ms), startup services(12.652ms), total(14.968ms)
2018-03-12T16:35:35.597+0100|Information: Initiating Jersey application, version Jersey: 2.0 2013-05-03 14:50:15...
2018-03-12T16:35:37.138+0100|Information: Initiating Jersey application, version Jersey: 2.0 2013-05-03 14:50:15...
2018-03-12T16:35:37.295+0100|Information: Listening to REST requests at context: /management/domain.
2018-03-12T16:35:37.715+0100|Information: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@505bc480 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@5120886f.
2018-03-12T16:35:37.835+0100|Information: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://NBC0403232.consinto.com:8686/jndi/rmi://NBC0403232.consinto.com:8686/jmxrmi
2018-03-12T16:35:37.927+0100|Information: visiting unvisited references
2018-03-12T16:35:38.086+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-common, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common [48]], State = [READY]
2018-03-12T16:35:38.088+0100|Information: this.makeModuleFor(org.glassfish.hk2.hk2, 2.1.92) returned OSGiModuleImpl:: Bundle = [org.glassfish.hk2.hk2 [118]], State = [READY]
2018-03-12T16:35:38.088+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-plugin-service, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-plugin-service [58]], State = [READY]
2018-03-12T16:35:38.093+0100|Information: this.makeModuleFor(org.glassfish.main.deployment.deployment-client, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.deployment.deployment-client [67]], State = [READY]
2018-03-12T16:35:38.093+0100|Information: this.makeModuleFor(org.glassfish.main.registration.registration-api, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.registration.registration-api [230]], State = [READY]
2018-03-12T16:35:38.093+0100|Information: this.makeModuleFor(org.glassfish.main.registration.registration-impl, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.registration.registration-impl [231]], State = [READY]
2018-03-12T16:35:38.094+0100|Information: this.makeModuleFor(javax.servlet-api, 3.1.0) returned OSGiModuleImpl:: Bundle = [javax.servlet-api [147]], State = [READY]
2018-03-12T16:35:38.094+0100|Information: this.makeModuleFor(javax.servlet.jsp-api, 2.3.1) returned OSGiModuleImpl:: Bundle = [javax.servlet.jsp-api [148]], State = [READY]
2018-03-12T16:35:38.094+0100|Information: this.makeModuleFor(com.sun.el.javax.el, 3.0.0) returned OSGiModuleImpl:: Bundle = [com.sun.el.javax.el [132]], State = [READY]
2018-03-12T16:35:38.094+0100|Information: this.makeModuleFor(com.sun.jsftemplating, 2.1.0) returned OSGiModuleImpl:: Bundle = [com.sun.jsftemplating [186]], State = [READY]
2018-03-12T16:35:38.095+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.dataprovider, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.dataprovider [63]], State = [READY]
2018-03-12T16:35:38.095+0100|Information: this.makeModuleFor(com.sun.pkg.client, 1.0.0) returned OSGiModuleImpl:: Bundle = [com.sun.pkg.client [229]], State = [READY]
2018-03-12T16:35:38.095+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-cluster-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-cluster-plugin [46]], State = [READY]
2018-03-12T16:35:38.096+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jts-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jts-plugin [57]], State = [READY]
2018-03-12T16:35:38.096+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-corba-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-corba-plugin [51]], State = [READY]
2018-03-12T16:35:38.098+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-concurrent-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-concurrent-plugin [50]], State = [READY]
2018-03-12T16:35:38.098+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jca-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jca-plugin [54]], State = [READY]
2018-03-12T16:35:38.098+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jdbc-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jdbc-plugin [55]], State = [READY]
2018-03-12T16:35:38.098+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jms-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jms-plugin [56]], State = [READY]
2018-03-12T16:35:38.099+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-web-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-web-plugin [60]], State = [READY]
2018-03-12T16:35:38.099+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-common, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common [48]], State = [READY]
2018-03-12T16:35:38.099+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-updatecenter-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-updatecenter-plugin [59]], State = [READY]
2018-03-12T16:35:38.099+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-community-branding-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-community-branding-plugin [49]], State = [READY]
2018-03-12T16:35:38.099+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-ejb-lite-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-ejb-lite-plugin [52]], State = [READY]
2018-03-12T16:35:38.099+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-ejb-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-ejb-plugin [53]], State = [READY]
2018-03-12T16:35:38.100+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-common-full-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common-full-plugin [47]], State = [READY]
2018-03-12T16:35:38.202+0100|Information: visiting unvisited references
2018-03-12T16:35:38.220+0100|Information: visiting unvisited references
2018-03-12T16:35:38.222+0100|Information: visiting unvisited references
2018-03-12T16:35:38.302+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-common, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common [48]], State = [READY]
2018-03-12T16:35:38.302+0100|Information: this.makeModuleFor(org.glassfish.hk2.hk2, 2.1.92) returned OSGiModuleImpl:: Bundle = [org.glassfish.hk2.hk2 [118]], State = [READY]
2018-03-12T16:35:38.303+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-plugin-service, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-plugin-service [58]], State = [READY]
2018-03-12T16:35:38.303+0100|Information: this.makeModuleFor(org.glassfish.main.deployment.deployment-client, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.deployment.deployment-client [67]], State = [READY]
2018-03-12T16:35:38.303+0100|Information: this.makeModuleFor(org.glassfish.main.registration.registration-api, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.registration.registration-api [230]], State = [READY]
2018-03-12T16:35:38.303+0100|Information: this.makeModuleFor(org.glassfish.main.registration.registration-impl, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.registration.registration-impl [231]], State = [READY]
2018-03-12T16:35:38.304+0100|Information: this.makeModuleFor(javax.servlet-api, 3.1.0) returned OSGiModuleImpl:: Bundle = [javax.servlet-api [147]], State = [READY]
2018-03-12T16:35:38.304+0100|Information: this.makeModuleFor(javax.servlet.jsp-api, 2.3.1) returned OSGiModuleImpl:: Bundle = [javax.servlet.jsp-api [148]], State = [READY]
2018-03-12T16:35:38.304+0100|Information: this.makeModuleFor(com.sun.el.javax.el, 3.0.0) returned OSGiModuleImpl:: Bundle = [com.sun.el.javax.el [132]], State = [READY]
2018-03-12T16:35:38.304+0100|Information: this.makeModuleFor(com.sun.jsftemplating, 2.1.0) returned OSGiModuleImpl:: Bundle = [com.sun.jsftemplating [186]], State = [READY]
2018-03-12T16:35:38.305+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.dataprovider, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.dataprovider [63]], State = [READY]
2018-03-12T16:35:38.305+0100|Information: this.makeModuleFor(com.sun.pkg.client, 1.0.0) returned OSGiModuleImpl:: Bundle = [com.sun.pkg.client [229]], State = [READY]
2018-03-12T16:35:38.305+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-cluster-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-cluster-plugin [46]], State = [READY]
2018-03-12T16:35:38.305+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jts-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jts-plugin [57]], State = [READY]
2018-03-12T16:35:38.305+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-corba-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-corba-plugin [51]], State = [READY]
2018-03-12T16:35:38.306+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-concurrent-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-concurrent-plugin [50]], State = [READY]
2018-03-12T16:35:38.306+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jca-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jca-plugin [54]], State = [READY]
2018-03-12T16:35:38.306+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jdbc-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jdbc-plugin [55]], State = [READY]
2018-03-12T16:35:38.306+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-jms-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-jms-plugin [56]], State = [READY]
2018-03-12T16:35:38.306+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-web-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-web-plugin [60]], State = [READY]
2018-03-12T16:35:38.307+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-common, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common [48]], State = [READY]
2018-03-12T16:35:38.307+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-updatecenter-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-updatecenter-plugin [59]], State = [READY]
2018-03-12T16:35:38.307+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-community-branding-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-community-branding-plugin [49]], State = [READY]
2018-03-12T16:35:38.307+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-ejb-lite-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-ejb-lite-plugin [52]], State = [READY]
2018-03-12T16:35:38.307+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-ejb-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-ejb-plugin [53]], State = [READY]
2018-03-12T16:35:38.308+0100|Information: this.makeModuleFor(org.glassfish.main.admingui.console-common-full-plugin, 4.0.0) returned OSGiModuleImpl:: Bundle = [org.glassfish.main.admingui.console-common-full-plugin [47]], State = [READY]
2018-03-12T16:35:39.439+0100|Information: Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) f�r Kontext '' wird initialisiert.
2018-03-12T16:35:40.902+0100|Information: Loading application [__admingui] at [/]
2018-03-12T16:35:40.903+0100|Information: Loading application __admingui done in 3.350 ms
2018-03-12T16:35:49.793+0100|Information: visiting unvisited references
2018-03-12T16:35:49.867+0100|Information: visiting unvisited references
2018-03-12T16:35:49.937+0100|Information: visiting unvisited references
2018-03-12T16:35:49.943+0100|Information: visiting unvisited references
2018-03-12T16:35:49.949+0100|Information: visiting unvisited references
2018-03-12T16:35:50.033+0100|Information: JMS013: Assuming destination type javax.jms.Queue for MDB SimpleMessageDrivenBean from administered object SimpleQueue
2018-03-12T16:35:50.072+0100|Information: EJB5181:Portable JNDI names for EJB SimpleJMSRestfulWebService: [java:global/JMS1/restful-webservice/SimpleJMSRestfulWebService!de.datagroup.jms.SimpleJMSRestfulWebService, java:global/JMS1/restful-webservice/SimpleJMSRestfulWebService]
2018-03-12T16:35:50.538+0100|Information: Initiating Jersey application, version Jersey: 2.0 2013-05-03 14:50:15...
2018-03-12T16:35:50.597+0100|Information: Loading application [JMS1#restful-webservice.war] at [restful-webservice]
2018-03-12T16:35:50.651+0100|Information: JMS1 was successfully deployed in 977 milliseconds.
2018-03-12T16:36:08.034+0100|Warnung: Context path from ServletContext: /restful-webservice differs from path from bundle: restful-webservice

SimpleJMSRestfulWebService

package de.datagroup.jms;

import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.NamingException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

/**
* Example of a RESTful webservice producing messages for a JMS Queue.
* Call via <a href="http://localhost:8080/webservicetest/jms">http://localhost:8080/webservicetest/jms</a>
* @author Matthias Fraass
*/
@Stateless // dependency injection won't work without that
@Path("/jms")
public class SimpleJMSRestfulWebService {

    @Resource(mappedName = "SimpleConnectionFactory") //= connection factorie's JNDI name
    private ConnectionFactory connectionFactory;

    @Resource(mappedName = "SimpleQueue") //= Queue's JNDI name
    private Queue queue;

    /**
    * Our RESTful webservice
    */
    @GET
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public String putMessage() throws NamingException, JMSException, NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException {
        System.out.println("called putMessage");
        Connection connection = connectionFactory.createConnection();
        Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
        MessageProducer messageProducer = session.createProducer(queue);
        long start = System.currentTimeMillis();
        int i=0;
        do {
            TextMessage message = session.createTextMessage();
            message.setText("Hello, JMS! #"+start);
            messageProducer.send(message);
            i++;
        } while (i < 1000);
        long now = System.currentTimeMillis();
        return "JMS produced 1000 messages within " + (now-start) + "ms";
    }
}

SimpleMessageDrivenBean contained in an EJB module in the parent project JMS1 (like in the tutorial)

package de.datagroup.jms;

import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
* Simple message driven bean.
*/
@MessageDriven(mappedName = "SimpleQueue")
public class SimpleMessageDrivenBean implements MessageListener {

    /**
    * Default constructor.
    */
    public SimpleMessageDrivenBean() {

    }

    /**
    * @see MessageListener#onMessage(Message)
    */
    @Override
    public void onMessage(Message message) {
        try {
            System.out.println("Got message: " + ((TextMessage) message).getText() + " @" + System.currentTimeMillis());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }

}

web.xml Jersey 2.x don't need a web.xml so i removed it.

<?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" version="3.1">
  <display-name>restful-webservice</display-name>

    <servlet>
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>org.glassfish.jersey.config.property.resourceConfigClass</param-name>
            <param-value>org.glassfish.jersey.api.core.PackagesResourceConfig</param-value>
        </init-param>
        <init-param>
            <param-name>org.glassfish.jersey.config.property.packages</param-name>
            <param-value>de.datagroup.jms</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

glassfish-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
    <context-root>/restful-webservice</context-root>
</glassfish-web-app>

Answer:

I think in your glassfish-web.xml you have defined context-root as '/restful-webservice' whereas it is defined as 'restful-webservice' in other places (without the initial forward slash). I think they should be consistent across the board.

Question:

I ve got my maven web project and i want to add my ejb project (the same worksapce) as a liblary. How to make it in the pom.xml? Do I think in a right way?


Answer:

Assuming the MyEjbProject is not another Maven Project you own or want to build with maven, you could use system dependencies to link to the existing jar file of the project like so

<project>
   ...
   <dependencies>
      <dependency>
         <groupId>yourgroup</groupId>
         <artifactId>myejbproject</artifactId>
         <version>2.0</version>
         <scope>system</scope>
         <systemPath>path/to/myejbproject.jar</systemPath>
      </dependency>
   </dependencies>
   ...
</project>

That said it is usually the better (and preferred way) to install the package to the repository either by making it a maven project and building it or installing it the way you already seem to do.

EDIT: If they are, however, dependent on each other, you can always create a separate parent project (has to be a "pom" project) declaring the two other projects as its "modules". (The child projects would not have to declare the third project as their parent). As a consequence you'd get a new directory for the new parent project, where you'd also quite probably put the two independent projects like this:

parent
|- pom.xml
|- MyEJBProject
|   `- pom.xml
`- MyWarProject
    `- pom.xml

The parent project would get a "modules" section to name all the child modules. The aggregator would then use the dependencies in the child modules to actually find out the order in which the projects are to be built)

<project>
   ...
   <artifactId>myparentproject</artifactId>
   <groupId>...</groupId>
   <version>...</version>

   <packaging>pom</packaging>
   ...
   <modules>
     <module>MyEJBModule</module>
     <module>MyWarModule</module>
   </modules>
   ...
</project>

That way the projects can relate to each other but (once they are installed in the local repository) still be used independently as artifacts in other projects

Finally, if your projects are not in related directories, you might try to give them as relative modules:

filesystem
 |- mywarproject
 |   `pom.xml
 |- myejbproject
 |   `pom.xml
 `- parent
     `pom.xml

now you could just do this (worked in maven 2, just tried it):

<!--parent-->
<project>
  <modules>
    <module>../mywarproject</module>
    <module>../myejbproject</module>
  </modules>
</project>

Question:

I have a question.I am integrating EJB, JAX-RS, CDI, JPA, and data sources. When I integrate these into wildfly-swarm, there are some problems that can not work properly.

 yaml.xml:

        datasources:

          jdbc-drivers:
                    com.mysql:
                    driver-class-name: com.mysql.jdbc.Driver
                    xa-datasource-class-name: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
                    driver-module-name: com.mysql

          data-sources:
                    PicketlinkDS:
                    driver-name: com.mysql
                    connection-url: jdbc:mysql://localhost:3306/testjpa
                    user-name: root
                    password: javacom2
                    jta : true
                    use-java-context: true 
                    min-pool-size : 8
                    max-pool-size : 20
                    pool-prefill  : true
                    connection-checker-class-name : org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker
                    background-validation : true
                    exception-sorter-class-name : org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter
                    connection-properties : CharacterEncoding/ UTF-8 UseUnicode/true

persistence.xml:

<persistence-unit name="picketlink" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/PicketlinkDS
</jta-data-source>

                <!-- 声明是否扫描jar文件中标注了@Enity类加入到上下文.若不扫描,则如下:(可选) -->
                <exclude-unlisted-classes>false</exclude-unlisted-classes>

                <properties>
                    <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
                    <property name="hibernate.query.substitutions" value="true=1, false=0" />
                    <property name="hibernate.dialect.storage_enginet"
                              value="innodb" />
                    <!-- JBoss/Wildfly JTA Transaction -->
                    <property name="hibernate.transaction.jta.platform"
                        value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />

                    <property name="hibernate.cache.use_query_cache" value="false" />
                    <property name="hibernate.cache.use_second_level_cache"
                        value="false" />
                    <property name="hibernate.show_sql" value="true" />
                    <property name="hibernate.format_sql" value="false" />

                    <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                    <property name="hibernate.hbm2ddl.import_files" value="initial_data.sql" />
                    <property name="hibernate.jdbc.batch_size" value="1000" />
                    <property name="hibernate.order_inserts" value="true" />
                    <property name="hibernate.order_updates" value="true" />
                    <property name="hibernate.connection.characterEncoding"
                        value="UTF-8" />
                    <property name="hibernate.current_session_context_class"
                        value="jta" />
                    <property name="wildfly.jpa.default-unit" value="true" />  
                </properties>
            </persistence-unit>

main Class:

ClassLoader cl = Main.class.getClassLoader();
URL stageConfig = cl.getResource("project-development.yml");
Swarm swarm = new Swarm().withConfig(stageConfig);

// Create one or more deployments
JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class);
deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml", Main.class.getClassLoader()), "classes/META-INF/persistence.xml");
// Add resource to deployment
//deployment.addClass(PmsPersonService.class);
deployment.addClass(Person.class);
// deployment.addClass(EntityManagerProvider.class);
deployment.addAsWebInfResource(new ClassLoaderAsset("META-INF/load.sql", Main.class.getClassLoader()), "classes/META-INF/load.sql");
deployment.addResource(RestApplication.class);
deployment.addResource(HelloWorldEndpoint.class);
deployment.addAllDependencies();
swarm.start();
swarm.deploy(deployment);

exception: "WFLYCTL0412: Required services that are not installed:" =>"jboss.naming.context.java.jboss.datasources.PicketlinkDS"],

idea ,Run on how to deal with this exception? Very anxious!!!!!!!!


Answer:

First off I'd suggest removing the custom main() as there's nothing specific you're doing there that can't be achieved with Maven war packaging.

Secondly, I think your yaml is missing the swarm: as the first level, and you can also remove the JDBC Driver creation and let WF Swarm do that for you. For that I switched the driver-name to mysql, which will work so long as the JDBC driver dependency for MySQL is part of the project.

swarm:
  datasources:
    data-sources:
      PicketlinkDS:
        driver-name: mysql
        connection-url: jdbc:mysql://localhost:3306/testjpa
        user-name: root
        password: javacom2
        jta: true
        use-java-context: true 
        min-pool-size: 8
        max-pool-size: 20
        pool-prefill: true
        connection-checker-class-name: org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker
        background-validation: true
        exception-sorter-class-name: org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter
        connection-properties: CharacterEncoding/ UTF-8 UseUnicode/true

Question:

I am new in ejb,and i'm trying to run simple ejb application..my application consist of classes Hello(remote interface),HelloBean(class that implements Hello interface) and HelloClient(which i run).Program should write to console "Hello world",but i always get error"Name [HelloBeanName] is not bound in this Context. Unable to find [HelloBeanName]"...Here are those 3 classes Hello Interface:

package vezba2;

public interface Hello {
public String hello();
}

HelloBean:

    package vezba2;

import javax.ejb.Remote;
import javax.ejb.Stateless;

@Stateless(name="HelloBeanName")
@Remote(Hello.class)
public class HelloBean implements Hello{

    @Override
    public String hello() {
        // TODO Auto-generated method stub
        System.out.println("hello()");
        return "Hello,World!"; 

    }


}

HelloClient:

package vezba2;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class HelloClient {

    public static void main(String[] args) throws NamingException {
        // TODO Auto-generated method stub

        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                "org.apache.naming.java.javaURLContextFactory");

        //i first didn't have system.setProperty and i was getting error:Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial//

        Context ctx = new InitialContext();
        Hello hello=(Hello) ctx.lookup("HelloBeanName");
        System.out.println(hello.hello());
    }

}

I am using java8,also ApacheTomee plus 1.7.0 as server,in server folder i have files server.xml,context.xml files,tomcat-users.xml,web.xml files,and in my project i have ejb-jar.xml,and none of those i didn't edited and changed..I also run this application with "Run HelloClient" on green arrow in eclipse.(when i start the server,it doesn't offer to run this on server...)Is there maybe someone know this problem and how can i make my program working? Should i perhaps edit xml files?Should i try to run on server my application?(somehow)...Is there also some good detailed literature on how to run,and work with ejb?Thanks in advance.`

(P.S. When i put this in HelloClient:

System.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory");        System.setProperty(Context.PROVIDER_URL,"http://localhost:8080/tomee/ejb");
    Context ctx = new InitialContext();
    Hello hello=(Hello) ctx.lookup("HelloBeanName");
    System.out.println(hello.hello());

i get following error:

RequestFailed{server=http://localhost:8080/tomee/ejb} JNDI_LOOKUPnull:/HelloBeanName {error=Cannot open input stream to server: }
Exception in thread "main" org.apache.openejb.client.ClientRuntimeException: Invalid response from server: -1
    at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:297)
    at javax.naming.InitialContext.lookup(InitialContext.java:417)
    at vezba2.HelloClient.main(HelloClient.java:18)

now i think i connected apache server and the program which runs HelloClient ..)


Answer:

If your main is not in the container you need to specify how to connect to the server. For tomee the remote context factory is explained there http://tomee.apache.org/advanced/client/jndi.html

Side note: since version 1.7.4 and 7.x the remoting needs some more configuration to avoid the 0-day vulnerability. See http://tomee.apache.org/security/tomee.html

Question:

I am Working on a Project.

In which i am getting the list from DB using named queries already available in the enitiy

whenever i update the data of a field it get changed in DB

but it is not reflected in the list i am getting from the Named Query

Is there any way to get the list refreshed everytime ?

EJB is built as a different project and i have added it as a library to the web appliication.

If i undeploy the project and re-deploy it then the list i recevies is new..

Help Needed

Thanks in Advance.

persistence.xml

<jta-data-source> goes </jta-data-source>


<exclude-unlisted-classes>  false  </exclude-unlisted-classes>


<shared-cache-mode>  NONE </shared-cache-mode>


<properties/>

ejb code

@Override

public List<Universityview>  getAllUniversitys () {


    return em.createNamedQuery ("Universityview.findAll"). 

getResultList(); }


Answer:

Your question has litle to do with EJB itself. Its more of a hibernate/jpa issue. Depends on which one you are using. I assume you are editing the database in a way that your application does not know about? Like with a native query or directly on the database? The problem then is that hibernate uses a 2nd level cache in which the objects from your resultlist are cached. Since you did not update the object through hibernate hibernate has no way of knowing that it changed so it just assumes its still the same and takes theindividual objects from its 2nd level cache.

You can look into this question for answers on how to invalidate the 2nd level cache.

Hibernate 2nd level cache invalidation when another process modifies the database