Quantcast
Channel: GlassFish Related Items on Java.net
Viewing all 1091 articles
Browse latest View live

How to configure Glassfish 3.1.2.2 that I can use admin service remote with security enabled and local with security disabled?

$
0
0

I need a way to use Glassfish 3.1.2.2 admin service (REST call to deploy and configre) from a remote machine and from local machine (command line, REST and applications).

It is clear that for remote access it is necessary to enable secure admin. If we enable secure admin it will break all local access from applications. These application can not be changed to using https to access the admin service. Only thing I can change is that we can use a different port.

I see two possible ways for me:

    Using a hack.
    So I can administrate with secure administrate disable. So I can use plan http. For use a possible solution, because this machine used internally in a test environment.
    Configure Glassfish that we can use admin service remote via secure access https and from a local environment with http.

We prefer solution 1, because it fit better in our environment and we have lesser effort.
At the moment I see no way or exist a solution? This solution will never used in production.

I tried something for solution 2, simular to http-listener-1 http-listener-2. So use two ports 4848 for local unsecure access and as example 4949 for remote secure access.
But I always fail with configuration. So I start with a step by step configuration. First enable admin interface oon two ports and as second step I want to add the secure access to the new port admin-listener. But I got only one of the ports working.

Please can anyone help me with target configuration? Any domain.xml will be welcome.

Thanks florian


Problem deploying ears on CentOS

$
0
0

I have a JEE6 application (including resource adapters) that works perfectly when run within the Netbeans 7.2 IDE on Windows 7 x86_64 (with Oracle JDK 7).

However when I run the same ears on CentOS 6.4 (with Open JDK 1.7.0), I get the following errors:

Error in annotation processing: java.lang.NoClassDefError: javax/resource/cci/MessageListener

Class [ javax/resource/cci/Record] not found. Error while loading [ class...

I have tried including the Java EE 6 API Library in the ear /lib and this makes no difference.

Any suggestions?

Many thanks,
Ralph.

Reminder ... Re: Java EE 7 Live Webcast: Register Now!

$
0
0

Just a reminder that Java EE 7 launch webinar is scheduled for tomorrow.

Register at: http://bit.ly/JavaEE7Launch

Don't miss this exclusive webinar with tons of new content.

Thanks,
Arun

On 5/20/13 10:50 AM, Arun Gupta wrote:
> The Java EE 7 Platform was approved a few days ago.
>
> Do you want to learn the latest and greatest improvements in the
> platform from the best ?
>
> Mark the date for webinars in two different time zones:
>
> Jun 12, 2013, 9am PT
> Jun 12, 2013, 9pm PT
>
> Register now!
>
>
> What will you see in this online event ?
>
> * Business Keynote (Hasan Rizvi and Cameron Purdy)
> * Technical Keynote (Linda DeMichiel)
> * Breakout Sessions on different JSRs by specification leads
> * Live Chat
> * Lots of Demos
> * Community, Partner, and Customer video testimonials
>
>
> More details at:
>
> https://blogs.oracle.com/theaquarium/entry/registration_for_live_webcast...
>
> Make sure to register!
>
> Thanks,
> Arun
> --
> http://twitter.com/arungupta
> http://blogs.oracle.com/arungupta

--
Register for Java EE 7 launch on Jun 12: http://bit.ly/JavaEE7Launch

recent gfv4trunk builds has missing artifacts

$
0
0

i have regularly been updating my svn checkout of gfv4trunk and building - usually once per week.

This last wkend - after update the build would fail.

How should I proceed to fix this issue ?

thanks

-Gary

Clustering two standalone servers

$
0
0

Hi

I am currently investigating the porting of our product to Glassfish 4. We have a couple of scenarios in which we make use of distributed cache to form our own "Domain" of non-homogenous server instances.

I am trying to map this to the glassfish concepts, but I think I am going against the grain a little with regards the DAS and its clusters. What I really want is to have two glassfish installations; host1 and host2, and configure them as standalone servers talking over the same GMS clustering parameters.

Concepts aside for now, is it actually possible to achieve ?

I have installed two separate glassfish distributions and configured both .../domains/domain1/domain.xml and .../domains/domain1/domain.xml files with the same GMS multicast settings, and specified their membership type to be CORE instead of the default SPECTATOR (for DAS).

I can't see anywhere to switch the DAS type off and I cannot find anywhere to specify override instance names (i.e. on boot up they are set to -instancename server)

Glassfish 3.1.2.2: CDI in OSGi webapp with JSF2

$
0
0

Hi,

I'm trying to put together a hybrid OSGi/EE6 web app, using the maven-bundle-plugin to build my WAR. The project includes CDI beans which are being referenced in the JSF pages. When deploying to Glassfish as a regular web application, everything works - this is all familiar territory to me. However when I deploy the same WAR with the OSGi type, my CDI beans are no longer visible in the JSF pages. JSF2 managed beans in the same application still work, however.

I found a post similar to mine here:
https://www.java.net//node/705454

But this refers to injecting into a servlet. I've tested this in my project and if I add a servlet class I can inject my beans into it just fine. In addition, the @OsgiService Glassfish CDI extension is working just fine. So is something going wrong with the FacesServlet? Is it possible to use CDI for a JSF-based WAB on Glassfish, has anyone done this? The official guide mentions that all of EE6 should be available to OSGi web apps but it doesn't seem to work in practice.

Thanks,

Simon Priest

How to change the server name of the top level DAS/Standalone Server

$
0
0

I have installed glassfish 4 and want to override the server name for the default server profile.

<server name="bill" config-ref="server-config">
      <application-ref ref="__admingui" virtual-servers="__asadmin"></application-ref>
      <resource-ref ref="jdbc/__TimerPool"></resource-ref>
      <resource-ref ref="jdbc/__default"></resource-ref>
      <resource-ref ref="jms/__defaultConnectionFactory"></resource-ref>
      <resource-ref ref="concurrent/__defaultManagedScheduledExecutorService"></resource-ref>
      <resource-ref ref="concurrent/__defaultManagedExecutorService"></resource-ref>
      <resource-ref ref="concurrent/__defaultContextService"></resource-ref>
      <resource-ref ref="concurrent/__defaultManagedThreadFactory"></resource-ref>
    </server>

It appears to be hard-coded to "server" because when I change it to anything else, the start-domain process fails with

com.sun.enterprise.universal.xml.MiniXmlParserException: "Xml Parser Error: javax.xml.stream.XMLStreamException: The server element for server does not exist. Command start-domain failed./pre>

Is it possible to change it ? If not, can someone show me in code where I could change it, please.

EJB connection between glassfish servers

$
0
0

Hello I'm facing this problem: I'm traing to consume a remote ejb
published on glassfish from my bean. I have followed up all the steps
descripted on your web but I can't connect with the remote bean.
I'm getting this exception

"javax.naming.NamingException: Exception resolving Ejb for 'Remote
ejb-ref name=referenciaAlEjb,Remote 3.x interface
=com.xxxxx.xxxxxx.BeanRemote,ejb-link=null,lookup=,mappedName=,jndi-name=corbaname:iiop:hostRemoto:3700#com.xxxxx.xxxx xx.BeanRemote . .
."

Ideas???


glassfish undeploy problem

$
0
0

my server glassfish 3.1.1 open source edition

and i create a deploy.sh to deploy my apps
deploy.sh content :
mvn clean
mvn install -Dmaven.test.skip=true
mvn glassfish:undeploy
mvn glassfish:deploy

and i just excute the deploy.sh deploy my app coming across flowing problem that
glassfish domain1 looked like was down without any operations ,details:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Maven Webapp release-3.0.24
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Test ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.172s
[INFO] Finished at: Thu Jun 13 17:46:07 CST 2013
[INFO] Final Memory: 24M/64M
[INFO] ------------------------------------------------------------------------
~~~~~~~~~~~~~clean finished!~~~~~~~~~~~~~~~~
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Maven Webapp release-3.0.24
[INFO] ------------------------------------------------------------------------
Downloading: http://124.127.125.115:9000/nexus/content/repositories/joyveb/opensympho...
[WARNING] The POM for opensymphony:quartz-all:jar:1.6.3 is missing, no dependency information available
[INFO]
[INFO] --- build-helper-maven-plugin:1.5:add-source (default) @ Test ---
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/land/java added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/main/java added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/gens/java added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/state/main added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/state/slto added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/state/pck3 added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/state/loto added.
[INFO] Source directory: /home/javadev/codes/Test/tags/release-3.0.24/src/glbos/java added.
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ Test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO] Copying 29 resources
[INFO] Copying 3 resources
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ Test ---
[INFO] Compiling 443 source files to /home/javadev/codes/Test /tags/release-3.0.24/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ Test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/javadev/codes/Test/tags/release-3.0.24/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ Test ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ Test ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ Test ---
[INFO] Packaging webapp
[INFO] Assembling webapp [Test] in [/home/javadev/codes/Test/tags/release-3.0.24/target/Test]
[INFO] Processing war project
[INFO] Copying webapp webResources [/home/javadev/codes/Test/tags/release-3.0.24/WebContent] to [/home/javadev/codes/Test/tags/release-3.0.24/target/Test]
[INFO] Webapp assembled in [1503 msecs]
[INFO] Building war: /home/javadev/codes/Test/tags/release-3.0.24/target/Test.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] Packaging classes
[INFO] Building jar: /home/javadev/codes/Test/tags/release-3.0.24/target/Test-classes.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ Test---
[INFO] Installing /home/javadev/codes/Test/tags/release-3.0.24/target/Test.war to /home/javadev/.m2/repository/com/joyveb/lottery/Test/release-3.0.24/Test-release-3.0.24.war
[INFO] Installing /home/javadev/codes/Test/tags/release-3.0.24/pom.xml to /home/javadev/.m2/repository/com/joyveb/lottery/Test/release-3.0.24/Test-release-3.0.24.pom
[INFO] Installing /home/javadev/codes/Test/tags/release-3.0.24/target/Test-classes.jar to /home/javadev/.m2/repository/com/joyveb/lottery/Test/release-3.0.24/Test-release-3.0.24-classes.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.349s
[INFO] Finished at: Thu Jun 13 17:46:55 CST 2013
[INFO] Final Memory: 96M/129M
[INFO] ------------------------------------------------------------------------
~~~~~~~~~~~~~install finished!~~~~~~~~~~~~~~~~
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestMaven Webapp release-3.0.24
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-glassfish-plugin:2.1:undeploy (default-cli) @ Test ---
[WARNING] The POM for com.google.code.google-collections:google-collect:jar:snapshot-20080530 is missing, no dependency information available
//no undeploy commond???Isn't the server up? why?? i did not excute any commond except deploy.sh
[INFO] No such local command, undeploy. To run remote commands, start the application server (e.g. 'asadmin start-domain').
[ERROR] Remote server does not listen for requests on [localhost:4848]. Is the server up?
[ERROR] Undeployment of Test failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.627s
[INFO] Finished at: Thu Jun 13 17:47:08 CST 2013
[INFO] Final Memory: 33M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:undeploy (default-cli) on project Test: Undeployment of Test failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
~~~~~~~~~~~~~undeploy finished!~~~~~~~~~~~~~~~~
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Maven Webapp release-3.0.24
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-glassfish-plugin:2.1:deploy (default-cli) @ Test ---
[WARNING] The POM for com.google.code.google-collections:google-collect:jar:snapshot-20080530 is missing, no dependency information available
//domain1 is starting!!!!??
[INFO] Domain domain1 isn't started. Starting it for you.
[INFO] Successfully started the domain : domain1
[INFO] domain Location: /home/javadev/glassfish3/glassfish/domains/domain1
[INFO] Log File: /home/javadev/glassfish3/glassfish/domains/domain1/logs/server.log
[INFO] Admin Port: 4848
[INFO] Debugging is enabled. The debugging port is: 9009
[ERROR] remote failure: Error occurred during deployment: Application with name Test is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name. Please see server.log for more details.
[ERROR] Deployment of /home/javadev/codes/Test/tags/release-3.0.24/target/Test.war failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:02.794s
[INFO] Finished at: Thu Jun 13 17:48:13 CST 2013
[INFO] Final Memory: 34M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy (default-cli) on project Test: Deployment of /home/javadev/codes/Test/tags/release-3.0.24/target/Test.war failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
~~~~~~~~~~~~~deploy finished!~~~~~~~~~~~~~~~~

i will appriciate who who help me analysize this problem kindheartedly!!!!!

Videos hosted on glass fish server are not buffering and playing in Windows 8 Application

$
0
0

i am facing an issue from a 2 months.

I have a glassfish server where my videos are hosted but when i tried it to access it with My Windows 8 application videos do not buffer and play else it is downloading and playing.

When i asked question in forum of windows 8 app for they tell me that i need to configure my glassfish server with a header known as

Accept-Range :bytes

Suggest what to be done show that i can resolve my issue. If any configuration i have to do on my glassfish server please tell me how i can.

Thanks

jdbc realm FINE: [Web-Security] hasResource isGranted: false

$
0
0

Hello , I have a problem with JDBCREALM
the authentification pass correctly , but i'get an acces denied
user:M1
role : admin
group g_admin
this is my server.log :

FINE: [Web-Security] Setting Policy Context ID: old = null ctxID = realmtest/realmtest
FINE: [Web-Security] hasUserDataPermission perm: ("javax.security.jacc.WebUserDataPermission""/admin/j_security_check""POST")
FINE: [Web-Security] hasUserDataPermission isGranted: true
FINEST: Processing login with credentials of type: class com.sun.enterprise.security.auth.login.common.PasswordCredential
FINE: Logging in user [M1] into realm: myRealm using JAAS module: jdbcRealm
FINE: Login module initialized: class com.sun.enterprise.security.auth.login.JDBCLoginModule
SEVERE: SEC1112: Cannot validate user [M1] for JDBC realm.
FINE: Cannot validate user
java.lang.ArrayIndexOutOfBoundsException: 64
at com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm.isUserValid(JDBCRealm.java:444)
at com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm.authenticate(JDBCRealm.java:330)
at com.sun.enterprise.security.auth.login.JDBCLoginModule.authenticate(JDBCLoginModule.java:76)
at com.sun.enterprise.security.auth.login.PasswordLoginModule.authenticateUser(PasswordLoginModule.java:117)
at com.sun.appserv.security.AppservPasswordLoginModule.login(AppservPasswordLoginModule.java:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695)
at javax.security.auth.login.LoginContext.login(LoginContext.java:594)
at com.sun.enterprise.security.auth.login.LoginContextDriver.doPasswordLogin(LoginContextDriver.java:382)
at com.sun.enterprise.security.auth.login.LoginContextDriver.login(LoginContextDriver.java:240)
at com.sun.enterprise.security.auth.login.LoginContextDriver.login(LoginContextDriver.java:153)
at com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:514)
at com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:455)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:268)
at org.apache.catalina.authenticator.AuthenticatorBase.processSecurityCheck(AuthenticatorBase.java:911)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:546)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:623)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)

FINEST: JDBC login succeeded for: M1 groups:[g_admin ]
FINE: JAAS login complete.
FINE: JAAS authentication committed.
FINE: Password login succeeded for : M1
FINE: Set security context as user: M1
FINE: [Web-Security] Setting Policy Context ID: old = null ctxID = realmtest/realmtest
FINE: [Web-Security] hasUserDataPermission perm: ("javax.security.jacc.WebUserDataPermission""/admin/adminpage.xhtml""GET")
FINE: [Web-Security] hasUserDataPermission isGranted: true
FINE: [Web-Security] Policy Context ID was: realmtest/realmtest
FINE: [Web-Security] Codesource with Web URL: file:/realmtest/realmtest
FINE: [Web-Security] Checking Web Permission with Principals : null
FINE: [Web-Security] Web Permission = ("javax.security.jacc.WebResourcePermission""/admin/adminpage.xhtml""GET")
FINEST: JACC Policy Provider: PolicyWrapper.implies, context (realmtest/realmtest)- result was(false) permission (("javax.security.jacc.WebResourcePermission""/admin/adminpage.xhtml""GET"))
FINE: [Web-Security] hasResource isGranted: false
FINE: [Web-Security] hasResource perm: ("javax.security.jacc.WebResourcePermission""/admin/adminpage.xhtml""GET")
FINE: [Web-Security] Policy Context ID was: realmtest/realmtest
FINE: [Web-Security] Generating a protection domain for Permission check.
FINE: [Web-Security] Checking with Principal : M1
FINE: [Web-Security] Checking with Principal : g_admin
FINE: [Web-Security] Codesource with Web URL: file:/realmtest/realmtest
FINE: [Web-Security] Checking Web Permission with Principals : M1, g_admin
FINE: [Web-Security] Web Permission = ("javax.security.jacc.WebResourcePermission""/admin/adminpage.xhtml""GET")
FINEST: JACC Policy Provider: PolicyWrapper.implies, context (realmtest/realmtest)- result was(false) permission (("javax.security.jacc.WebResourcePermission""/admin/adminpage.xhtml""GET"))
FINE: [Web-Security] hasResource isGranted: false
FINE: [Web-Security] hasResource perm: ("javax.security.jacc.WebResourcePermission""/admin/adminpage.xhtml""GET")

thank you for help

Always using DerbyPool

$
0
0

I wanted to create a DB2 Connection Pool and a datasource with v4 final.

Unfortunately my servlet did not use the DB2 pool but the Derby pool (see first exception).
Entry in domain.xml pointed correctly to DB2, but still Derby was taken:

OK, I hacked the Derby pool with the DB2 properties. I got a strange error No password credential found
but the solution from
http://amanica.blogspot.de/2009/02/no-passwordcredential-found.html
(restart the server) helped and my servlet worked with DB2.

Googling the Exception below gives several hits, so this seems to be a quite old bug...

Can anybody confirm/reproduce the bug?

Update: linking jdbc/__default to the db2 pool fixes the problem, too. So it seems Glassfish always uses the default pool.

RAR5038:Unexpected exception while creating resource for pool DerbyPool. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.]]

GFv4, WebSockets sample app

$
0
0

Folks;

not sure whether it's Glassfish or just me: Downloaded the
NetBeans+GFv4 bundle. Followed Aruns pretty good write-up / chat
tutorial [1]. Built. Deployed. Outcome: It's "not working". Not much
more. App deploys, but I neither see any evidence that WebSocket
support is there, nor does the chat application work. It mainly ends up
with a "can't connect to ws://localhost:8080/...".

Found this command...

[...]
asadmin set
configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.websockets-support-enabled=true

Command set executed successfully
[...]

... somewhere on the 'net, which seems to successfully do "something"
yet it doesn't change much about the result.

Is there anything I should know about that? Anything I can do to at
least track down what's happening here?

TIA and all the best,
Kristian

[1]https://blogs.oracle.com/arungupta/entry/websocket_applications_using_java_jsr

glassfish-ejb-jar.xml parsing error deploying a MDB on GF4.

$
0
0

hi,

I've just come across an issue deploying an MDB on Glassfish 4 parsing the glassfish-ejb-jar.xml file. I am not sure what's wrong, the same thing works on Glassfish 3.1.x. Can anybody please tell me what I am doing wrong?

Please, have a look at the server.log file (serverlog.txt) and the glassfish-ejb-jar.xml descriptor attached.
Cheers

AttachmentSize
glassfish-ejb-jar.xml_.txt472 bytes
serverlog.txt9.39 KB

How to debug Glassfish itself

$
0
0

Hi,

I have checked out the GF sources and I'm able to successfully compile the whole glassfish project in netbeans.

My question is, how can I debug the glassfish project in netbeans, so I can watch the startup process, set breakpoints and so on? The "run" and "debug" buttons in netbeans are disabled.

Thanks for your help.

Wasomumba


Use of WS-AtomicTransaction from a standalone java client

$
0
0

Is it possible to to control the transaction boundary from a standalone java (7) client when calling a web service in glassfish (4.0) which is implemented to participate in WS-AtomicTransaction.

The webservice is defined as follows;

@WebService
@Stateless
@Transactional(value = Transactional.TransactionFlowType.SUPPORTS,
version = com.sun.xml.ws.api.tx.at.Transactional.Version.WSAT10)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class Bean1 {

@Resource(mappedName = "java:appserver/TransactionManager")
private TransactionManager txManager;
    /**
     * Default constructor.
     */
    public Bean1() {
        // TODO Auto-generated constructor stub
    }
   
    private static String getTxStatus(int status)
    {
    switch(status)
    {
    case Status.STATUS_ACTIVE:
    return "Active";
    case Status.STATUS_COMMITTED:
    return "Committed";
    case Status.STATUS_COMMITTING:
    return "Committing";
    case Status.STATUS_MARKED_ROLLBACK:
    return "Marked for rollback";
    case Status.STATUS_NO_TRANSACTION:
    return "No Transaction";
    case Status.STATUS_PREPARED:
    return "Prepared";
    case Status.STATUS_PREPARING:
    return "Preparing";
    case Status.STATUS_ROLLEDBACK:
    return "Rolledback";
    case Status.STATUS_ROLLING_BACK:
    return "Rollingback";
    case Status.STATUS_UNKNOWN:
    return "Status set to STATUS_UNKNOWN";
    }
    return "Unknown Status " + status;
    }
   
    private String getTxName()
    {
    try {
if(txManager==null)
{
return "No Transaction Manager";
}
else
{
if(txManager.getTransaction() == null)
{
return "No Transaction";
}
else
{
return "A Transaction: status=" + getTxStatus(txManager.getTransaction().getStatus()) + ". {Transaction: " + txManager.getTransaction() +"}";
}
}
} catch (SystemException e) {
return "Error getting TxName: " + e;
}
    }

    @WebMethod
    public String hello(String tag)
    {
    return tag + " you!" + getTxName();
    }
}

The client code uses the wsimport generated client stubs;

Bean1 proxy = new Bean1Service().getBean1Port();
System.out.println(proxy.hello("Hello"));

This works fine as is.
But suppose I wish to control the transaction from the java client in a manner similar to that described in the metro tutorial chap 18; Is there anyway that can work? I am quite happy to use the TransactionManager from the local glassfish to provide the UserTransaction and coordinate, but I would need the transaction to 'flow back in' on the web method and be externally controllable...

import java.rmi.RemoteException;

import javax.naming.InitialContext;
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.transaction.UserTransaction;

import org.junit.Test;

import uk.co.his.ejbproject1.Bean1;
import uk.co.his.ejbproject1.Bean1Service;

import com.sun.xml.ws.api.tx.at.Transactional.TransactionFlowType;
import com.sun.xml.ws.api.tx.at.Transactional.Version;
import com.sun.xml.ws.api.tx.at.TransactionalFeature;

public class TestClient {

@Test
public void test() throws RemoteException, NamingException,
SecurityException, IllegalStateException, RollbackException,
HeuristicMixedException, HeuristicRollbackException,
SystemException, NotSupportedException {

UserTransaction utx = null;

try {
InitialContext ctx = new InitialContext();
utx = (UserTransaction) ctx.lookup("javax.transaction"
+ ".UserTransaction");
utx.setTransactionTimeout(900);
} catch (java.lang.Exception e) {
e.printStackTrace();
}

TransactionalFeature feature = new TransactionalFeature();
feature.setFlowType(TransactionFlowType.MANDATORY);
feature.setVersion(Version.WSAT10);

Bean1 proxy = new Bean1Service().getBean1Port();

utx.begin();
System.out.println(proxy.hello("Hello"));
utx.commit();
}

}

It would seem this is never possible because the Metro runtimes are looking for a local transaction manager which includes transaction log file directory information.

So when I run with the following container setup...

	@Test
public void test3() throws Exception, UserError
{
TargetServer server = new TargetServer("localhost", 4848);
TargetServer[] servers = { server };
// Get a builder to set up the ACC
AppClientContainer.Builder builder = AppClientContainer.newBuilder(servers);
AppClientContainer acc = builder.newContainer(TestClient.class);
acc.startClient(new String[0]);
}


public static void main(String[] args) throws NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException
{
UserTransaction utx = null;
try {
    InitialContext ctx = new InitialContext();
   
    utx = (UserTransaction)ctx.lookup("java:comp/UserTransaction");
        utx.setTransactionTimeout(900);

       

      
    } catch (java.lang.Exception e) {
        e.printStackTrace();
    }
   
TransactionalFeature feature = new TransactionalFeature();
        feature.setFlowType(TransactionFlowType.MANDATORY);
        feature.setVersion(Version.WSAT10);


Bean1 proxy = new Bean1Service().getBean1Port(feature);

        utx.begin();
/*System.out.println(proxy.hello("Hello"));
ComplexData1 data = new ComplexData1();
data.setName("Fred");
data.getChildData().addAll(createComplexData2(10));
printOutComplexData("before", data);
ComplexData1 result = proxy.processData(data, "World!");
data.setName("No longer Fred");
printOutComplexData("after", result);*/
utx.commit();
        System.out.println("Dones");
}

I get the following;
Jul 08, 2013 7:12:23 PM [com.sun.xml.ws.tx.at.common.TransactionImportManager]  <init>
INFO: Missing required extension methods detected on 'javax.transaction.TransactionManager' implementation 'com.sun.enterprise.transaction.TransactionManagerHelper':
getTxLogLocation

Jul 08, 2013 7:12:27 PM [com.sun.xml.ws.tx.at.internal.WSATGatewayRM]  setTxLogDirs
INFO: txlogdir isnull

The com.sun.enterprise.transaction.TransactionManagerHelper is a wrapper around the JNDI lookup for java:appserver/TransactionManager which presumably could be local or remote and might or might not (NOT in the case of a 'standalone' client) have access to the tx logging dirs...
thanks

Default logging.properties file location in 3.1.1

$
0
0

Hi,
I am using 3.1.1 glassfish server.
Where i need to place the logging.properties file in the server location.
It contains log file path. Whenever application got initialized, it should create log entry.

Please let me know where i need to place the logging.properties in server path.

Thanks,

HTTP Status 403-Access to the requested resource has been denied.

$
0
0

Hi: I am getting the error when I log in: Any help to resolve is highly appreciated.
Here is log file:
[#|2013-07-08T12:01:48.739-0400|INFO|glassfish3.1.1|javax.enterprise.system.core.security|_ThreadID=20;_ThreadName=Thread-2;|JACC Policy Provider:Failed Permission Check: context (" __admingui/__admingui ") , permission (" (javax.security.jacc.WebUserDataPermission GET) ") |#]

[#|2013-07-08T12:01:48.756-0400|INFO|glassfish3.1.1|javax.enterprise.system.core.security|_ThreadID=20;_ThreadName=Thread-2;|JACC Policy Provider:Failed Permission Check: context (" __admingui/__admingui ") , permission (" (javax.security.jacc.WebUserDataPermission GET:CONFIDENTIAL) ") |#]
NPR

how to have multiple web services in single web app

$
0
0

Using Netbeans it is easy to create a JAX-WS web service.

I can even create multiple web services in single web app - but when I deploy I get errors - SEVERE - msgs about different services being deployed to same endpoint URL.

How to configure multiple jax-ws web services in same web  app ?

Is there some documentation you can point me too ? 

Some tutorial in this aspect of JAX-WS ?

Thanks
-Gary

start/stop-instance does not work when nodedir is not default

$
0
0

Hi,

I have a problem with the following command:
asadmin --user gf_user --passwordfile /tmp/.gf_pwd --port 32152 stop-instance --force=true --kill=true inst0
remote failure: Failed to stop instance inst0 on node host1_TEST using stop-local-instance --kill inst0

Command failed on node host1_TEST (host1): Command stop-local-instance failed.

Node directory /glassfish3/glassfish/nodes does not exist or is not a directory

To complete this operation run the following command locally on host host1 from the GlassFish install location /glassfish3:

stop-local-instance --kill inst0
Command stop-instance failed.
...
In my case nodes directory is not in "GlassFish install location", I explicitly re-define it when creating nodes.
start-local-instance and stop-local-instance commands have --nodedir parameter and work as expected. But I need to control instance running on the remote host, so I tried to use start-instance/stop-instance, so far with no success.
Is there any solution for this?

Thank you.

Viewing all 1091 articles
Browse latest View live